Driver Aid Serial Protocol
Driver Aid Serial Protocol
version 1.0
Tensortec
May 14th 2018
1 / 21
Tensortec(Shenzhen China)
2 / 21
Catalog
1. Product Introduction ................................................................................................................. 3
1.1 Software Connection ..................................................................................................... 3
Tensortec(Shenzhen China)
3 / 21
1. Product Introduction
Tensortec(Shenzhen China)
4 / 21
Electrical Characteristics
Ma
Parameter/Condition Min Typical x Unit
Supply voltage 9 12 28 V
Operating current/ VDDIN=12V 300.0 380.0 450.0 mA
Receiver inputs/232_RXD
Input Voltage Range -25 +25 V
Input Threshold Low 0.6 1.1 V
Input Threshold High 2.0 2.4 V
Transmitter Outputs/232_TXD
Tensortec(Shenzhen China)
5 / 21
2. Protocol Introduction
Baud rate:115200
Data bit:8
Verify bit: none
Stop bit:1
The command communication message format that Driveraid supports is designed as follows:
0x7E See See See remark 0x65 See See remark 0x7E
Remarks:
Tensortec(Shenzhen China)
6 / 21
(1) Flag: represented by bit 0x7E. If there is 0x7E in verify code, message head or
Escaping process:
Escaping.
Message Receiving: Escaping restore ——> Check if verify code is right ——>
Parsing.
After processing 0x7E 0x30 0x7D 0x02 0x08 0x7D 0x01 0x55 0x7E
(2) Verify code: accumulate the bytes from “Manufacturer ID” to “Data”, and the
verify code = sum & 0x000000FF (get the low 8 bits of sum as verify code).
Tensortec(Shenzhen China)
7 / 21
Function code:0x35
Function: the code is for terminal to require Driveraid to set system parameter, as well as for
Driveraid to send back reaction.
Command: Format definite as following:
Tensortec(Shenzhen China)
8 / 21
Tensortec(Shenzhen China)
9 / 21
Tensortec(Shenzhen China)
10 / 21
Function Code:0x31
Function: Terminal send real time data to Driveraid, while Driveraid no need sends back
reaction.
Command: (format definition as following)
1. Real time data command format
Driveraid ID Function code Data area
0x64 0x31 See real time data content
format
Figue 2. Real time data content format
Start byte field Data type Description and introduction
0 Vehicle speed BYTE Unit km/h
1 Reserved BYTE
2 Mileage DWORD Unit 0.1km, Scope 0~99999999
6 reserved BYTE[2]
8 Elevation WORD Altitude, unit in meter
10 Latitude DWORD Multiply the latitude value in degrees by
10 to the power of 6 to the nearest
Tensortec(Shenzhen China)
11 / 21
millionth of a degree
14 Longitude DWORD Multiply the longitude value in degrees by
10 to the power of 6 to the nearest
millionth of a degree
18 Date and time BCD[6] YY-MM-DD-hh-mm-ss (FGMT+8 time)
24 Vehicle state WORD Indicates other vehicles state by bit.
Bit0 ACC state, 0:off,1:on
Bit1 turn left,0:off,1:on
Bit2 turn right, 0:of,1:on
Bit3 Wiper state, 0:off,1:on
Bit4 Brake State,0:Unbraked,1:Braked
Bit5 SD Card State , 0:not insert ,
1:inserted
Bit6~Bit9 Customize
Bit10 Location state,0: not locate, 1:
located
Bit11~bit15 Customize
Tensortec(Shenzhen China)
12 / 21
Tensortec(Shenzhen China)
13 / 21
information list
Figure 5. Media information list format
Start byte Field Data type Description and introduction
0 Multimedia type BYTE 0x00: picture
0x01: audio
0x02:video
1 Multimedia ID DWORD >0
Function code:0x50
Function: the code is for terminal require multimedia data from Driveraid, as well as for
Driveraid send back the command react to terminal.
Command: format definite as following
Tensortec(Shenzhen China)
14 / 21
Tensortec(Shenzhen China)
15 / 21
For Driveraid to receive GPS protocol, please refer to GPS standard file: NMEA Protocol 0183.
Tensortec(Shenzhen China)
16 / 21
NMEA messages sent by the GNSS receiver are based on NMEA 0183 Version 4.0. The
following picture shows the structure of a NMEA protocol message.
2.3.2 VTG
Example:
$GPVTG,77.52, T, M,0.004, N,0.008, K, A*06
Field
No.
Name Unit Format Example Description
0 xxVTG - string $GPVTG VTG Message ID (xx = current Talker ID)
1 cogt degr
ees
numeric 77.52 Course over ground (true)
2 T - character T Fixed field: true
Tensortec(Shenzhen China)
17 / 21
3 cogm degr
ees
numeric - Course over ground (magnetic), not output
4 M - character M Fixed field: magnetic
5 knots knot
s
numeric 0.004 Speed over ground
6 N - character N Fixed field: knots
7 kph km/
h
numeric 0.008 Speed over ground
8 K - character K Fixed field: kilometers per hour
9 posMode - character A Mode Indicator
10 cs - hexadecimal *06 Checksum
11 <CR><LF> - character - Carriage return and line feed
1. GPS Tracker will send message without stopping to Driveraid once it connects to the
Drivreaid.
2. The Driveriad will accept all messages and filter them, pay attention to useful messages.
Tensortec(Shenzhen China)
18 / 21
3. Apply Filed
Step 1
Through command, Terminal connected to Driveraid, then it sends allocate
warning enable speed threshold command 0x35 to Driveraid. Presume we
need set no warning when speed lower than 20km/s.
Tensortec(Shenzhen China)
19 / 21
amount
27 Fatigue driving warning snapshot BYTE 0xFF
interval time
28 Reserved BYTE 0xFF
29 (Before&after) calling waring BYTE 0xFF
video shoot time
30 Calling waring snapshot (for BYTE 0xFF
driver expression features) photo
amount
31 Calling waring snapshot (for BYTE 0xFF
driver expression features) time
interval
32 (Before&after) smoking waring BYTE 0xFF
video shoot time
33 Smoking waring snapshot (for BYTE 0xFF
driver expression features) photo
amount
34 Smoking waring snapshot (for BYTE 0xFF
driver expression features) time
interval
35 (Before&after) warning video BYTE 0xFF
shoot time
36 Distraction warning snapshot BYTE 0xFF
photo amount
37 distraction warning snapshot time BYTE 0xFF
interval
38 abnormal driving video shoot BYTE 0xFF
time
39 abnormal driving snapshot photo BYTE 0xFF
amount
40 abnormal driving snapshot time BYTE 0xFF
interval
Step 2
Cut down command connection of terminal with Driveraid, and connect
GPS tracker with Driveraid. When GPS is in working condition, means
Driveraid is in no warning state lower than 20km/s.
Step 3
When the terminal connecting with Driveraid, it can also achieve no
warning lower than 20km/s, by sending real time speed data based on
command communicate protocol.
Tensortec(Shenzhen China)
20 / 21
Step 1
Keep connection between snapshot terminaland Drvieraid
Step 2
When Driveraid is warning, snapshot terminal will receive and read
event(warning) report 0x36, then gain the multimedia ID (picture ID).
Step 3
According to the gained multimedia ID (picture ID), the snapshot terminal
will step forward to require Driveraid for multimedia command 0x50;
Step 4
Driveraid will upload multimedia data command 0x51 to snapshot terminal,
then the terminal will read the data and save it.
Tensortec(Shenzhen China)