From a24d9b53a3962fa0377dbb86730078f170b581cd Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 6 Feb 2023 18:59:58 +0100 Subject: [PATCH] Added support for `hardwareId` field. See https://github.com/arduino/arduino-cli/pull/2065 --- discovery.go | 1 + dummy-discovery/main.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/discovery.go b/discovery.go index fe9f73b..db9265b 100644 --- a/discovery.go +++ b/discovery.go @@ -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 diff --git a/dummy-discovery/main.go b/dummy-discovery/main.go index 85335d6..9270a5c 100644 --- a/dummy-discovery/main.go +++ b/dummy-discovery/main.go @@ -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, }), } }