The commands in this section enable transparent communication with Bluetooth sensors through the device.
The data exchange diagram is shown below:
sequenceDiagram
Client->>Device: *!BLE CNCT,11:22:33:44:55:66
Note right of Client: Sensor connection command
Device->>Client: *@BLE CNCT,OK
Note right of Client: Device accepted the command for execution
Device-->>BLE sensor: Connecting to sensor 11:22:33:44:55:66
Device->>Client: *&BLE CNCT,11:22:33:44:55:66
Note right of Client: Sensor connection is established and data exchange can now begin
Client->>+Device: *!BLE DATA,STR,"GL,LL:1:720,PP,PW:1:1111"0D
Note right of Client: Sending text data with HEX byte 0x0D at the end of the message
Device->>+BLE sensor: "GL,LL:1:720,PP,PW:1:1111"0D
Device->>Client: *@BLE DATA,OK
Note right of Client: Confirmation of transmission from device to sensor
BLE sensor->>-Device: "TR:1:720,SR:1:720"
Device->>-Client: *&BLE DATA,STR,TR:1:720,SR:1:720
Note right of Client: Receiving data from sensor
Client->>Device: *!BLE CNCT,0
Note right of Client: Sensor disconnection command
Device--xBLE sensor: Disconnecting from sensor
Device->>Client: *@BLE CNCT,OK
Note right of Client: Disconnection confirmation
¶ BLE CNCT Command
Connecting to or disconnecting from the sensor
| Structure |
*!BLE CNCT,<mac> |
| Designation |
Description |
Format |
*!BLE |
Constant - 0x2A 0x21 0x42 0x4C 0x45 |
char[5] |
|
<mac>
|
xx:xx:xx:xx:xx:xx - sensor address, used to establish the connection
0 - Pass this value in the parameter to disconnect
|
char[]
|
Sent by the device immediately to confirm the command
| Structure |
*@BLE CNCT,<ans> |
| Designation |
Description |
Format |
*@BLE |
Constant - 0x2A 0x40 0x42 0x4C 0x45 |
char[5] |
|
<ans>
|
Command execution result:
OK – command accepted
ALREADY – a connection already exists
BUSY – Bluetooth is busy
FAIL – error in the <mac> format
|
char[]
|
Sent by the device asynchronously when an event occurs
| Structure |
*&BLE CNCT,<ans> |
| Designation |
Description |
Format |
*&BLE |
Constant - 0x2A 0x26 0x42 0x4C 0x45 |
char[5] |
|
<ans>
|
Command execution result:
xx:xx:xx:xx:xx:xx - sensor address, indicating a successful connection
0 - successful disconnection from the sensor or connection failed
|
|
¶ BLE DATA Command
Data transmission between the sensor and the device
| Structure |
*!BLE DATA,<fmt>,<msg> |
| Designation |
Description |
Format |
*!BLE |
Constant - 0x2A 0x21 0x42 0x4C 0x45 |
char[5] |
|
<fmt>
|
Data format for receiving the response in the asynchronous message:
HEX - Bytes in hexadecimal format
STR - Character string
|
char[3]
|
|
<msg>
|
Message to send to the sensor. Data is sent in mixed format:
"12345" - Plain text
3132333435 - Bytes in HEX
"123"3435 - Text with bytes in HEX appended
|
char[]
|
Sent by the device immediately to confirm the command
| Structure |
*@BLE DATA,<ans> |
| Designation |
Description |
Format |
*@BLE |
Constant - 0x2A 0x40 0x42 0x4C 0x45 |
char[5] |
|
<ans>
|
Command execution result:
OK – command accepted
NOT READY – connection not established
|
char[]
|
Sent by the device asynchronously when an event occurs
| Structure |
*&BLE DATA,<fmt>,<msg> |
| Designation |
Description |
Format |
*&BLE |
Constant - 0x2A 0x26 0x42 0x4C 0x45 |
char[5] |
|
<fmt>
|
Data format in the response:
HEX - Bytes in hexadecimal format
STR - Character string
|
char[3]
|
|
<msg>
|
Response from the sensor. Data is sent in only one of the following formats:
"12345" - Plain text
3132333435 - Bytes in HEX
|
char[]
|