0xDB Command in Serial Communication App Format Mode (Binary)
Setting functions using the 0xDB command in format mode (binary) without using Interactive Mode
When data formatted in a specific manner is input on the transmitting side, the receiving side outputs data formatted in the same manner.
Data represented in hexadecimal is output as raw binary.
Transmitting Side Input | Receiving Side Output | |
---|---|---|
Simple/Extended Format Data | → | Simple/Extended Format Data |
SET
pin to GND
at startup.EX1
pin to GND
at startup.There are two types of supported formats.
For example, 5 bytes of binary data 0x48 0x45 0x4C 0x4C 0x4F
can be transmitted using the simple format as follows.
Hereafter, the 0x
in binary data representation is omitted.
For example, 0x48 0x45 0x4C 0x4C 0x4F
is represented as 48 45 4C 4C 4F
.
[Transmitting Side]
A5 5A 80 07 00 01 48 45 4C 4C 4F 43 04 <- Input
A5 5A 80 04 DB A1 80 01 FB 04 <- Output
[Receiving Side]
A5 5A 80 07 78 01 48 45 4C 4C 4F 3B 04 <- Output
When sending data expressed in basic or extended format, handle it as raw binary data.
Header | Length | Payload | Checksum | Footer |
---|---|---|---|---|
A5 5A | Payload Length | Repeated 00 -FF | XOR of Payload | EOT |
A5 5A
0x8000
0x04
(can be omitted on input)For example, binary data 00 11 22 33 AA BB CC
is expressed as follows.
A5 5A 80 07 00 11 22 33 AA BB CC DD 04
Although debugging is troublesome, it offers high efficiency for communication between microcontrollers.
Format mode distinguishes between parent and child devices.
Parent and child devices must match Application ID and Frequency Channel.
Format mode allows identification of the source from received data.
Simple format uses Logical Device ID, and extended format uses Logical Device ID plus extended address.
0x8
added at the front.When using the simple format of format mode, follow the format below.
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , All Children 0x78 |
1 | uint8 | Command Number | Any value less than 0x80 |
2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) (recommended \(N\leqq80\)) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , Unset Child 0x78 |
1 | uint8 | Command Number | Value less than 0x80 specified by sender |
2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 4 | |
0 | uint8 | Source Logical Device ID | Only 0xDB : indicates itself |
1 | uint8 | Command Number | Only 0xA1 |
2 | uint8 | Response ID | Continuation number in the range 128 -255 (0x80 -0xFF ) |
3 | uint8 | Result | Success 1 , Failure 0 |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
Example of sending byte sequence 11 22 33 AA BB CC
from parent to all children.
[Transmitting Side: Parent]
A5 5A 80 08 78 01 11 22 33 AA BB CC A4 04 <- Input
A5 5A 80 04 DB A1 80 01 FB 04 <- Output
The last byte
0xA4
is the checksum: XOR from0x78
to0xCC
.
[Receiving Side: All Children]
A5 5A 80 08 00 01 11 22 33 AA BB CC DC 04 <- Output
The last byte
0xDC
is the checksum: XOR from0x00
to0xCC
.
When using the extended format of format mode, follow the format below.
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+\(M\)+3 | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , All Children 0x78 |
1 | uint8 | Command Number | Only 0xA0 |
2 | uint8 | Response ID | Any value |
3 | [uint8] | Options | Option list of length \(N\) (Details below) |
3+\(N\) | [uint8] | Arbitrary Data | Byte sequence of length \(M\) (recommended \(M\leqq80\)) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+\(M\)+7 | |
0 | uint8 | Extended Address Specifier | Only 0x80 |
1 | uint8 | Command Number | Only 0xA0 |
2 | uint8 | Response ID | Any value |
3 | uint32 | Destination Extended Address | Serial ID with 0x8 added at the front |
7 | [uint8] | Options | Option list of length \(N\) (Details below) |
7+\(N\) | [uint8] | Arbitrary Data | Byte sequence of length \(M\) (recommended \(M\leqq80\)) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
In extended format, detailed settings can be specified by providing an option list.
The option list consists of repeated option IDs and arguments. It ends with 0xFF
.
0xFF
.ID | Argument | Default | Description |
---|---|---|---|
0x01 | None | Disabled | Enable MAC ACK |
0x02 | uint8 | 0x00 | Enable Application Retransmission |
0x03 | uint16 | 0x0000 | Minimum Initial Transmission Delay |
0x04 | uint16 | 0x0000 | Maximum Initial Transmission Delay |
0x05 | uint16 | 10 | Application Retransmission Interval |
0x06 | None | Disabled | Allow Parallel Requests |
0x07 | None | Disabled | Disable Response Messages |
0x08 | None | Disabled | Sleep After Transmission |
0x01
: Enable MAC ACKEnables MAC layer ACK (acknowledgment).
Not suitable for frequent data transmissions but can improve reliability.
0x78
).0x02
: Enable Application RetransmissionWhen using MAC ACK, specify 0x00
-0x0F
. Retransmits 0-16 times until successful.
When not using MAC ACK, specify 0x81
-0x8F
. Always retransmits 1-16 times.
Response messages are output after all retransmissions are complete.
0x03
: Minimum Initial Transmission DelaySpecifies the minimum delay before the first transmission in milliseconds.
0x04
: Maximum Initial Transmission DelaySpecifies the maximum delay before the first transmission in milliseconds.
0x05
: Application Retransmission IntervalSpecifies the interval between application retransmissions in milliseconds.
0x06
: Allow Parallel RequestsAllows parallel requests.
When allowed, the next request can be accepted without blocking until the previous request completes.
For example, if three requests each with 0.5 seconds delay are input consecutively, normally they are processed sequentially at 0.5s, 1.0s, and 1.5s. With parallel requests allowed, they are processed in any order after 0.5s. Note that this cannot be used when packet segmentation is required.
0x07
: Disable Response MessagesDisables response messages output when data is input on the transmitting side.
0x08
: Sleep After TransmissionImmediately puts the device to sleep after transmission.
RX
detects rising edge to wake from sleep. Input any 1 byte of data.
After waking, UART initialization completes and input is accepted.
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(M\)+14 | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , Unset Child 0x78 |
1 | uint8 | Command Number | Only 0xA0 |
2 | uint8 | Response ID | Value specified by sender |
3 | uint32 | Source Extended Address | Serial ID with 0x8 added at the front |
7 | uint32 | Destination Extended Address | 0xFFFFFFFF when using Logical Device ID |
11 | uint8 | LQI | Radio signal quality at reception |
12 | uint16 | Length of Following Bytes | Byte count \(M\) |
14 | [uint8] | Arbitrary Data | Byte sequence of length \(M\) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 4 | |
0 | uint8 | Source Logical Device ID | Only 0xDB : indicates itself |
1 | uint8 | Command Number | Only 0xA1 |
2 | uint8 | Response ID | Value specified on input |
3 | uint8 | Result | Success 1 , Failure 0 |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
Example of sending byte sequence 11 22 33 AA BB CC
from parent to child.
Example of sending from parent to child with Logical Device ID 0x01
.
0x01
[Transmitting Side: Parent]
A5 5A 80 0A 01 A0 01 FF 11 22 33 AA BB CC 82 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0xC1
is checksum: XOR from0x42
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 FF FF FF FF FF 00 06 11 22 33 AA BB CC 2D 04 <- Output
The last byte
0x2D
is checksum: XOR from0x00
to0xCC
.
Example of sending from parent to child with Extended Address 0x820163B2
(Serial ID 0x20163B2
).
0x01
[Transmitting Side: Parent]
A5 5A 80 0E 80 A0 01 82 01 63 B2 FF 11 22 33 AA BB CC 51 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0x51
is checksum: XOR from0x80
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 82 01 63 B2 FF 00 06 11 22 33 AA BB CC 7F 04 <- Output
The last byte
0x7F
is checksum: XOR from0x00
to0xCC
.
Example of sending from parent to child with Logical Device ID 0x01
using MAC ACK.
0x01
0x01
: Enable MAC ACK specified[Transmitting Side: Parent]
A5 5A 80 0B 01 A0 01 01 FF 11 22 33 AA BB CC 83 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0x83
is checksum: XOR from0x01
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 00 00 01 01 FF 00 06 11 22 33 AA BB CC 2D 04 <- Output
The last byte
0x2D
is checksum: XOR from0x00
to0xCC
.
Example of sending from parent to child with Logical Device ID 0x01
with 768ms delay.
0x01
0x03
: Minimum Initial Transmission Delay specified[Transmitting Side: Parent]
A5 5A 80 0D 01 A0 01 03 03 00 FF 11 22 33 AA BB CC 82 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0x82
is checksum: XOR from0x01
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 FF FF FF FF FF 00 06 11 22 33 AA BB CC 2D 04 <- Output
The last byte
0x2D
is checksum: XOR from0x00
to0xCC
.
0xDB
CommandInstead of setting interactive mode, you can operate and configure the module by inputting the 0xDB
command from UART.
Setting functions using the 0xDB command in format mode (binary) without using Interactive Mode