Skip to content

Commit

Permalink
update the dummy-monitor/README.md to include Example of usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
umbynos authored and cmaglie committed Sep 9, 2021
1 parent 8a92d40 commit 810667b
Showing 1 changed file with 66 additions and 72 deletions.
138 changes: 66 additions & 72 deletions dummy-monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,105 +219,99 @@ If the client sends an invalid or malformed command, the monitor should answer w
```
fis
### Example of usage
<!-- TODO -->

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
Expand Down

0 comments on commit 810667b

Please sign in to comment.