
13
8. COMUNICATION PROTOCOL
The commands used to interact with the device are based on datagrams sent by the host device via the
serial port profile
over Bluetooth. They are in general constituted of an
opcode
(1 byte) followed by
variable number of
parameters
(n bytes) and 1 byte
checksum
, calculated as sum modulo-256 of the
previous n+1 bytes.
Byte0
Byte1 .. byte N
Byte (N + 1)
OPCODE
PARAMETERS
CHECKSUM
If the command is properly recognized by EXLs3 it responds with an
ACK
byte (
0x01
).
In case of error it respond with
NACK
byte (
0x00
)
8.1. Basic Commands
START_STREAM (0x3D)
Use this command to start real-time streaming of sampled and processed data to the controlling PC.
Byte 0
Byte1
0x3D
0x3D
The sensor starts sending to the host the data sampled in real-time with the format shown in the
paragraph
Packet Data Types.
STOP_STREAM
Use this command to stop real-time streaming.
Byte 0
Byte1
0x3A
0x3A
The sensor responds with an acknowledge
Byte0
0x01
8.2. Packet Data Types
When in streaming mode, the EXLs3 unit can send different type of packets, depending on the value of
the
PACKET_TYPE
parameter (see in the registers description paragraph).
AGMOB_Type (Accelerometer, Gyroscope, Magnetometer, Orientation, vBattery)
This is the most generic packet format, which includes all possible information at the same time.