Skip to content

Commit a24d9b5

Browse files
committed
Added support for hardwareId field.
See arduino/arduino-cli#2065
1 parent 9863c7b commit a24d9b5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: discovery.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Port struct {
4646
Protocol string `json:"protocol,omitempty"`
4747
ProtocolLabel string `json:"protocolLabel,omitempty"`
4848
Properties *properties.Map `json:"properties,omitempty"`
49+
HardwareID string `json:"hardwareId,omitempty"`
4950
}
5051

5152
// Discovery is an interface that represents the business logic that

Diff for: dummy-discovery/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ var dummyCounter = 0
125125
// createDummyPort creates a Port with fake data
126126
func createDummyPort() *discovery.Port {
127127
dummyCounter++
128+
mac := fmt.Sprintf("%d", dummyCounter*384782)
128129
return &discovery.Port{
129130
Address: fmt.Sprintf("%d", dummyCounter),
130131
AddressLabel: "Dummy upload port",
131132
Protocol: "dummy",
132133
ProtocolLabel: "Dummy protocol",
134+
HardwareID: mac,
133135
Properties: properties.NewFromHashmap(map[string]string{
134136
"vid": "0x2341",
135137
"pid": "0x0041",
136-
"mac": fmt.Sprintf("%d", dummyCounter*384782),
138+
"mac": mac,
137139
}),
138140
}
139141
}

0 commit comments

Comments
 (0)