Prévia do material em texto
1 Version: V3.0.15 Secret level: confidential (V 3.0.15) V3 Vehicle Terminal Communication Protocol 2 amendant record editio n revise content time V 3.0.2 .66 Add the query module with the IMEI number and the SIM card ICCID number 2016‐ 11‐ 25 V 3.0.3 5.3.1.17 . Alarm command, alarm status of pseudo base station 5.4.1.7. The heartbeat packet alarm field increases the alarm status of the pseudo-base station 2016‐ 12‐ 10 V 3 .0.4 Correction 6.6., the instruction issued by the query module IMEI number and the SIM card ICCID number 2016‐ 12‐ 22 V 3.0.5 .3.1.175 . Alarm command, alarm field to add illegal removal alarm status 5. Heart beat packet alarm field adds illegal removal alarm status A 5E-3 special.4.1.7 2017‐ 01‐ 05 V 3.0.6 Reorganize the protocol 2017‐03‐ 11 V 3.0.7 Correction 6. 2 Terminal return format 2017‐03‐ 16 V3.0.8 Add the logical description of the blind spot data processing 2017‐03‐ 22 V3.0.9 The correction terminal returns the format description and removes the content coding 2017‐05‐ 17 V 3.0 .10 Positioning packet increase voltage level upload (A 5E-3) 2017‐05‐ 22 V 3.0 .11 Fixed location packet format to remove voltage levels 2017‐05‐ 25 V 3.0 .12 Add the extended field agreement number, 0 xA 0 Add the extension instruction 0 xA 0 / 0x 00C 5 2018‐05‐ 15 V 3.0 .13 Add the extension instruction 0 xA 0 / 0 x 00880xA 0 / 0x 0089 2018‐05‐ 22 V 3.0 .14 Add the extension instruction 0 xA 0 / 0x 002D 2018‐05‐ 23 V 3.0 .15 The light sensing state is uploaded through the alarm field, and delete the extension instruction 0 xA 0 / 0x 00C 5 2018‐05‐ 30 3 one. Communication statute...................................................................................................4 two. Terms, definitions........................................................................................................... 4 three.basic rule........................................................................................................................5 four. Database format................................................................................................................6 4.1. Start position............................................................................................................... 7 4.2. Package length............................................................................................................7 4.3. Agreement No.............................................................................................................7 .4.4 Information content..................................................................................................7 .5.4. Information, serial number....................................................................................7 .6.4 Error check....................................................................................................................7 4.7. Stop the bits.................................................................................................................8 five. The terminal sends the packets to the server............................................... 7 5.1. Login information package.....................................................................................8 5 .2. Positioning data package (GPS, LBS merged information package).....11 5.3. Alarm package (GPS, LBS, status consolidation information package). 16 .45 . Heartbeat pack (status pack).........................................................................22 six. The server sends the packets to the terminal............................................... 28 6.1. The Server sends it.................................................................................................. 28 6.2., Terminal to return........................................................................................................ 29 seven. Attached A CRC-ITU, search algorithm C language code fragment............... 31 eight. Attach an example of the B communication protocol packet fragment..... 32 nine. C information package complete format.................................................................. 33 A. The packet sent by the terminal to the server............................................... 33 B. The packets sent by the server to the terminal..............................................34 Catalog 4 protocol for the vehicle GPS locator and the positioning service platform. The relevant interface protocol is only applicable for the interaction between the platform and the positioning terminal This document defines the description of the application layer interface . Terms, abbreviations Citation meaning The meaning of Chinese CMP P China Mobile Peer to Peer China Mobile Peer-to- Peer Protocol GPS Global Positioning System Global satellite positioning system GS M Global System for Mobile Communication Global mobile communication system GP RS General Packet Radio Service Universal wireless packet service T CP Transport Control Protocol TCP L BS Location Based Services Auxiliary location service I MEI International Mobile Equipment Identity The International Mobile Device Identification Code M CC Mobile Country Code Country code of the mobile users MNC Mobile Network Code Mobile network number L AC Location Area Code Location area code Cell ID Cell Tower ID Mobile base station U DP User Datagram Protocol user datagram protocol SO S Save Our Ship /Save Our Souls A distress distress signal was death CR C Cyclic Redundancy Check CRC 1. Comunication Rules 2. Terms, Defenition 4 N ITZ Network Identity and Time Zone time zone GI S Geographic Information System geo-information system 5 1. The GPRS connection is successfully established and the first login information packet is sent to the server. Within 5 seconds, the server response data packet thinks the connection is normal, and the location information (GPS, LBS information packet) is sent. After 5 minutes, the status information packet will be sent to regularly confirm the normal communication. 2. When the GPRS connection is not established, the terminal cannot send the login packet. When GPRS, the connection fails 3 times after the terminal starts the timing restart function for 20 minutes. Within 20 minutes, if the terminal successfully connects with the server and receives the packet that the server responds to the login packet sent by the terminal, the timing restart function will be closed and the terminal will not restart, otherwise the terminal will automatically restart after 20 minutes. 3. The server returns the response packet to the terminal. If the terminal sends the login packet or status packet to the server after 5 seconds, the current connection is abnormal, start the GPS location data transmission function, disconnect the current GPRS connection, re -establish a new GPRS connection and send the login packet. 4. The connection is judged as abnormal, repeat 3 times after establishing connection send login packet or status packet, server response packet, the terminal startup timing restart function, timing time for 20 minutes, within 20 minutes if the terminal and the server connection and received the server response packet timing restart function is closed, the terminal does not restart, otherwise the terminal will automatically restart after 20 minutes. 5. After the connection is normally established, the terminal will regularly send GPS and LBS merged information packets to the server after the GPS information changes, and the server can set the default sending protocol through instructions. 6. In order to ensure the validity of the connection, the status information is sent to the server at a fixed time interval, and the server returns the response information package for confirmation. 7. For the terminal without registered IMEI number, please reply to the login request response and heartbeat packet response, do not directly disconnect.(Ifyou directly disconnect or do not reply, it will lead to continuous terminal reconnection and serious GPRS traffic consumption). 3. Basic Rules 5 8. The location of the data more than 180S, no received ACK response, blind area data (terminal no network or connection to the server is not successful, location data report interval will produce blind area data), terminal network to link, with the server after receiving heartbeat response start blind zone data to the platform, the blind zone data longest to 10 location data into a package, if not received ACK response, repeat 3 send interval 4 seconds to clear blind area data. The blind spot data can be saved up to 600 pieces. The blind spot data, the terminal power restart will be lost, and the soft reset will not be lost. 6 Communication transmission is asynchronous and is in bytes. Total Package Length: (10 + N) Byte Data flow diagram 4. Data Packet Format 7 form Length (Byte) start bit 2 packet length 1 Agreement number 1 information content N Information serial number 2 error check 2 stop bit 2 Fixed value, unified hexadhex 0x 78 0x 78. Length = protocol number + information content + information serial number + error check, total (5 + N) Byte, because the information content is indefinite long field. type price login information 0x 01 locator data 0x 22 status information 0x 13 String information 0x 15 alert data 0x 26 The server sends the instruction message to the terminal 0x 80 Extended fields 0xA 0 According to different applications, corresponding to the corresponding "agreement number", to determine the specific content. The serial number of the first GPRS data (including status package and GPS, LBS and other data packages) is '0', and the serial number of each sent data (including status package and GPS and LBS package) is automatically added to 1. Without the power drop, the serial number continues to add 1, will not start from '0'. 4.1. start bit 4.2. packet length 4.3. protocol number 4.4. Information Content 4.5. Information serial number 4.6. error checking 7 The terminal or server can use the verification code. To prevent the data from being sent out during the transmission process Wrong, add the error check, to prevent data misoperation, which increases the security and efficiency of the system. The error check code adopts the CRC-ITU check method. The protocol body goes from Package Length to Information Serial Number (including Package Length, Information Serial Number ") 8 The CRC-ITU values for this part of the data. If the recipient has a CRC error, it will ignore and discard the packet. Fixed value, unified hexadhex 0x 0D 0x 0A. Explain the common information packet sending and server return separately The login packet is used to confirm the normal connection to the server and submit the terminal ID to the server. form length instance Login Informat ion Pack (18 Byte) start bit 2 0x 78 0x 78 packet length 1 0x 11 Agreement number 1 0x 01 informat ion content terminal ID 8 0x 01 0x 23 0x 45 0x 67 0x 89 0x 01 0x 23 0x 45 Type identifica tion code 2 0x 01 0x 18 Time zone language 2 0x 32 0x 00 Information serial number 2 0x 00 0x 01 error check 2 0x 8C 0xDD stop bit 2 0x 0D 0x 00 See Data Package format 4.1 for details See Data Package Format 4.2 for more details 4.7. End bit 5. Detailed Explanation of Terminal Sending Data Packet to Server 5.1. Login information packet 5.1.1. Terminal sending data packet to server 5.1.1.1 Start bit 5.1.1.2 Packet length 9 E. g.: 123456789012345, The terminal ID is: 0x 01 0x 23 0x 45 0x 67 0x 89 0x 01 0x 23 0x4 See Package format 4.3 for details 5 The type identification code occupies two bytes. Determine the terminal type according to this identification code. The first three two bytes represent the type, and the last one represents the branch example: The Type identification code is: 0x 20 0x 00 with oil-electricity break function 0x 20 0x 01 without the oil and electricity break function Note: Fixed to 0x 01 0x 00 bit 15-bit 4 15 A value of 100 14 13 12 11 10 9 8 7 6 5 4 Low‐half‐byte bit3‐bit 0 3 Time zone things 2 No definition 1 Language selection position 1 5.1.1.3. protocol number 5.1.1.4. ID terminal 5.1.1.5 Type ID 5.1.1.6 Timezone, Language 9 0 Language selection position 0 10 Bit 3 0 — East time zone 1 — West Time Zone If: extension: 0x 32 0x 00, GMT + 8:00. Calculation method: 8 * 100 = 800, converted to hex, 0x0320 Expansion: 0x 4D 0xD 8 indicates 3 / 4 of west 12, GMT-12:45. Calculation method: 12.45 * 100 = 1245, turn to hexadecimal, 0x04,0 xDD. The algorithm here is to shift the calculated time zone value cycle left to four times and then combine the time zone east and west, the language selection bit, so that the section See Data Package format 4.5 for detail Save four bytes s See Package format 4.6 for details See data package format 4.7 for details explain length instance Login Information Pack (18 Byte) start bit 2 0x 78 0x 78 packet length 1 0x 05 Agreement number 1 0x 01 Information serial number 2 0x 00 0x 01 error check 2 0xD 9 0xDC stop bit 2 0x 0D 0x 0A Server to terminal response package: (the protocol number in the response package is the same as the packet protocol number sent by the terminal) 5.1.1.7.Information serial number 5.1.1.8. error checking 5.1.1.9. start bit 5.1.2. Server respond data packet 11 See Data Package format 4.1 for details See Data Package Format 4.2 for more details See Package format 4.3 for details See Data Package format 4.5 for details See Package format 4.6 for details See data package format 4.7 for details form length instance start bit 2 0x 78 0x 78 packet length 1 0x 22 Agreement number 1 0x 22 informatio n content GPS information Date time 6 0x 0B 0x 08 0x 1D 0x 11 0x 2E 0x 10 The GPS information satellite 1 0Xcf latitude 4 0x 02 0x 7A 0xC 7 0xEB longitude 4 0x 0C 0x 46 0x 58 0x 49 5.1.2.1 Start bit 5.1.2.2. packet length 5.1.2.3. protocol number 5.1.2.4 information serial number 5.1.2.5. error checking 5.1.2.6. end bit 5.2 GPS Data Packet 5.2.1. Terminal sends positioning data packet to server 12 velocity 1 0x 00 Tours, states 2 0x 14 0x 8F LBS information M CC 2 0x 01 0xCC M N C 1 0x 00 L AC 2 0x 28 0x 7D Cell ID 3 0x 00 0x 1F 0xB 8 ACC 1 0x 01 Data reporting mode 1 0x 01 GPS real-time supplementary transmission 1 0x 00 serial number 2 0x 00 0x 03 error check 2 0x 80 0x 81 end bit 2 0x 0D 0x 0A See Data Package format 4.1 for details See Data Package Format 4.2 for more details See Package format 4.3 for details form Length (Byte) instance year 1 0x 0A moon 1 0x 03 sun 1 0x 17 time 1 0x 0F 5.2.1.1 Start bit 5.2.1.2 packet length 5.2.1.3 protocol number 5.2.1.4. Date and Time 12 component 1 0x 32 13 second 1 0x 17 For example: 15:50:23 seconds on March 23,2010 Calculation method: 10 (10) =0A (16)) 3 (10 decimal point) =03 (16 decimal point) 23 (10 decimal point) =17 (16 decimal point) 15 (10 decimal point) =0F (16 decimal point) 50 (10 decimal point) =32 (16 decimal point) 23 (10 decimal point) =17 (16 decimal point) Then the value is: 0x 0A 0x 03 0x 17 0x 0F 0x32 0x17 1 Byte has two hexadecimal characters displayed, the first being the GPS information length and the second being the number of participating positioning satellites Example: 0 xCB means that the GPS information length is 12, and the number of satellites involved in the positioning is 11.(C = 12By te length, B = 11 satellites) It takes up 4 bytes and represents the latitude value of the location data. The value range from 0 to 162000000 represents the range from 0 to 90 degrees as follows: Convert the longitude and latitude output of GPS module into units; then multiply the converted number by 30000 and convert the multiplication into 16 decimal numbers. If 2232.7658'= (22 * 60 + 32.7658) * 30000 = 40582974, then convertedto hexadecimal number 40582974 (10 decimal) = 26B 3F 3E (16 decimal) The final value is 0x 02 0x 6B 0x 3F 0x 3E. It takes up 4 bytes and represents the longitude value of the location data. The values range from 0 to 324000000, representing a range of 0 degrees to 180 degrees. The conversion method and latitude are consistent. 1 byte, indicating the running speed of GPS, the value range 0 x 00 to 0 xFF indicates the range 0 to 255 km / h. For example, 0x00 represents 0 km / h. 0x 10 represents 16 km / h 5.2.1.5. Information length and the number of satellites involved in positioning 5.2.1.6 latitude 5.2.1.7. longtitude 5.2.1.8 Speed 13 The 0 xFF generation of 255 km / h 14 Occupying 2 bytes, indicating the running direction of GPS, indicating the range of 0~360, unit: degree, due north to 0 degrees, clockwise. BYTE _1 Bit 7 0 Bit 6 0 Bit 5 GPS real-time / differential localization Bit 4 The GPS location is already in No Bit 3 East longitude, west longitude Bit 2 South latitude, north latitude Bit 1 azimuth Bit 0 BYTE _2 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Note: The status information in the packet is the moment state of the time bit record in the packet. For example, the value is 0x 15 0x 4C, becomes binary is 00010101 01001100, BYTE _ 1 Bit 70BYTE _1 Bit 60BYTE _1 Bit 50 (Real-time GPS)BYTE _1Bit 41 (GPSPositioned)BYTE _1Bit 30 (E longitude)BYTE _1Bit 2 1 (North Latitude)BYTE _1Bit 1 0BYTE _1Bit 0 1BYTE _2Bit 7 0BYTE _2Bit 6 1BYTE _2Bit 5 0 heading 332° (0101001100 binary conversion to decimal to 332)BYTE _2Bit 40BYTE _2Bit 31BYTE _2Bit 21BYTE _2Bit 10BYTE _2Bit 00GPS has been located, real-time GPS, north latitude, east longitude, heading 332° 5.2.1.9. state heading 15 5.2.1.10. MCC Country code Mobile Country Code (MCC) For example: China's mobile country number is: China's mobile country number is 460 (decimal) 0x 01 0xCC (decimal 460 converted to hexadecimal, hexadecimal is less than four left fill 0) The value range here is: 0x 0000 ~ 0x03E7 5.2.1.11. MNC Mobile network number Mobile Network Code (MNC) For example: China Mobile is 0x 00. .2.1.12.5 LAC The location area code Location Area Code (LAC) is included in the LAI and consists of two bytes in 16 decimal encoding. The available range is 0x 0001-0xFFFE, and the code groups 0x 0000 and 0xFFFF are not available (see GSM specification 03.03,04.08, and 11.11). 5.2.1.13. Cell ID ACC status ACC low 00 and ACC high 0 Mobile base station Cell Tower ID (Cell ID), the value range is 0x 000000 ~ 0xFFFFFF 5.2.1.14. ACC 1 The GPS data point report type 0x 00 regular time upload 0x 01 Distance upload (terminal not done) 0x 02 Turning-point to upload 0x 03 ACC status change to upload 0x 04 still last position upload 0x 05 Upload directly after successful login .2.1.16.5 GPS real-time retransmission GPS real-time supplementary transmission 0x 00 real-time upload 0x 01 Retransmission 5.2.1.17. information serial number 5.2.1.15 data uploading mode 15 See Data Package format 4.5 for details 16 See Package format 4.6 for details 5.2.1.19. end bit See data package format 4.7 for details 5.3.1. form lengt h instance start bit 2 0x 78 0x 78 packet length 1 0x 25 Agreement number 1 0x 26 Date time 6 0x 0B 0x 08 0x 1D 0x 11 0x 2E 0x 10 informat ion content GPS information GPS information length + satellite number 1 0xCF latitude 4 0x 02 0x 7A 0xC 7 0xEB longitude 4 0x 0C 0x 46 0x 58 0x 49 velocity 1 0x 00 Tours, states 2 0x 14 0x 8F LBS information LBS length 1 0x 08 M CC 2 0x 01 0xCC M N C 1 0x 00 L AC 2 0x 28 0x 7D Cell ID 3 0x 00 0x 1F 0xB 8 status informati Terminal information content 1 0x 40 the classification 1 0x 06 5.2.1.18 error checking 5.3. Alarm packet 16 on of voltage GSM signal intensity 1 0x 04 Alarm / voice / expansion port status 2 0x 00 0x 02 17 serial number 2 0x 00 0x 1F error check 2 0xC 4 0x 39 end bit 2 0x 0D 0x 0A 5.3.1.1. See Data Package format 4.1 for details 5.3.1.2. See Data Package Format 4.2 for more details 5.3.1.3. See Package format 4.3 for details 5.3.1.4. See location packet format 5.2.1.4 for details 5.3.1.5. GPS See location packet format 5.2.1.5 for details 5.3.1.6. See location packet format 5.2.1.6 for details 5.3.1.7. See Location packet format 5.2.1.7 for details 5.3.1.8. See Location packet format 5.2.1.8 for details 18 5.3.1.9. See location packet format 5.2.1.9 for details 5.3.1.10. MCC See location packet format 5.2.1.10 for details 5.3.1.11. MNC See location package format 5.2.1.11 for details .3.1.12.5 LAC See location package format 5.2.1.12 for details 5.3.1.13. Cell ID See 5.2.1.13 5.3.1.14. It takes up 1 byte to represent the various status information of the mobile phone Position Code meaning B YTE Bit 7 1: Ooff 0: O-electric on Bit 6 1: The GPS is located 0: The GPS is not located Bit 3 ~ Bit5 110: Overspeed alarm 101: Timeout alarm (fatigue driving) 100: The SOS calls for help 011: Low power alarm 010: Power-off alarm 001: The vibration alarm occurs 000: Normal 18 Bit 2 1: Charging with the connected power supply 19 0: Charging without connected power supply Bit 1 1: High ACC 0: Low in ACC Bit 0 1: Fortification 0: Withdrawal For example: 0x44, the corresponding binary is 01000100 The terminal status is: oil-electric on, GPS positioning, no alarm, normal power charging, ACC is low, and withdrawal state 5.3.1.15. Range is 0~6, indicating the voltage size from low to high. 0: No power (shutdown) 1: Very low power (insufficient to call, send text messages, etc.) 2: Low power 3: Low power level (available for normal use) 4: Power 5: High power 6: Very high power level Like: 0x02, the power supply is very low 5.3.1.16. GSM 0x 00: no signal; 0x 01: Very weak signal 0x 02: Weak signal 0x 03: Good signal 0x 04: Strong signal If: 0x03 GSM signal is good 5 . 3 . 1 . 1 7 . / 0x 00 (front) 0x 01 (back) Front position: the terminal alarm status Rear bit: the terminal current language bit Bytes 1 The 0x 00 is normal 0x 01 SOS Call for help 0x 02 Power-off alarm 0x 03 Shock alarm 20 0x 04 Enter the fence to alarm 0x 05 out fence alarm 0x 06 Overspeed alarm 0x 09 bit shift alarm 0x 0A pseudo base station alarm 0x 0C illegal removal alarm (excellent Advanced Bytes 2 State [0~7] Default: 0x 00 Bit 0~Bit 3 indicates the language type: 0x 01 Chinese 0x 02 is written in English Bit 4 Light-sensing state 1: See light 0: no light From Bit 5 to Bit 7 is retained in compliance with: No alarm Chinese: 0x 00 0x 01; no alarm English: 0x 00 0x 02 : A. Low power alarm appears in the terminal information C. Pseudo-base station alarm B. Alarm / language information for entering and leaving the fence D. Illegal demolition and alarm 5.3.1.18. See Data Package format 4.5 for details 5.3.1.19. 20 See Package format 4.6 for details 5.3.1.20. See data package format 4.7 for details Note: The status information in the packet is the moment state of the time bit record in the packet. 21 5.3.2. form Length (Byte) instance start bit 2 0x 78 0x 78 packet length 1 0x 05 Agreement number 1 0x 26 serial number 2 0x 00 0x 01 error check 2 0xD 9 0xDC end bit 2 0x 0D 0x 0A The alarm package adds the composition of status information (alarm information) on the basis of the positioning package, and the coding protocol format is also in the positioning Status information composition is added to the package. 5.3.2.1. See Data Package format 4.1 for details 5.3.2.2. See Data Package Format 4.2 for more details 5.3.2.3. See Package format 4.3 for details 5.3.2.4. See Data Package format 4.5 for details 5.3.2.5. See Data Package format 4.6 for details 5.3.2.6. 21 See data package format 4.7 for details 22 5 ..4 A heartbeat packet is a data packet that maintains the connection of the terminal to the server 5.4.1. form Length (Byte) instance startbit 2 0x 78 0x 78 packet length 1 0x 0A Agreement number 1 0x 13 informati on content Terminal information content 1 0x 40 the classification of voltage 1 0x 06 GSM signal intensity 1 0x 04 Alarm / language / expansion port status 2 0x 00 0x 01 serial number 2 0x 00 0x 1F error check 2 0xC 4 0x 39 end bit 2 0x 0D 0x 0A 5.4.1.1. See Data Package format 4.1 for details 5.4.1.2. See Data Package Format 4.2 for more details 5.4.1.3. See Package format 4.3 for details 5.4.1.4. It takes up 1 byte to represent the various status information of the mobile phone. Position Code meaning 22 B YTE Bit 7 1: Ooff 0: O-electric on Bit 6 1: The GPS is located 0: The GPS is not located 23 Bit 3 ~ Bit5 100: Reserved 101:, timeout alarm 110: Overspeed alarm 011: Low power alarm 010: Power-off alarm 001: The vibration alarm occurs 000: Normal Bit 2 1: Charging with the connected power supply 0: Charging without connected power supply Bit 1 1: High ACC 0: Low in ACC Bit 0 1: Fortification 0: Withdrawal For example: 0x44, the corresponding binary is 01000100 It means that the terminal status is: oil and power is on, GPS is located, no alarm is normal, power supply is connected, and ACC is low 5.4.1.5. Range is 0~6, indicating the voltage size from low to high. 0: No power (shutdown) 1: Very low power (insufficient to call, send text messages, etc.) 2: Low power 3: Low power level (available for normal use) 4: Power 5: High power 6: Very high power level Like: 0x02, the power supply is very low 5.4.1.6. GSM 0x 00: no signal; 0x 01: Very weak signal 0x 02: Weak signal 0x 03: Good signal 0x 04: Strong signal 23 If: 0x03 GSM signal is good 5 / .4.1.7. 0x 00 (front) 0x 01 (back) Front position: Terminal expansion port status 24 Rear bit: the terminal current language bit anteposition The 0x 00 is normal 0x 01 SOS Call for help 0x 02 Power-off alarm 0x 03 Shock alarm 0x 04 Enter the fence to alarm 0x 05 out fence alarm 0x 06 Overspeed alarm 0x 09 bit shift alarm 0x 0A pseudo-base station alarm 0x 0B detects pseudo base station (real-time detection, not as alarm) 0x 0C Illegal removal alarm (highest priority) retropositio n State [0~7] defaults to 0x 00 Bit 0 ~ Bit 3 represents the language type 0x 01 in Chinese 0x 02 is written in English Bit 4 Light sensing state 1: See light 0: no light Bit 5 to Bit 7 retained in compliance with: No alarm in Chinese: 0x 00 0x 01 No alarm in English: 0x 00 0x 02 5.4.1.8. See Data Package format 4.5 for details 5.4.1.9. See Package format 4.6 for details 25 5.4.1.10. See data package format 4.7 for details 5.4.2. form length instance Heart response Pack (10 Byte) start bit 2 0x 78 0x 78 packet length 1 0x 05 Agreement number 1 0x 13 Information serial number 2 0x 00 0x 01 error check 2 0xD 9 0xDC end bit 2 0x 0D 0x 0A Server to terminal response package: (the protocol number in the response package is the same as the packet protocol number sent by the terminal) 5.4.2.1. See Data Package format 4.1 for details 5.4.2.2. See Data Package Format 4.2 for more details 5.4.2.3. See Package format 4.3 for details 5.4.2.4. See Data Package format 4.5 for details 5.4.2.5. See Package format 4.6 for details 5.4.2.6. See data package format 4.7 for details 26 5.4.3. 78 78 0A 13 04 06 03 00 02 00 04 1D A 3 0D 0A 0x 78 0x 78 0x 0A 0x 13 0x 04 0x 06 0x 03 0x 00 0x 02 0x 00 0x 04 0x 1D 0XA 3 0x 0D 0x 0A 78 78 05 13 00 11 F 9 70 0D 0A 0x 78 0x 78 0x 05 0x 13 0x 00 0x 11 0xF 9 0x 70 0x 0D 0x 0A This is an example of heartbeat response, can refer to 5.5 5.5.1. form Length (Byte) instance informati on content start bit 2 0x 78 0x 78 packet length 1 0x 05+n Agreement number 1 0xA Extended fields N See Data Package format 5.5.1.8 for details serial number 2 0x 00 0x 1F error check 2 0xC 4 0x 39 end bit 2 0x 0D 0x 0A 5.5.1.1. See Data Package format 4.1 for details 5.5.1.2. See Data Package Format 4.2 for more details 5.5.1.3. See Package format 4.3 for details () 27 5.5.1.4. See Data Package format 5.5.1.8 for details 5.5.1.5. See Data Package format 4.5 for details 5.5.1.6. See Package format 4.6 for details 5.5.1.7. See data package format 4.7 for details 5.5.1.8. uplink extension data format description: consists of length N + instruction M + data D Length N: 2 bytes, HEX format representation, including instruction M + data D length instruction M: 2 bytes, HEX, format representation Data D: Not necessarily long For example, 00 05 00 01 01 2A 06 indicates that the length = 0x0005, instruction =0x0001, and data =0x01 0x2A 0x06 function length instruct data specification remarks Extensi on mileage 0x0006 0x 0088 4 Byte mileage data unit: meters (for CD 148) Extende d alarm status 2 0x 0006 0x 0089 State [0~31] defaults to 0xFFFFFFFF Bit 8:1 normal; 0 emergency acceleration alarm (for CD 148) Note: Mark is maintained until the alarm condition is lifted Bit 9:1 normal; 0 emergency deceleration alarm (for CD 148) Note: The mark is maintained until the alarm condition is lifted bit 25:1: Normal 0: sharp turn alarm (for CD 148) Termina l externa l electri c voltage value 0x 0004 0x 002D The 2-byte AD voltage value 0x30D5 means 12.501v (CD148) 28 . 6.1. form Length (Byte) instance start bit 2 0x 78 0x 78 packet length 1 0x 0F Agreement number 1 0x 80 information content command length 1 0xCA Server flag bit 4 0x 00 0x 00 0x 00 0x 01 Directive content M language 2 Information serial number 2 0x 00 0x 01 error check 2 0xD 9 0xDC stop bit 2 0x 0D 0x 0A 6.1.1. See Data Package format 4.1 for details 6.1.2. See Data Package Format 4.2 for more details 6.1.3. Server sends the protocol number: 0x80 29 6.1.4. Server, flag bit + instruction content length (4 + M) For example, 0x0A in byte length means that the instruction content occupies 6 bytes 6.1.5. Left for the server identification, the terminal returns the binary data in the return package 6.1.6. As a string of ASC, the instruction content is compatible with SMS instructions 6.1.7. Terminal current language bit. Chinese language: 0x 00 0x 01 English: 0x 00 0x 02 6.1.8. See Data Package format 4.5 for details 6.1.9. See Package format 4.6 for details 6.1.10. See data package format 4.7 for details 6.2 form Length (Byte) instance start bit 2 0x 78 0x 78 packet length 1 0x 0F Agreement number 1 0x 15 information content command length 1 0xCA Server flag bit 4 0x 00 0x 00 0x 00 0x 01 29 30 Directive content M language 2 Information serial number 2 0x 00 0x 01 error check 2 0xD 9 0xDC stop bit 2 0x 0D 0x 0A 6.2.1 Fixed value of 0x 78 0x78 6.2.2 Occupy of 1 byte 6.2.3 Use with 0x15 6.2.4 Server, flag bit + instruction content length (4 + M) For example, 0x0A in byte length means that the instruction content occupies 6 bytes 6.2.5 Left for the server identification, the terminal returns the binary data in the return package 6.2.6 Data required to be sent. 6.2.7 See Data Package format 4.5 for details 6.2.8 30 See Package format 4.6 for details 31 6.2.9 See data package format 4.7 for details 6.2.10 78 78 12 80 0A 00 00 00 01 52 45 53 45 54 23 00 02 00 34 73 2E 0D 0A 0x 78 0x 78 0x 00 0x 34 0x 12 0x 80 0x 73 0x 2E 0x 0A 0x 0D 0x 0A 0x 00 0x 00 0x 00 x 01 0x 52 0x 45 0x 53 0x 45 0x 54 0x 23 0x 00 0x 02 78 78 32 15 2A 00 00 00 01 54 68 65 20 74 65 72 6D 69 6E 61 6C 20 77 69 6C 6C 20 72 65 73 74 61 72 74 20 61 66 74 65 72 20 32 30 73 65 63 21 00 02 00 0A 1B F 0 0D 0A 0x 78 0x 78 0x 32 0x 15 0x 00 0x 00 0x 00 0x 01 0x 54 0x 68 0x 65 0x 20 0x 74 0x 65 0x 72 0x 6D 0x 69 0x 6E 0x 61 0x 6C 0x 20 0x 77 0x 69 0x 6C 0x 6C 0x 20 0x 72 0x 65 0x 73 0x 74 0x 61 0x 72 0x 74 0x 20 0x 61 0x 66 0x 74 0x 65 0x 72 0x 20 0x 32 0x 30 0x 73 0x 65 0x 63 0x 21 0x 00 0x 02 0x 00 0x 0A 0x 1B 0xF 0 0x 0D 0x 0A . A CRC -ITU C CRC-ITU table algorithm C language code fragment static constU 16 crctab 16[] = { 0X 0000, 0X 1189, 0X 2312, 0X 329B , 0X 4624, 0X 57AD , 0X 6536, 0X 74BF , 0X 8C 48, 0X 9DC 1, 0XAF 5A , 0XBED 3, 0XCA 6C , 0XDBE 5, 0XE 97E , 0XF 8F 7, 0X 1081, 0X 0108, 0X 3393, 0X 221A , 0X 56A 5, 0X 472C , 0X 75B 7, 0X 643E , 0X 9CC 9, 0X 8D 40, 0XBFDB , 0XAE 52, 0XDAED , 0XCB 64, 0XF 9FF , 0XE 876, 0X 2102, 0X 308B , 0X 0210, 0X 1399, 0X 6726, 0X 76AF , 0X 4434, 0X 55BD, 0XAD 4A , 0XBCC 3, 0X 8E 58, 0X 9FD 1, 0XEB 6E , 0XFAE 7, 0XC 87C , 0XD 9F 5, 0X 3183, 0X 200A , 0X 1291, 0X 0318, 0X 77A 7, 0X 662E , 0X 54B 5, 0X 453C , 0XBDCB , 0XAC 42, 0X 9ED 9, 0X 8F 50, 0XFBEF , 0XEA 66, 0XD 8FD , 0XC 974, 0X 4204, 0X 538D , 0X 6116, 0X 709F , 0X 0420, 0X 15A 9, 0X 2732, 0X 36BB, 0XCE 4C , 0XDFC 5, 0XED 5E , 0XFCD 7, 0X 8868, 0X 99E 1, 0XAB 7A , 0XBAF 3, 0X 5285, 0X 430C , 0X 7197, 0X 601E , 0X 14A 1, 0X 0528, 0X 37B 3, 0X 263A , 0XDECD , 0XCF 44, 0XFDDF , 0XEC 56, 0X 98E 9, 0X 8960, 0XBBFB , 0XAA 72, 0X 6306, 0X 728F , 0X 4014, 0X 519D , 0X 2522, 0X 34AB , 0X 0630, 0X 17B 9, 0XEF 4E , 0XFEC 7, 0XCC 5C , 0XDDD 5, 0XA 96A , 0XB 8E 3, 0X 8A 78, 0X 9BF 1, 0X 7387, 0X 620E , 0X 5095, 0X 411C , 0X 35A 3, 0X 242A , 0X 16B 1, 0X 0738, 0XFFCF , 0XEE 46, 0XDCDD , 0XCD 54, 0XB 9EB , 0XA 862, 0X 9AF 9, 0X 8B 70, 0X 8408, 0X 9581, 0XA 71A , 0XB 693, 0XC 22C , 0XD 3A 5, 0XE 13E , 0XF 0B 7, 0X 0840, 0X 19C 9, 0X 2B 52, 0X 3ADB , 0X 4E 64, 0X 5FED , 0X 6D 76, 0X 7CFF , 0X 9489, 0X 8500, 0XB 79B , 0XA 612, 0XD 2AD , 0XC 324, 0XF 1BF , 0XE 036, 0X 18C 1, 0X 0948, 0X 3BD 3, 0X 2A 5A , 0X 5EE 5, 0X 4F 6C , 0X 7DF 7, 0X 6C 7E , 32 0XA 50A , 0XB 483, 0X 8618, 0X 9791, 0XE 32E , 0XF 2A 7, 0XC 03C , 0XD 1B 5, 0X 2942, 0X 38CB , 0X 0A 50, 0X 1BD 9, 0X 6F 66, 0X 7EEF , 0X 4C 74, 0X 5DFD , 0XB 58B , 0XA 402, 0X 9699, 0X 8710, 0XF 3AF , 0XE 226, 0XD 0BD , 0XC 134, 0X 39C 3, 0X 284A , 0X 1AD 1, 0X 0B 58, 0X 7FE 7, 0X 6E 6E , 0X 5CF 5, 0X 4D 7C , 0XC 60C , 0XD 785, 0XE 51E , 0XF 497, 0X 8028, 0X 91A 1, 0XA 33A , 0XB 2B 3, 0X 4A 44, 0X 5BCD , 0X 6956, 0X 78DF , 0X 0C 60, 0X 1DE 9, 0X 2F 72, 0X 3EFB , 0XD 68D , 0XC 704, 0XF 59F , 0XE 416, 0X 90A 9, 0X 8120, 0XB 3BB , 0XA 232, 0X 5AC 5, 0X 4B 4C , 0X 79D 7, 0X 685E , 0X 1CE 1, 0X 0D 68, 0X 3FF 3, 0X 2E 7A , 0XE 70E , 0XF 687, 0XC 41C , 0XD 595, 0XA 12A , 0XB 0A 3, 0X 8238, 0X 93B 1, 0X 6B 46, 0X 7ACF , 0X 4854, 0X 59DD , 0X 2D 62, 0X 3CEB , 0X 0E 70, 0X 1FF 9, 0XF 78F , 0XE 606, 0XD 49D , 0XC 514, 0XB 1AB , 0XA 022, 0X 92B 9, 0X 8330, 0X 7BC 7, 0X 6A 4E , 0X 58D 5, 0X 495C , 0X 3DE 3, 0X 2C 6A , 0X 1EF 1, 0X 0F 78, }; // Calculate the 16-bit CRC for the given length data. U 16 GetCrc 16(const U 8* pData , int nLength ) { U 16 fcs = 0xffff; / / Initialized while (nLength >0){ fcs = (fcs >> 8) ^ crctab 16[(fcs ^ *pData ) & 0xff ]; nLength ‐‐; pData ++; } return ~ fcs; / / reverse } . B The following data is the communication intercepted from the terminal and the server, the data displayed in hexadecimal, indicating the terminal Represents the server is returned by: Landing package: Issued: 78 78 11 01 00 00 01 31 22 33 44 55 01 00 32 00 00 00 21 AD 0D 0A Receipt: 78 78 05 01 00 01 D 9 DC 0D 0A GPS, data package (using the GPSLBS merge information package): Issued from: 78 78 22 22 11 02 1B 06 01 0D C 5 02 6D DE C 0 0C 3B FE E 6 25 14 00 01 CC 00 26 2C 00 0E BA 00 00 00 00 06 2B 7D 0D 0A State package: Issued out: 78,780 A 1304060300020003691C 0D 0A Receipt: 78 78 05 13 00 11 F 9 70 0D 0A Alarm package: Issued: 78 78 25 26 11 02 04 06 11 39 C 5 02 6D DE C 0 0C 3B FE E 6 23 14 49 08 01 CC 00 26 2C 00 0E BA 54 00 03 02 02 00 6B FB EE 0D 0A (power alarm) Issued out: 78 78 25 26 11 02 04 06 11 01 C 5 02 6D DE C 0 0C 3B FE E 6 5B 14 49 08 01 CC 00 26 2C 00 0E BA 74 06 04 06 02 00 67 0B 36 0D 0A (Overspeed Alarm) 33 Off-line oil-power shutdown: Receipt: 78 78 14 80 0C 00 00 00 01 52 45 4C 41 59 2C 31 23 00 02 00 3C 04 2B 0D 0A Issued from: 78 78 19 15 11 00 00 00 01 C 7 D 0 B 6 CF D 3 CD B 5 E 7 B 3 C 9 B 9 A 6 21 00 02 10 22 AB 33 0D 0A Server Issue RELAY, 1 # Reply: cut off the oil and electricity successfully! Issue instructions when when the electricity has been disconnected: Receipt: 78 78 14 80 0C 00 00 00 01 52 45 4C 41 59 2C 31 23 00 02 01 30 D 7 9F 0D 0A Issued from: 78 78 31 15 29 00 00 00 01 D 6 D 5 B 6 CB D 2 D 1 B 4 A 6 D 3 DA B 6 CF D 3 CD B 5 E 7 D 7 B 4 CC AC A 3 AC B 1 BE D 6 B 8 C 1 EE B 2 BB D 4 D 9 D 6 B 4 D 0 D 0 21 00 02 00 06 EF C 6 0D 0A Server Issue RELAY, 1 # Reply: the terminal is in the shutdown state, this instruction is no longer executed! Online gas-electric recovery: Receipt: 78 78 14 80 0C 00 00 00 01 52 45 4C 41 59 2C 30 23 00 02 01 31 C 2 3D 0D 0A Issued from: 78 78 19 15 11 00 00 00 01 BB D 6 B 8 B 4 D 3 CD B 5 E 7 B 3 C 9 B 9 A 6 21 00 02 00 07 3B 78 0D 0A Server issue: RELAY, 0 # Reply: restore oil and electricity success! Issue issue when when and electricity has been restored: Receipt: 78 78 14 80 0C 00 00 00 01 52 45 4C 41 59 2C 30 23 00 02 01 32 F 0 A 6 0D 0A Issued from: 7,87833,152 B 00000001 D 6 D 5 B 6 CB D 2 D 1 B 4 A 6 D 3 DA D 3 CD B 5 E 7 BD D 3 CD A 8 D 7 B 4 CC AC A 3 AC B 1 BE D 6 B 8 C 1 EE B 2 BB D 4 D 9 D 6 B 4 D 0 D 0 21 00 02 00 08 28 59 0D 0A Server issue: RELAY, 0 # Reply: the terminal is in the gas-on state, this instruction is no longer executed! . C A Login Information Pack (22 Byte) sta rt bi Bao long line proto col Numb ter mi na Type iden tifi Time- zone lang Informatio n serial number check bit stop bit 33 t ar meas ure er l ID cati on code uage 2 1 1 8 2 2 2 2 2 GPS, LBS package (36 + M + N Byte) o r ig i n B a o l on g p r ot o co l information content i n fo r ma t io n v e ri f ic a ti o n c e as e su n GPS information LBS information in ad va nc e 34 Po si ti on lin ear mea sur e Num ber P er i od o f t i me GPS informatio n Length , and the number of satelli tes involve d in positio ning l at i tu d e l on g it u de v el o ci t y , f o r m f o r m R es e rt h e e xp a ns i on b i ts M CC M N C LA C Cel l I D L ea v e i t f or t h e e x te n si o n s er i al n u mb e r Pos iti on Pos iti on 2 1 1 6 1 4 4 1 2 M 2 1 2 3 N 2 2 2 Status Pack (15 Byte) s t ar t b i t p a ck e t l en g th T h e A gr e em e nt N o information content I n fo r ma t io n o n t h e s e ri a l n u mb e r c he c k b it s to p b i tTerminal information content the classific ation of voltage The GSM signal intensity grade Reserved expansion Bits (language) 2 1 1 1 1 1 2 2 2 2 Terminal response to instructions sent by the server (15 + M + N Byte) s t ar t b i t p a ck e t l e ng t h T h e A g re e me n t N o String content I n fo r ma t io n o n t h e s e ri a l c h ec k b i t s t op b i tcommand length Server flag bit Directive content Reserved expansion Bits (language) 2 1 1 1 4 M N 2 2 2 B Response after the server receives the status packet sent a z i m u t h 34 by the terminal (10 Byte) start bit packet length Agreemen t number Information serial number check bit stop bit 2 1 1 2 2 2 Command packet sent by the server to the terminal (15 + M + N Byte) ris e wra p joi nt String content le tt er ch ec k sto p 35 T he b eg i nn i ng l en g th D is c us s io n n um b er command length Server flag bit Directive content Reserved expansion Bits (language) I nt e re s t s er i al C he c k t he p os i ti o n S to p 2 1 1 1 4 M N 2 2 2 . . . . 4.1. 4.2. 4.3. 4.4. 4.5. 4.6. 4.7. . 5.1. 5.1.1. 5.1.1.1. 5.1.1.2. 5.1.1.3. 5.1.1.4. ID 5.1.1.5. 5.1.1.6. 5.1.1.7. 5.1.1.8. 5.1.1.9. 5.1.2. 5.1.2.1. 5.1.2.2. 5.1.2.3. 5.1.2.4. 5.1.2.5. 5.1.2.6. 5.2.1.1. 5.2.1.2. 5.2.1.3. 5.2.1.4. .2.1.5.5 GPS 5.2.1.6. 5.2.1.7. 5.2.1.8. 5.2.1.9. 5.2.1.10. MCC 5.2.1.11. MNC .2.1.12.5 LAC 5.2.1.13. Cell ID .2.1.14.5 ACC 5.2.1.15. .2.1.16.5 GPS 5.2.1.17. 5.2.1.18. 5.2.1.19. 5.3. (GPS LBS ) 5.3.1. 5.3.1.1. 5.3.1.2. 5.3.1.3.5.3.1.4. 5.3.1.5. GPS 5.3.1.6. 5.3.1.7. 5.3.1.8. 5.3.1.9. 5.3.1.10. MCC 5.3.1.11. MNC .3.1.12.5 LAC 5.3.1.13. Cell ID 5.3.1.14. 5.3.1.15. 5.3.1.16. GSM 5.3.1.17. / 5.3.1.18. 5.3.1.19. 5.3.1.20. 5.3.2 5.3.2.1. 5.3.2.2. 5.3.2.3. 5.3.2.4. 5.3.2.5. 5.3.2.6. 5 ..4 5.4.1. 5.4.1.1. 5.4.1.2. 5.4.1.3. 5.4.1.4. 5.4.1.5. 5.4.1.6. GSM 5 /.4.1.7. 5.4.1.8. 5.4.1.9. 5.4.1.10. 5.4.2. 5.4.2.1. 5.4.2.2. 5.4.2.3. 5.4.2.4. 5.4.2.5. 5.4.2.6. 5.4.3 5.5 5.5.1 5.5.1.1. 5.5.1.2. 5.5.1.3. 5.5.1.4. 5.5.1.5. 5.5.1.6. 5.5.1.7. 5.5.1.8. . 6.1. 6.1.1. 6.1.2. 6.1.3. 6.1.4. 6.1.5. 6.1.6. 6.1.7. 6.1.8. 6.1.9. 6.1.10. 6.2 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.2.8 6.2.9 6.2.10 . A CRC -ITU C . B