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

Commit c39e371

Browse files
committed
Update serial_protocol.md
1 parent 76c746c commit c39e371

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

serial_protocol.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Protocol:
22
During the first use, or when the chiplet changes environments a “NETWORK” call is expected to initialize the wifi parameters.
33

4-
Every time a serial connection is established we will expect a “INIT” call after which any subsequent calls can be made, until the connection is closed.
4+
Every time a serial connection is established we will expect a “BEGIN” call after which any subsequent calls can be made, until the connection is closed.
55

66
In the following examples we use $ to represent variables. For example $Host represents your firebase host.
77

@@ -10,8 +10,7 @@ All responses will be prefixed with one of the following bytes signifying the re
1010
```
1111
+ If response is ok and a raw string value.
1212
* If response is ok and a raw string value prefixed by count of bytes in response then new line.
13-
# If response is ok and a integer value.
14-
. If response is ok and a float value.
13+
: If response is ok and a number, this could be float or int.
1514
? If response is ok and a boolean value.
1615
$ If response is ok and json formatted and prefixed by count of bytes in response then new line.
1716
- If response is an error
@@ -32,17 +31,17 @@ Only needs to be called when the chiplet is in a new environment and needs to co
3231
>> NETWORK home-guest
3332
<< -UNABLE_TO_CONNECT
3433

35-
##INIT
34+
##BEGIN
3635
Must be called after creating a Serial connection, it can take either just a host for accessing public variables or you may also provide a secret for accessing protected variables in the database.
3736
###Usage
38-
INIT $Host
39-
INIT $Host $Secret
37+
BEGIN $Host
38+
BEGIN $Host $Secret
4039
###Response
4140
OK - Accepted initialization parameters
4241
###Examples
43-
>> INIT https://samplechat.firebaseio-demo.com
42+
>> BEGIN https://samplechat.firebaseio-demo.com
4443
<< +OK
45-
>> INIT https://samplechat.firebaseio-demo.com nnz...sdf
44+
>> BEGIN https://samplechat.firebaseio-demo.com nnz...sdf
4645
<< +OK
4746
##GET
4847
Fetches the value at $Path and returns it on the serial line. If $PATH points to a leaf node you will get the raw value back, if it points to an internal node you will get a JSON string with all children.
@@ -63,8 +62,7 @@ Same as GET but will either return the value in the format specified (by the for
6362
###Usage
6463
GET+ $PATH
6564
GET* $PATH
66-
GET# $PATH
67-
GET. $PATH
65+
GET: $PATH
6866
GET? $PATH
6967
GET$ $PATH
7068
###Response
@@ -153,7 +151,7 @@ The event stream will continue until you send CANCEL_STREAM.
153151
###Examples
154152
>>STREAM /user/aturning
155153
<<+PUT /last_login
156-
<<#1455052043
154+
<<:1455052043
157155
<<+PUT /address
158156
<<*24
159157
<<78 High Street,

0 commit comments

Comments
 (0)