Skip to content

Commit

Permalink
Added support for hardwareId field.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Feb 6, 2023
1 parent 9863c7b commit a24d9b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type Port struct {
Protocol string `json:"protocol,omitempty"`
ProtocolLabel string `json:"protocolLabel,omitempty"`
Properties *properties.Map `json:"properties,omitempty"`
HardwareID string `json:"hardwareId,omitempty"`
}

// Discovery is an interface that represents the business logic that
Expand Down
4 changes: 3 additions & 1 deletion dummy-discovery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,17 @@ var dummyCounter = 0
// createDummyPort creates a Port with fake data
func createDummyPort() *discovery.Port {
dummyCounter++
mac := fmt.Sprintf("%d", dummyCounter*384782)
return &discovery.Port{
Address: fmt.Sprintf("%d", dummyCounter),
AddressLabel: "Dummy upload port",
Protocol: "dummy",
ProtocolLabel: "Dummy protocol",
HardwareID: mac,
Properties: properties.NewFromHashmap(map[string]string{
"vid": "0x2341",
"pid": "0x0041",
"mac": fmt.Sprintf("%d", dummyCounter*384782),
"mac": mac,
}),
}
}

0 comments on commit a24d9b5

Please sign in to comment.