You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Device API currently in development and is not yet accessible on production devices.
11
-
12
-
These pages can be seen as a view of what is to come later this year.
13
-
:::
14
-
15
9
# Device API
16
10
17
11
The device API makes use of the Lightbug communication protocol, also known as the V3 protocol, which is a byte oriented protocol used for device communication.
18
12
19
-
The protocol builds on top of existing Lightbug Protocols, and is designed to be:
20
-
- Efficient to read, build
21
-
- Lightweight to store and transmit
13
+
The protocol builds on top of existing Lightbug protocols, and is designed to be:
22
14
- Easy to use and understand
23
-
- Usable in a variety of settings, without complex dependencies
15
+
- Efficient to read and build
16
+
- Lightweight to store and transmit
17
+
- Usable in a variety of settings, without complex or bloated dependencies
24
18
25
19
## API Access
26
20
@@ -30,7 +24,7 @@ Typically, it can be accessed via UART, I2C, or a UDP network connection.
30
24
31
25
For access details, please [contact our support team](https://lightbug.io/contact/).
32
26
33
-
Or you can get started with Toit quickly using the Lightbug provided SDK.
27
+
Or you can [get started with Toit quickly](/devices/api/sdks/toit/) using the Lightbug provided SDK.
The Device API currently in development and is not yet accessible on production devices.
8
-
9
-
These pages can be seen as a view of what is to come later this year.
10
-
:::
11
-
12
6
# Messages
13
7
14
-
Messages often make use of a few common header fields, and you can expect to see these in most messages types:
8
+
Messages often make use of a few common [header fields](/devices/api/headers), and you can expect to see these in most messages types:
15
9
16
10
## Requests
17
11
18
-
Requests may or may not require a method.
12
+
Requests may or may not require a [MH 5: Method](./../headers#_5-method) header field, such as `GET`, `DO`, `SET` or `SUBSCRIBE`.
13
+
14
+
This is decided by the individual message type, and if required, should be included in the header.
15
+
19
16
20
-
This is decided by the individual message type, and if required is set in the header field [5: Method](./../headers#_5-method).
21
17
22
18
## Responses
23
19
24
-
You should receive a response to every valid and expected message.
20
+
You should receive a response to every valid and expected message when the recipient is able to process the request.
25
21
26
-
When a message ID is provided in the request, any direct response should include the initiating message ID in the header [3: Response Message ID](./../headers#_3-response-message-id).
22
+
When a message ID is provided in the request, any direct response should include the initiating message ID in the header [MH 3: Response Message ID](./../headers#_3-response-message-id).
27
23
28
-
Responses can come in the form of a basic [5: ACK](./5-ack) or as the same message type as the request.
24
+
Responses can come in the form of a basic [MT 5: ACK](./5-ack) or as the same message type as the request.
29
25
30
-
Responses should contain a [4: Response Status](./../headers#_4-response-status) in the header, where 0 is OK, and anything higher indicates a warning or error.
26
+
Responses should contain a [MH 4: Response Status](./../headers#_4-response-status) in the header, where 0 and below are various OK responses, and anything higher than 0 indicates a warning or error.
31
27
32
28
## Types
33
29
34
30
Per the specification, message types are represented by a single `uint16` value.
35
31
36
-
Values of `60,000` to `61,000` are currently reserved for custom use. Feel free to implement your own messages within this range.
32
+
Values of `60,000` to `61,000` are currently reserved for custom use.
33
+
34
+
Feel free to implement your own messages within this range.
Copy file name to clipboardExpand all lines: devices/api/sdks/toit/index.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,3 +7,5 @@
7
7
Lightbug provides a [Toit package](https://pkg.toit.io/package/github.com%2Flightbug-io%2Ftoit-lightbug) that includes a set of bindings to Lightbug devices and the [Lightbug device API](./../../).
8
8
9
9
Together, these tools allow you to quickly develop and deploy applications on Lightbug devices using Toit.
10
+
11
+
Once developed, Toit firmware can be build without the jaguar development tooling enabled, and sent to Lightbug devices over the air for update.
0 commit comments