You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dummy-monitor/README.md
+66-72
Original file line number
Diff line number
Diff line change
@@ -219,105 +219,99 @@ If the client sends an invalid or malformed command, the monitor should answer w
219
219
```
220
220
fis
221
221
### Example of usage
222
-
<!-- TODO -->
222
+
223
223
A possible transcript of the monitor usage:
224
224
225
225
```
226
-
HELLO 1 "arduino-cli"
226
+
HELLO 1 "test"
227
227
{
228
228
"eventType": "hello",
229
229
"message": "OK",
230
230
"protocolVersion": 1
231
231
}
232
-
START
233
-
{
234
-
"eventType": "start",
235
-
"message": "OK"
236
-
}
237
-
LIST
232
+
DESCRIBE
238
233
{
239
-
"eventType": "list",
240
-
"ports": [
241
-
{
242
-
"address": "1",
243
-
"label": "Dummy upload port",
244
-
"protocol": "dummy",
245
-
"protocolLabel": "Dummy protocol",
246
-
"properties": {
247
-
"mac": "73622384782",
248
-
"pid": "0x0041",
249
-
"vid": "0x2341"
234
+
"eventType": "describe",
235
+
"message": "OK",
236
+
"port_description": {
237
+
"protocol": "test",
238
+
"configuration_parameters": {
239
+
"echo": {
240
+
"label": "echo",
241
+
"type": "enum",
242
+
"value": [
243
+
"on",
244
+
"off"
245
+
],
246
+
"selected": "on"
247
+
},
248
+
"speed": {
249
+
"label": "Baudrate",
250
+
"type": "enum",
251
+
"value": [
252
+
"9600",
253
+
"19200",
254
+
"38400",
255
+
"57600",
256
+
"115200"
257
+
],
258
+
"selected": "9600"
250
259
}
251
260
}
252
-
]
253
-
}
254
-
STOP
255
-
{
256
-
"eventType": "stop",
257
-
"message": "OK"
258
-
}
259
-
START_SYNC
260
-
{
261
-
"eventType": "start_sync",
262
-
"message": "OK"
263
-
}
264
-
{
265
-
"eventType": "add",
266
-
"port": {
267
-
"address": "2",
268
-
"label": "Dummy upload port",
269
-
"protocol": "dummy",
270
-
"protocolLabel": "Dummy protocol",
271
-
"properties": {
272
-
"mac": "147244769564",
273
-
"pid": "0x0041",
274
-
"vid": "0x2341"
275
-
}
276
261
}
277
262
}
263
+
CONFIGURE speed 19200
278
264
{
279
-
"eventType": "add",
280
-
"port": {
281
-
"address": "3",
282
-
"label": "Dummy upload port",
283
-
"protocol": "dummy",
284
-
"protocolLabel": "Dummy protocol",
285
-
"properties": {
286
-
"mac": "220867154346",
287
-
"pid": "0x0041",
288
-
"vid": "0x2341"
289
-
}
290
-
}
265
+
"eventType": "configure",
266
+
"message": "OK"
291
267
}
268
+
DESCRIBE
292
269
{
293
-
"eventType": "add",
294
-
"port": {
295
-
"address": "4",
296
-
"label": "Dummy upload port",
297
-
"protocol": "dummy",
298
-
"protocolLabel": "Dummy protocol",
299
-
"properties": {
300
-
"mac": "294489539128",
301
-
"pid": "0x0041",
302
-
"vid": "0x2341"
270
+
"eventType": "describe",
271
+
"message": "OK",
272
+
"port_description": {
273
+
"protocol": "test",
274
+
"configuration_parameters": {
275
+
"echo": {
276
+
"label": "echo",
277
+
"type": "enum",
278
+
"value": [
279
+
"on",
280
+
"off"
281
+
],
282
+
"selected": "on"
283
+
},
284
+
"speed": {
285
+
"label": "Baudrate",
286
+
"type": "enum",
287
+
"value": [
288
+
"9600",
289
+
"19200",
290
+
"38400",
291
+
"57600",
292
+
"115200"
293
+
],
294
+
"selected": "19200"
295
+
}
303
296
}
304
297
}
305
298
}
299
+
OPEN 127.0.0.1:5678 "test"
306
300
{
307
-
"eventType": "remove",
308
-
"port": {
309
-
"address": "4",
310
-
"protocol": "dummy"
311
-
}
301
+
"eventType": "open",
302
+
"message": "OK"
312
303
}
313
-
QUIT
304
+
CLOSE
314
305
{
315
-
"eventType": "quit",
306
+
"eventType": "close",
316
307
"message": "OK"
317
308
}
309
+
QUIT
318
310
$
319
311
```
320
312
313
+
On another terminal tab to test it you can run `nc -l -p 5678` before running the `OPEN 127.0.0.1:5678 "test"` command. After that you can write messages in that terminal tab and see them being echoed.
314
+
321
315
## Security
322
316
323
317
If you think you found a vulnerability or other security-related bug in this project, please read our
0 commit comments