Skip to content

Commit 2b98efe

Browse files
committed
Added HardwareID support
1 parent a8b2763 commit 2b98efe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sync/sync.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,22 @@ func portListHas(list []*enumerator.PortDetails, port *enumerator.PortDetails) b
6565

6666
func toDiscoveryPort(port *enumerator.PortDetails) *discovery.Port {
6767
protocolLabel := "Serial Port"
68+
hardwareID := ""
6869
props := properties.NewMap()
6970
if port.IsUSB {
7071
protocolLabel += " (USB)"
7172
props.Set("vid", "0x"+port.VID)
7273
props.Set("pid", "0x"+port.PID)
7374
props.Set("serialNumber", port.SerialNumber)
75+
hardwareID = port.SerialNumber
7476
}
7577
res := &discovery.Port{
7678
Address: port.Name,
7779
AddressLabel: port.Name,
7880
Protocol: "serial",
7981
ProtocolLabel: protocolLabel,
8082
Properties: props,
83+
HardwareID: hardwareID,
8184
}
8285
return res
8386
}

0 commit comments

Comments
 (0)