Skip to content

Commit 5f37f2e

Browse files
committed
Correct output in dummy-monitor docs to reflect actual behavior of tool
The dummy-monitor demo tool's readme content did not match the actual output of the tool.
1 parent a56d908 commit 5f37f2e

File tree

1 file changed

+46
-47
lines changed

1 file changed

+46
-47
lines changed

dummy-monitor/README.md

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The response to the command is:
3232
```json
3333
{
3434
"eventType": "hello",
35-
"protocolVersion": 1,
36-
"message": "OK"
35+
"message": "OK",
36+
"protocolVersion": 1
3737
}
3838
```
3939

@@ -43,40 +43,34 @@ The response to the command is:
4343

4444
The `DESCRIBE` command returns a description of the communication port. The description will have metadata about the port configuration, and which parameters are available:
4545

46+
<!-- prettier-ignore -->
4647
```json
4748
{
48-
"event": "describe",
49-
"message": "ok",
49+
"eventType": "describe",
50+
"message": "OK",
5051
"port_description": {
51-
"protocol": "serial",
52+
"protocol": "test",
5253
"configuration_parameters": {
53-
"baudrate": {
54-
"label": "Baudrate",
54+
"echo": {
55+
"label": "echo",
5556
"type": "enum",
56-
"values": [
57-
"300", "600", "750", "1200", "2400", "4800", "9600",
58-
"19200", "38400", "57600", "115200", "230400", "460800",
59-
"500000", "921600", "1000000", "2000000"
57+
"value": [
58+
"on",
59+
"off"
6060
],
61-
"selected": "9600"
62-
},
63-
"parity": {
64-
"label": "Parity",
65-
"type": "enum",
66-
"values": [ "N", "E", "O", "M", "S" ],
67-
"selected": "N"
68-
},
69-
"bits": {
70-
"label": "Data bits",
71-
"type": "enum",
72-
"values": [ "5", "6", "7", "8", "9" ],
73-
"selected": "8"
61+
"selected": "on"
7462
},
75-
"stop_bits": {
76-
"label": "Stop bits",
63+
"speed": {
64+
"label": "Baudrate",
7765
"type": "enum",
78-
"values": [ "1", "1.5", "2" ],
79-
"selected": "1"
66+
"value": [
67+
"9600",
68+
"19200",
69+
"38400",
70+
"57600",
71+
"115200"
72+
],
73+
"selected": "9600"
8074
}
8175
}
8276
}
@@ -87,7 +81,7 @@ Each parameter has a unique name (`baudrate`, `parity`, etc...), a `type` (in th
8781

8882
The parameter name can not contain spaces, and the allowed characters in the name are alphanumerics, underscore `_`, dot `.`, and dash `-`.
8983

90-
The `enum` types must have a list of possible `values`.
84+
The `enum` types must have a list of possible `value`.
9185

9286
The client/IDE may expose these configuration values to the user via a config file or a GUI, in this case the `label` field may be used for a user readable description of the parameter.
9387

@@ -101,18 +95,18 @@ The response to the command is:
10195

10296
```JSON
10397
{
104-
"event": "configure",
105-
"message": "ok",
98+
"eventType": "configure",
99+
"message": "OK"
106100
}
107101
```
108102

109103
or if there is an error:
110104

111105
```JSON
112106
{
113-
"event": "configure",
114-
"error": true,
115-
"message": "invalid value for parameter baudrate: 123456"
107+
"eventType": "configure",
108+
"message": "invalid value for parameter speed: 123456",
109+
"error": true
116110
}
117111
```
118112

@@ -137,16 +131,16 @@ The answer to the `OPEN` command is:
137131

138132
```JSON
139133
{
140-
"event": "open",
141-
"message": "ok"
134+
"eventType": "open",
135+
"message": "OK"
142136
}
143137
```
144138

145139
If the monitor tool cannot communicate with the board, or if the tool can not connect back to the TCP port, or if any other error condition happens:
146140

147141
```JSON
148142
{
149-
"event": "open",
143+
"eventType": "open",
150144
"error": true,
151145
"message": "unknown port /dev/ttyACM23"
152146
}
@@ -158,7 +152,7 @@ Once the port is opened, it may be unexpectedly closed at any time due to hardwa
158152

159153
```JSON
160154
{
161-
"event": "port_closed",
155+
"eventType": "port_closed",
162156
"message": "serial port disappeared!"
163157
}
164158
```
@@ -167,8 +161,9 @@ or
167161

168162
```JSON
169163
{
170-
"event": "port_closed",
171-
"message": "lost TCP/IP connection with the client!"
164+
"eventType": "port_closed",
165+
"message": "lost TCP/IP connection with the client!",
166+
"error": true
172167
}
173168
```
174169

@@ -178,7 +173,7 @@ The `CLOSE` command will close the currently opened port and close the TCP/IP co
178173

179174
```JSON
180175
{
181-
"event": "close",
176+
"eventType": "close",
182177
"message": "ok"
183178
}
184179
```
@@ -187,9 +182,9 @@ or in case of error
187182

188183
```JSON
189184
{
190-
"event": "close",
191-
"error": true,
192-
"message": "port already closed"
185+
"eventType": "close",
186+
"message": "port already closed",
187+
"error": true
193188
}
194189
```
195190

@@ -213,11 +208,11 @@ If the client sends an invalid or malformed command, the monitor should answer w
213208
```JSON
214209
{
215210
"eventType": "command_error",
216-
"error": true,
217-
"message": "Unknown command XXXX"
211+
"message": "Command XXXX not supported",
212+
"error": true
218213
}
219214
```
220-
fis
215+
221216
### Example of usage
222217

223218
A possible transcript of the monitor usage:
@@ -307,6 +302,10 @@ CLOSE
307302
"message": "OK"
308303
}
309304
QUIT
305+
{
306+
"eventType": "quit",
307+
"message": "OK"
308+
}
310309
$
311310
```
312311

0 commit comments

Comments
 (0)