You are on page 1of 5

1

Communication Protocol
1 Format Specification
Down Data: The data that the center send to dtu
Uploading Data: The data that DTU send to center
1.1TCP Format
1.1.1 Down Data
Begin
Byte
High
Ver
Low
Ver
Data
Length
High
Bits
Data
Length
Low
Bits
Data Data
Check
End
byte
1Byte 1Byte 1Byte 1Byte 1Byte Accorddin
g to data
length
1Byte 1Byte
1. Begin Byte: 0x7E
2. Version: Two bytes defined by ourself, for example, version 0001
3. Data Length: The data length of data content
4. Data: The data received
5. Data Check: The accumulated sum of the received data.(Except begin byte,
end byte and the data check byte itself)
6. End byte: 0x7E
7. Transferred 7E to 7D 01, 7D to 7D 02 in other data content except begin byte
and end byte.
1.1.2 Uploading Data
Begin
Byte
High
Ver
Low
Ver
Data
Length
High
Bits
Data
Length
Low
Bits
Data Data
Check
End
byte
1Byte 1Byte 1Byte 1Byte 1Byte Accorddin
g to data
length
1Byte 1Byte
2
1.2UDP Format
The same to TCP Format
1.3Data
IDNum Command Data length Data
4 Bytes 2 Bytes 2 Bytes Data content
ID number: The ID number of Device.
Data length: The length of data content
2 Wireless Update Command
This protocal is work in the window way. The size of the window which is sent by the
center should be the same every time.
2.1Update Require, Uploading Command 0x5501
This command should be sent to center. If the device cant receive the answer in
several times, it will be judged register fail.
Fields Length Description
Data Length 2 Total length of all the paras below
Type Of Software 1 0 stands for APP software,
1 stands for BOOT softeware
Breakpoint 4 Total number of the bytes which have bee
upgraded
Response Way 1 0x00 stands for One response.
0x01 stands for the response in windows
way.
The max frame
number for
window
1 The max number is 16
The Version To Be
Update
40 Fill with blank space if the length is less than
40.
The Length Of
Devices Version
1 The length of devices version
Devices Version According to the
length of device
version
The current version number of the device.
3
2.2Update Response, Down Command 0xDD01
Fields Length Description
Data Length 2 Total length of all the paras below
Response Type 1 01 need to update
02 not need to update
03 cant find the version for update
04 breakpoint error
The fields below
should be
contained to
update
Window Frame
Number
2 The begin frame num of window.( Begin from 0)
Window Size 1 Due to the limit to device ram, it just get 4 frame
data. (The max is 16 frames for a window.)
Frame Max Length 2 The max length of the 4 window frames above.
Total length 4 The total length of the app software.
2.3The response of device to the Down Update Response of 2.2.
The Update Command 0x5502
Fields Length Description
Data Length 2 Total length of all the paras belowthe length is 1
Response Type 1 00: Fail(The center stop update if received this
command )
01: Success
2.4Center Send WindowData, Down Command 0XDD03
The last byte of the last frame should be the check value of all the accumulated
sums of all the app softeware bytes.
4
Fields Length Description
Data Length 2 Total length of all the paras below
Window Frame
Number
2 The window frame number of current
data.
Software Content The content Length
window frame
number
The content to update. The proposed
value is 1024. The last frame uses the
real length.
2.5The Devices Response to windowdata, The Update
Command 0x5503
When the center get the reponse, and the content of the response is 00H, 02H
or 03H, the center should send the corresponding stop command to the dtu.
Fields Length Description
Data Length 2 Total length of all the paras below
Response Type 1 00H: Fail
01H: Success
02H: Flash error, stop upgrade
03H: Upgrade success
04H: Retrans data of this window
Window Frame
Number
2 The begin frame number.
2.6Refer to the situation of DTU receiving, Down Command
0xDD04
Fields Length Description
Data Length 2 No para, the length is 00
2.7The End device response receiving situation, The Update
Command 0x5504
5
The response is the same to 0x5503.
Fields Length Description
Data Length 2 Total length of all the paras below
Window Frame
Number
2 Windows begin frame number.
2.8Stop the upgrade. The Down Command 0xDD05
Fields Length Description
Data Length 2 No para, the length is 1.
Stop reason type 1 01H: Upgrade success
02H: FLASH error
03H: Other reason.
2.9 Response To Stop Upgrade, Update Command 0x5505
Fields Length Description
Data Length 2 No para, the length is 00
2.10 Heart Command, The Update Command 0x55FF
Fields Length Description
Data Length 2 No para, the length is 00
2.11 The Response To Heart Command, The Down Command
0xDDFF
Fields Length Description
Data Length 2 No para, the length is 00

You might also like