diff --git a/dummy-monitor/README.md b/dummy-monitor/README.md index 3c7acf1..c0a521d 100644 --- a/dummy-monitor/README.md +++ b/dummy-monitor/README.md @@ -219,105 +219,99 @@ If the client sends an invalid or malformed command, the monitor should answer w ``` fis ### Example of usage - + A possible transcript of the monitor usage: ``` -HELLO 1 "arduino-cli" +HELLO 1 "test" { "eventType": "hello", "message": "OK", "protocolVersion": 1 } -START -{ - "eventType": "start", - "message": "OK" -} -LIST +DESCRIBE { - "eventType": "list", - "ports": [ - { - "address": "1", - "label": "Dummy upload port", - "protocol": "dummy", - "protocolLabel": "Dummy protocol", - "properties": { - "mac": "73622384782", - "pid": "0x0041", - "vid": "0x2341" + "eventType": "describe", + "message": "OK", + "port_description": { + "protocol": "test", + "configuration_parameters": { + "echo": { + "label": "echo", + "type": "enum", + "value": [ + "on", + "off" + ], + "selected": "on" + }, + "speed": { + "label": "Baudrate", + "type": "enum", + "value": [ + "9600", + "19200", + "38400", + "57600", + "115200" + ], + "selected": "9600" } } - ] -} -STOP -{ - "eventType": "stop", - "message": "OK" -} -START_SYNC -{ - "eventType": "start_sync", - "message": "OK" -} -{ - "eventType": "add", - "port": { - "address": "2", - "label": "Dummy upload port", - "protocol": "dummy", - "protocolLabel": "Dummy protocol", - "properties": { - "mac": "147244769564", - "pid": "0x0041", - "vid": "0x2341" - } } } +CONFIGURE speed 19200 { - "eventType": "add", - "port": { - "address": "3", - "label": "Dummy upload port", - "protocol": "dummy", - "protocolLabel": "Dummy protocol", - "properties": { - "mac": "220867154346", - "pid": "0x0041", - "vid": "0x2341" - } - } + "eventType": "configure", + "message": "OK" } +DESCRIBE { - "eventType": "add", - "port": { - "address": "4", - "label": "Dummy upload port", - "protocol": "dummy", - "protocolLabel": "Dummy protocol", - "properties": { - "mac": "294489539128", - "pid": "0x0041", - "vid": "0x2341" + "eventType": "describe", + "message": "OK", + "port_description": { + "protocol": "test", + "configuration_parameters": { + "echo": { + "label": "echo", + "type": "enum", + "value": [ + "on", + "off" + ], + "selected": "on" + }, + "speed": { + "label": "Baudrate", + "type": "enum", + "value": [ + "9600", + "19200", + "38400", + "57600", + "115200" + ], + "selected": "19200" + } } } } +OPEN 127.0.0.1:5678 "test" { - "eventType": "remove", - "port": { - "address": "4", - "protocol": "dummy" - } + "eventType": "open", + "message": "OK" } -QUIT +CLOSE { - "eventType": "quit", + "eventType": "close", "message": "OK" } +QUIT $ ``` +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. + ## Security If you think you found a vulnerability or other security-related bug in this project, please read our