Skip to content

Commit 5bcedf4

Browse files
authored
Expose serial number for App-Lab in network mode (#63)
* expose serial number for App-Lab in network mode * fix the way to retrive serial number for network
1 parent 4f24059 commit 5bcedf4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/board/board.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ func FromFQBN(ctx context.Context, fqbn string) ([]Board, error) {
186186
switch port.GetPort().GetProtocol() {
187187
case SerialProtocol:
188188
serial := strings.ToLower(port.GetPort().GetHardwareId()) // in windows this is uppercase.
189-
190189
// TODO: we should store the board custom name in the product id so we can get it from the discovery service.
191190
var customName string
192191
if conn, err := adb.FromSerial(serial, ""); err == nil {
@@ -211,10 +210,15 @@ func FromFQBN(ctx context.Context, fqbn string) ([]Board, error) {
211210
}
212211
customName = name[:idx]
213212
}
213+
var serial string
214+
if sn, ok := port.GetPort().GetProperties()["serial_number"]; ok {
215+
serial = sn
216+
}
214217

215218
boards = append(boards, Board{
216219
Protocol: NetworkProtocol,
217220
Address: port.GetPort().GetAddress(),
221+
Serial: serial,
218222
BoardName: boardName,
219223
CustomName: customName,
220224
})

0 commit comments

Comments
 (0)