UMAX141100 Version 1.0.6.
Preliminary Documentation – May be subject to change
23 - 36
5.
SPP
Communications
The communications between a smart device such as a phone or a tablet and the CAN2BT device
is based on Bluetooth Serial Port Profile (SPP). By default, the CAN2BT firmware declares itself as
a SPP device (UUID: 00001101-0000-1000-8000-00805F9B34FB)
The messages are transferred in binary format, least significant byte first. The list of supported
proprietary messages is shown below.
5.1.
Overall
message
format
There is an ack response sent by the CAN2BT device after receiving the configuration messages.
The overall message format:
Byte 0
Byte 1
Byte 2
Byte 3
…
Byte n+2
Byte n+3
Byte n+4
Byte n+5
Byte n+6
<msg type>
<length>
<payload 0>
<payload 1>
…
<payload length-1>
<crc32>
<crc32> <crc32> <crc32>
Table 4 – Overall message format
in which the
<msg type>
is as listed in below.
<length>
is full message length without the four CRC32
bytes. CRC32 is selected because the support for it is readily available in Android.
All data that is expressed as Byte 0, Byte 1, … in the message descriptions below, is expected to be
either 16 bits or 32 bits wide data, broken down to bytes (8 bits) least significant byte first. The only
exception is the PIN code data, that is expected to be formatted one digit per byte. The PIN codes
are hard formatted to have 6 digits.
Available CAN baudrate options include: 0 – 50k, 1 – 100k, 2 – 125k, 3 – 250k, 4 – 500k, 5 – 1M
5.2.
Message
types
Message
type
Direction
<msg
type>
byte
CAN
data
with
StdID
SD
*
‐
>
CAN2BT
0x12
CAN
data
with
ExtID
SD
*
‐
>
CAN2BT
0x13
CAN
data
with
StdID
CAN2BT
‐
>
SD
*
0x21
CAN
data
with
ExtID
CAN2BT
‐
>
SD
*
0x31
MAP
write
SD
*
‐
>
CAN2BT
0x34
MAP
write
response
CAN2BT
‐
>
SD
*
0x43
MAP
read
SD
*
‐
>
CAN2BT
0x45
MAP
read
response
CAN2BT
‐
>
SD
*
0x54
Download
Flash
contents
SD
*
‐
>
CAN2BT
0x56
Download
Flash
contents
response
CAN2BT
‐
>
SD
*
0x65
Download
Flash
contents
ACK
SD
*
‐
>
CAN2BT
0x57
Download
Flash
contents
ACK
response
CAN2BT
‐
>
SD
*
0x75
Change
configuration
SD
*
‐
>
CAN2BT
0x67
Change
configuration
response
CAN2BT
‐
>
SD
*
0x76
LED
state
SD
*
‐
>
CAN2BT
0x78
LED
state
response
CAN2BT
‐
>
SD
*
0x87
*
SD
=
Smart
Device,
a
phone
or
a
tablet
Table 5 – Proprietary SPP message types