Skip to content

Commit b8e37b1

Browse files
committed
fix etx name
1 parent 229c775 commit b8e37b1

File tree

1 file changed

+36
-31
lines changed

1 file changed

+36
-31
lines changed

README.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ IoT Protocol is a protocol over TCP based on HTTP and MQTT for lightweight data
77

88
2. MQTT (*mqtt://*) is a publish-subscribe messaging protocol, use lightweight data traffic. Its minimum request size is 2 bytes. But it is not stateless and does not provide a request/response pattern, so it isn't restful. MQTT is designed to be a lightweight protocol that minimizes network overhead, which can make it more challenging to handle large or complex data payloads.
99

10-
The **IOT PROTOCOL** (*iot://*) is base on HTTP and MQTT protocols. Is a request-response model adapted for IoT context designed for low-bandwidth, low-power devices. Its minimum request size is 2 bytes without requiring the HOST param for all requests. Supports Full Duplex and can be used for real-time communication up to 255 bytes, middleweight request up to (2^16 -1) bytes (~65Kb) and streaming up to (2^32 -1) bytes (~4.29Gb). Can use TLS/SSL encryption to secure their communications.
10+
The **IOT PROTOCOL** (*iot://*) is based on HTTP and MQTT protocols over TCP/IP. Is a request-response model adapted for IoT context designed for low-bandwidth, low-power devices. Its minimum request size is 2 bytes without requiring the HOST param for all requests. Supports Full Duplex and can be used for real-time communication up to 255 bytes, middleweight request up to (2^16 -1) bytes (~65Kb) and streaming up to (2^32 -1) bytes (~4.29Gb). Can use TLS/SSL encryption to secure their communications.
1111

1212

13-
IOT PROTOCOL uses middlewares and router's filtering features based on [express nodejs module](https://expressjs.com/) at its Layer Application. Yes, you can use `.use(middleware)`, `.use('/path/to/your/resource', router)`, `response.send(data)` methods to handle the requests.
13+
IOT PROTOCOL uses middlewares and router's filtering features based on [express nodejs module](https://expressjs.com/) under its Layer Application. Yes, you can use `.use(middleware)`, `.use('/path/to/your/resource', router)`, `response.send(data)` methods to handle the requests.
1414

1515

1616
## Features
@@ -28,24 +28,24 @@ IOT PROTOCOL uses middlewares and router's filtering features based on [express
2828
```
2929
<MSCB + LSCB>
3030
[ID]
31-
[PATH + ETX]
32-
[HEADER + ETX]
31+
[PATH + IOT_ETX]
32+
[HEADER + IOT_ETX]
3333
[BODY_LENGTH + BODY]
3434
```
3535

3636
> `<...>` REQUIRED
3737
3838
> `[...]` OPTIONAL
3939
40-
> `[PATH + ETX] + [HEADER + ETX]` **MUST NOT BE MORE THAN 1016 Bytes**
40+
> `[PATH + IOT_ETX] + [HEADER + IOT_ETX]` **MUST NOT BE MORE THAN 1016 Bytes**
4141
>
4242
> + 1024 Bytes : IOT_PROTOCOL_BUFFER_SIZE
4343
> - 1 Byte : MSCB_SIZE
4444
> - 1 Byte : LSCB_SIZE
4545
> - 2 Bytes : ID_SIZE
4646
> - 4 Bytes : BODY_LENGTH_MAXIMUM_SIZE (Streaming)
4747
> ----------------
48-
> + 1016 Bytes : [PATH + ETX]_SIZE + [HEADER + ETX]_SIZE
48+
> + 1016 Bytes : [PATH + IOT_ETX]_SIZE + [HEADER + IOT_ETX]_SIZE
4949
>
5050
> |--------------------------------IOT_PROTOCOL_BUFFER_SIZE(1024)-----------------------------|
5151
>
@@ -63,6 +63,33 @@ IOT PROTOCOL uses middlewares and router's filtering features based on [express
6363
>
6464
>
6565
66+
---
67+
68+
### IOT_ETX
69+
70+
**IOT_ETX** byte serves to determine end of text
71+
72+
* Type: `char` | `byte` | `uint8_t`
73+
* Size: `1 byte`
74+
* Constant:
75+
* char: `ETX` [Unicode - *End Of Text*](https://www.compart.com/en/unicode/U+0003)
76+
* hex: `0x3`
77+
* decimal: `3`
78+
* binary: `0b11`
79+
80+
---
81+
### IOT_RS
82+
83+
**IOT_RS** byte serves as record or key value pair separator
84+
85+
* Type: `char` | `byte` | `uint8_t`
86+
* Size: `1 byte`
87+
* Constant:
88+
* char: `RS` [Unicode - *Information Separator Two - RecordSeparator RS*](https://www.compart.com/en/unicode/U+001E)
89+
* hex: `0x1E`
90+
* decimal: `30`
91+
* binary: `0b011110`
92+
6693
---
6794
### [0] **MSCB**: MSB_CONTROL_BYTE
6895

@@ -108,20 +135,6 @@ Methods Types
108135
| *Streaming* | Streaming data | 1 | 0/1 | `0b000100` | 0/1 | 0/1 | *up to (2^32 -1) bytes* | 6 bytes |
109136

110137

111-
---
112-
113-
### ETX
114-
115-
**ETX** byte serves to determine end of text
116-
117-
* Type: `char` | `byte` | `uint8_t`
118-
* Size: `1 byte`
119-
* Constant:
120-
* char: `ETX` [Unicode - *End Of Text*](https://www.compart.com/en/unicode/U+0003)
121-
* hex: `0x3`
122-
* decimal: `3`
123-
* binary: `0b11`
124-
125138
---
126139

127140
### [2] **ID**:
@@ -141,7 +154,7 @@ Unsigned random number with up to 2^16 that identifies the request. **SINGLE**
141154
The path component contains data, usually organized in hierarchical
142155
form, that, serves to identify a resource [URI > 3.3 Path](https://www.rfc-editor.org/info/rfc3986).
143156

144-
Format: `PATH + ETX`. **SINGLE**
157+
Format: `PATH + IOT_ETX`. **SINGLE**
145158

146159
#### **PATH**
147160

@@ -154,24 +167,16 @@ Format: `PATH + ETX`. **SINGLE**
154167

155168
Headers are be Key Value Pair that serves to set an attribute value for the request. Case sensitive.
156169

157-
Format: `HEADER + EXT`. **MULTIPLE**
170+
Format: `HEADER + IOT_ETX`. **MULTIPLE**
158171

159172
#### **HEADER**
160173

161174
* Type: `string`
162-
* Format: `KEY + KEY_VALUE_SEPARATOR + VALUE`
175+
* Format: `KEY + IOT_RS + VALUE`
163176
* *KEY*:
164177
* Type: `string`
165178
* *VALUE*:
166179
* Type: `string`
167-
* *KEY_VALUE_SEPARATOR*:
168-
* Type: `char` | `byte` | `uint8_t`
169-
* Size: `1 byte`
170-
* Constant:
171-
* char: `RS` [Unicode - *Information Separator Two - RecordSeparator RS*](https://www.compart.com/en/unicode/U+001E)
172-
* hex: `0x1E`
173-
* decimal: `30`
174-
* binary: `0b011110`
175180
* Example:
176181
* Single header: `["foo", 0x1E, "bar", 0x3]`
177182
* Multiple headers: `["foo", 0x1E, "bar", 0x3, "lorem", 0x1E, "ipsum", 0x3]`

0 commit comments

Comments
 (0)