From 63e683d19f28b472a652bd7d41d7f6935cf89763 Mon Sep 17 00:00:00 2001 From: mirkoCrobu Date: Tue, 11 Nov 2025 17:13:45 +0100 Subject: [PATCH 1/2] expose serial number for App-Lab in network mode --- pkg/board/board.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/board/board.go b/pkg/board/board.go index 9669a3b3..77e1063d 100644 --- a/pkg/board/board.go +++ b/pkg/board/board.go @@ -182,11 +182,9 @@ func FromFQBN(ctx context.Context, fqbn string) ([]Board, error) { if len(port.GetMatchingBoards()) > 0 { boardName = port.GetMatchingBoards()[0].GetName() } - + serial := strings.ToLower(port.GetPort().GetHardwareId()) // in windows this is uppercase. switch port.GetPort().GetProtocol() { case SerialProtocol: - serial := strings.ToLower(port.GetPort().GetHardwareId()) // in windows this is uppercase. - // TODO: we should store the board custom name in the product id so we can get it from the discovery service. var customName string if conn, err := adb.FromSerial(serial, ""); err == nil { @@ -215,6 +213,7 @@ func FromFQBN(ctx context.Context, fqbn string) ([]Board, error) { boards = append(boards, Board{ Protocol: NetworkProtocol, Address: port.GetPort().GetAddress(), + Serial: serial, BoardName: boardName, CustomName: customName, }) From 36db25a370ab8c4ee3df6e7023102e315ec87b14 Mon Sep 17 00:00:00 2001 From: mirkoCrobu Date: Wed, 12 Nov 2025 11:10:59 +0100 Subject: [PATCH 2/2] fix the way to retrive serial number for network --- pkg/board/board.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/board/board.go b/pkg/board/board.go index 77e1063d..3dac4af2 100644 --- a/pkg/board/board.go +++ b/pkg/board/board.go @@ -182,9 +182,10 @@ func FromFQBN(ctx context.Context, fqbn string) ([]Board, error) { if len(port.GetMatchingBoards()) > 0 { boardName = port.GetMatchingBoards()[0].GetName() } - serial := strings.ToLower(port.GetPort().GetHardwareId()) // in windows this is uppercase. + switch port.GetPort().GetProtocol() { case SerialProtocol: + serial := strings.ToLower(port.GetPort().GetHardwareId()) // in windows this is uppercase. // TODO: we should store the board custom name in the product id so we can get it from the discovery service. var customName string if conn, err := adb.FromSerial(serial, ""); err == nil { @@ -209,6 +210,10 @@ func FromFQBN(ctx context.Context, fqbn string) ([]Board, error) { } customName = name[:idx] } + var serial string + if sn, ok := port.GetPort().GetProperties()["serial_number"]; ok { + serial = sn + } boards = append(boards, Board{ Protocol: NetworkProtocol,