Skip to content

Commit 810667b

Browse files
umbynoscmaglie
authored andcommitted
update the dummy-monitor/README.md to include Example of usage section
1 parent 8a92d40 commit 810667b

File tree

1 file changed

+66
-72
lines changed

1 file changed

+66
-72
lines changed

dummy-monitor/README.md

+66-72
Original file line numberDiff line numberDiff line change
@@ -219,105 +219,99 @@ If the client sends an invalid or malformed command, the monitor should answer w
219219
```
220220
fis
221221
### Example of usage
222-
<!-- TODO -->
222+
223223
A possible transcript of the monitor usage:
224224

225225
```
226-
HELLO 1 "arduino-cli"
226+
HELLO 1 "test"
227227
{
228228
"eventType": "hello",
229229
"message": "OK",
230230
"protocolVersion": 1
231231
}
232-
START
233-
{
234-
"eventType": "start",
235-
"message": "OK"
236-
}
237-
LIST
232+
DESCRIBE
238233
{
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"
250259
}
251260
}
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-
}
276261
}
277262
}
263+
CONFIGURE speed 19200
278264
{
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"
291267
}
268+
DESCRIBE
292269
{
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+
}
303296
}
304297
}
305298
}
299+
OPEN 127.0.0.1:5678 "test"
306300
{
307-
"eventType": "remove",
308-
"port": {
309-
"address": "4",
310-
"protocol": "dummy"
311-
}
301+
"eventType": "open",
302+
"message": "OK"
312303
}
313-
QUIT
304+
CLOSE
314305
{
315-
"eventType": "quit",
306+
"eventType": "close",
316307
"message": "OK"
317308
}
309+
QUIT
318310
$
319311
```
320312

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+
321315
## Security
322316

323317
If you think you found a vulnerability or other security-related bug in this project, please read our

0 commit comments

Comments
 (0)