Firmware Upload - Example; Binary Data To Ascii Data Function - DekTec DTM-3200 User Manual

Oem ts-over-ip converter
Table of Contents

Advertisement

DTM-3200 – OEM Ethernet TSoIP Converter
User Manual
4.5.2 Firmware upload – Example
If a file consisting of 1000 bytes must be sent in packets of 150 data-bytes, there are going to be
parts. The first six parts are 150 bytes long and the last part consists of 100 bytes. The table belo
shows the content of the communication messages. Each line represents a message and the lines
are shown in chronological order.
Category
(hex)
Abort
80
Reply
80
Number of parts
80
Reply
80
Part size
80
Reply
80
Remaining
80
Reply
80
File part
80
Reply
80
File part
80
Reply
80
File part
80
Reply
80
File part
80
Reply
80
File part
80
Reply
80
File part
80
Reply
80
File part
80
Reply
80
Update device
80
Reply
80
Progress
80
Reply
80
Progress
80
Reply
80
Progress
80
Reply
80
Error
80
Reply
80

4.5.3 Binary data to Ascii data function

To convert the program data (File bytes) to ASCII the following function could be used.
unsigned int BinToAsc128(unsigned char* bin_data, unsigned int len, char* returnData)
{
unsigned int bytes_todo, i;
bytes_todo = len;
while(bytes_todo > 0)
Setting
Read/write
(hex)
(I
C / RS-XXX)
2
04
00 / 'W'
04
00 / 'W'
07
00 / 'W'
07
00 / 'W'
08
00 / 'W'
08
00 / 'W'
09
00 / 'W'
09
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
02
00 / 'W'
03
00 / 'W'
03
00 / 'W'
05
01 / 'R'
05
01 / 'R'
05
01 / 'R'
05
01 / 'R'
05
01 / 'R'
05
01 / 'R'
06
01 / 'R'
06
01 / 'R'
31
Index
Data
(hex)
0000 1 (0x01)
0000 1 (0x01)
0000 7 (0x07)
0000 7 (0x07)
0000 150 (0x96)
0000 150 (0x96)
0000 100 (0x64)
0000 100 (0x64)
0001 File bytes: 0 - 149
0001 1 (0x0001)
0002 File bytes: 150 - 299
0002 2 (0x0002)
0003 File bytes: 300 - 449
0003 3 (0x0003)
0004 File bytes: 450 - 599
0004 4 (0x0004)
0005 File bytes: 600 - 749
0005 5 (0x0005)
0006 File bytes: 750 - 899
0006 6 (0x0006)
0007 File bytes: 900 - 999
0007 7 (0x0007)
0000 1
0000 –
0000 –
0000 50 (0x00)
0000 –
0000 50 (0x32)
0000 –
0000 100 (0x64)
0000 –
0000 0 (0x00)
Description
Update
at 0%
Update
at 50%
Update
at 100%
Update
successful

Advertisement

Table of Contents
loading

Related Products for DekTec DTM-3200

Table of Contents