@@ -99,15 +99,10 @@ func watchList(inst *rpc.Instance) {
99
99
100
100
for event := range eventsChan {
101
101
feedback .PrintResult (watchEvent {
102
- Type : event .EventType ,
103
- Label : event .Port .Port .Label ,
104
- Address : event .Port .Port .Address ,
105
- Protocol : event .Port .Port .Protocol ,
106
- ProtocolLabel : event .Port .Port .ProtocolLabel ,
107
- HardwareID : event .Port .Port .HardwareId ,
108
- Properties : event .Port .Port .Properties ,
109
- Boards : event .Port .MatchingBoards ,
110
- Error : event .Error ,
102
+ Type : event .EventType ,
103
+ Boards : event .Port .MatchingBoards ,
104
+ Port : event .Port .Port ,
105
+ Error : event .Error ,
111
106
})
112
107
}
113
108
}
@@ -176,15 +171,10 @@ func (dr result) String() string {
176
171
}
177
172
178
173
type watchEvent struct {
179
- Type string `json:"type"`
180
- Address string `json:"address,omitempty"`
181
- Label string `json:"label,omitempty"`
182
- Protocol string `json:"protocol,omitempty"`
183
- ProtocolLabel string `json:"protocol_label,omitempty"`
184
- HardwareID string `json:"hardwareId,omitempty"`
185
- Properties map [string ]string `json:"properties"`
186
- Boards []* rpc.BoardListItem `json:"boards,omitempty"`
187
- Error string `json:"error,omitempty"`
174
+ Type string `json:"eventType"`
175
+ Boards []* rpc.BoardListItem `json:"matching_boards,omitempty"`
176
+ Port * rpc.Port `json:"port,omitempty"`
177
+ Error string `json:"error,omitempty"`
188
178
}
189
179
190
180
func (dr watchEvent ) Data () interface {} {
@@ -199,11 +189,11 @@ func (dr watchEvent) String() string {
199
189
"remove" : tr ("Disconnected" ),
200
190
}[dr .Type ]
201
191
202
- address := fmt .Sprintf ("%s://%s" , dr .Protocol , dr .Address )
203
- if dr .Protocol == "serial" || dr .Protocol == "" {
204
- address = dr .Address
192
+ address := fmt .Sprintf ("%s://%s" , dr .Port . Protocol , dr . Port .Address )
193
+ if dr .Port . Protocol == "serial" || dr . Port .Protocol == "" {
194
+ address = dr .Port . Address
205
195
}
206
- protocol := dr .ProtocolLabel
196
+ protocol := dr .Port . ProtocolLabel
207
197
if boards := dr .Boards ; len (boards ) > 0 {
208
198
sort .Slice (boards , func (i , j int ) bool {
209
199
x , y := boards [i ], boards [j ]
0 commit comments