API / streamZ/MSP 325N / Data Format Description
Protocol Data Format Description
Applies to
streamZ, MSP 325N
1. The general data format for sending/receiving is as follows
| Symbol | Size (Byte) | Definition | Example |
|---|---|---|---|
| ADDR | 1 | Address (default 0x00) | 0x00 |
| SN | 1 | Command sequence number (for transmission flow control, 0x00-0xFF) | 0x02 |
| CMD | 1 | Command type | 0x68 |
| DAT1 | 1 | Parameter type 1 | 0x01 |
| DAT2 | 1 | Parameter type 2 | 0x00 |
| DAT3 | 1 | Parameter type 3 | 0x00 |
| DAT4 | 1 | Parameter type 4 | 0x00 |
| CHKSUM | 1 | ADDR...DAT4 checksum | 0x6B |
CHKSUM = ADDR + SN + CMD + DAT1 + DAT2 + DAT3 + DAT4
Command assembly format for sending (19 characters): '<' + 'T' + 2-digit ADDR + 2-digit SN + 2-digit CMD + 2-digit DAT1 + 2-digit DAT2 + 2-digit DAT3 + 2-digit DAT4 + 2-digit CHKSUM + '>'
Command assembly format for receiving (19 characters): '<' + 'F' + 2-digit ADDR + 2-digit SN + 2-digit CMD + 2-digit DAT1 + 2-digit DAT2 + 2-digit DAT3 + 2-digit DAT4 + 2-digit CHKSUM + '>'
📢 Important
The following Device Connection statement is critical.
Device Connection
Wi-Fi Connection
The device uses UDP broadcast to send commands to IP address 255.255.255.255 on port 2000.
When searching for TAO 1MINI, the device sends a single response to the sender.
📢 Important
All API commands documented in this category MUST be sent to the IP address from which TAO 1MINI sent its initial response.
Bluetooth Connection
-
Connection roles: TAO 1MINI acts as the Bluetooth server, and the connecting device acts as the client.
-
UUID:
The UUID agreed upon for TAO 1MINI isfa87c0d0-afac-11ff-8a39-0800200c9a66`. -
Command transmission: Bluetooth uses the same command format as Wi-Fi.
Format description of send/receive commands with a data block (CMD = 0xE0 or 0xE1)
| Symbol | Size (Byte) | Definition | Example |
|---|---|---|---|
| ADDR | 1 | Address (default 0x00) | 0x00 |
| SN | 1 | Command sequence number (for transmission flow control, 0x00-0xFF) | 0x02 |
| CMD | 1 | 0xE0 (set parameters) / 0xE1 (read parameters) | 0xE1 |
| DAT1 | 1 | 0~255 Parameter type 1 | 0x01 |
| DAT2 | 1 | 0~255 Parameter type 2 | 0x00 |
| DAT3 | 1 | Data block length (LSB) | 0x.. |
| DAT4 | 1 | Data block length (MSB) | 0x.. |
| CHKSUM | 1 | ADDR...DAT4 checksum | 0x.. |
The last byte of the data block is the checksum, calculated as the sum of all bytes in the data block. The data block length (DAT3 and DAT4) includes the checksum.
All data blocks are represented in JSON format. The specific fields are described with each command.
📢 Notes: To specify the language, include the {"language":1} field:
1: Chinese0: English
Currently, only Chinese and English are supported.
Example of a command: JSON data block + CHKSUM
{"statusType":1,"statusValue":10,"language":1}b
2. Description of the general data block of received commands
| Parameter | Required | Type | Description |
|---|---|---|---|
| Code | * | int | 0 : Success |
| msg | * | string | Prompt message from the server, which can be displayed in a Toast |
| deviceUuid | * | string | Bound device; the uuid issued by the server to the device |
| data | * | any |
Response data block example
{"code":0,"msg":"success","deviceUuid":"x12345521xxxx","data":{}}
3. The following data is returned when an unsupported command is received or an error occurs
| Symbol | Size (Byte) | Definition | Remarks |
|---|---|---|---|
| CMD | 1 | CMD | --- |
| DAT1 | 1 | 0×FF | --- |
| DAT2 | 1 | 0×FF | --- |
| DAT3 | 1 | 0×FF | --- |
| DAT4 | 1 | 0×FF | --- |