Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit a9befd0

Browse files
authored
Update serial_protocol.md
Addition doc changes
1 parent f42d1cf commit a9befd0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

serial_protocol.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,14 @@ time_to_live=500
278278
<< +ERROR_INVALID_ARGUMENT // some_random_thing is not a valid argument.
279279

280280
## NOTIFICATION
281-
Notification to display to the user, is made up of a title and a body. The title is specified on the first line and the first line ends with a count of bytes in the body. We will then read the next %Body_Byte_Count% bytes (after the line break) and interpret them as the body. If there is no body specify 0 for the byte count.
281+
Notification to display to the user, is made up of a title and a body. The title is specified on the first line and the first line ends with a count of bytes in the body. We will then read the next %Body_Byte_Count% bytes (after the line break) and interpret them as the body. If there is no body specify 0 for the byte count. The count must be the last thing on the line, it cannot end in whitespace.
282282
##Usage
283283
NOTIFICATION %Title% %Body_Byte_Count%
284284
%Body%
285285
###Response
286286
+OK - Ready to specify rest of message.
287287
-ERROR_INCORRECT_FORMAT - The message format was incorrect.
288+
-ERROR_NOT_ENOUGH_DATA_FOR_BODY - We did not receive the specified amount of data for the body.
288289
###Examples
289290
>> NOTIFICATION This is a test. 0
290291
<< +OK
@@ -293,15 +294,20 @@ Notification to display to the user, is made up of a title and a body. The title
293294
>> NOTIFICATION This is a test with a body. 12
294295
>> Hello World!
295296
<< +OK
297+
>> NOTIFICATION This is a test with a body. 12
298+
>> Hello Worl
299+
<< -ERROR_NOT_ENOUGH_DATA_FOR_BODY
296300

297301
## ADD_DATA
298-
Data to deliver to client application. This is comprised of Key->Value pairs. The Key is specified on the first line and the first line ends with a count of bytes in the value. We will then read the next %Value_Byte_Count% bytes (after the line break) and interpret them as the value. If there is no value specify 0 forthe byte count.
302+
Data to deliver to client application. This is comprised of Key->Value pairs. The Key is specified on the first line and the first line ends with a count of bytes in the value. We will then read the next %Value_Byte_Count% bytes (after the line break) and interpret them as the value. If there is no value specify 0 forthe byte count. The count must be the last thing on the line, it cannot end in whitespace.
303+
299304
##Usage
300305
ADD_DATA %KEY% %VALUE_BYTE_COUNT%
301306
%VALUE%
302307
###Response
303308
+OK - Ready to specify rest of message.
304309
-ERROR_INCORRECT_FORMAT - The message format was incorrect.
310+
-ERROR_NOT_ENOUGH_DATA_FOR_BODY - We did not receive the specified amount of data for the body.
305311
###Examples
306312
>> ADD_DATA Temperature_Ready 0
307313
<< +OK
@@ -310,6 +316,9 @@ Data to deliver to client application. This is comprised of Key->Value pairs. Th
310316
>> ADD_DATA Temperature 3
311317
>> 104
312318
<< +OK
319+
>> ADD_DATA Temperature 3
320+
>> 10
321+
<< -ERROR_NOT_ENOUGH_DATA_FOR_BODY
313322

314323
## SEND_MSG
315324
Send the message we have been preparing.

0 commit comments

Comments
 (0)