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

Commit 6530949

Browse files
committed
Merge branch 'Serial' of https://github.com/ed7coyne/firebase-arduino into Serial
2 parents d9bdee6 + e8c9623 commit 6530949

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

serial_protocol.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ In the following examples we use $ to represent variables. For example $Host rep
99
All responses will be prefixed with one of the following bytes signifying the response type.
1010
```
1111
+ If response is ok and a raw string value.
12-
* If response is ok and a raw string value prefixed by count of bytes in response then new line.
12+
$ If response is ok, raw string value will be json formatted and prefixed by the byte count and a new line.
1313
: If response is ok and a number, this could be float or int.
1414
? If response is ok and a boolean value.
15-
$ If response is ok and json formatted and prefixed by count of bytes in response then new line.
1615
- If response is an error
1716
```
1817
##NETWORK
@@ -54,14 +53,13 @@ Fetches the value at $Path and returns it on the serial line. If $PATH points to
5453
>>GET /user/aturing/first
5554
<<+Alan
5655
>>GET /user/aturing
57-
<<&39
56+
<<$39
5857
<<{ "first" : "Alan", "last" : "Turing" }
5958

6059
##GET{+,*,#,.,?,$}
6160
Same as GET but will either return the value in the format specified (by the format byte) or return an error.
6261
###Usage
6362
GET+ $PATH
64-
GET* $PATH
6563
GET: $PATH
6664
GET? $PATH
6765
GET$ $PATH
@@ -121,7 +119,7 @@ Adds a value to the list located at the path provided and returns the key at whi
121119
<<+-K94eLnB0rAAvfkh_WC2
122120

123121
##PUSH$
124-
Similar to PUSH but used to write multiline strings or raw binary data. Data format is similar to the batch string ($) return type, we specify the $DATA_BYTE_COUNT on the same line as SET$ then a newline and all data.
122+
Similar to PUSH but used to write multiline strings or raw binary data. Data format is similar to the batch string ($) return type, we specify the $DATA_BYTE_COUNT on the same line as SET$ then a newline and all data. However you are not required to json escape all of your data, that will be handled for you.
125123

126124
Receiver will wait until a timeout for client to send $DATA_BYTE_COUNT worth of data before becoming responsive again.
127125
###Usage
@@ -153,8 +151,7 @@ The event stream will continue until you send CANCEL_STREAM.
153151
<<+PUT /last_login
154152
<<:1455052043
155153
<<+PUT /address
156-
<<*24
157-
<<78 High Street,
158-
<<Hampton
154+
<<$24
155+
<<"78 High Street,\r\nHampton"
159156
>>CANCEL_STREAM
160157
<<+OK

0 commit comments

Comments
 (0)