Overview
Fig1: State machine of transfer data services.
Fig2: Download states.
For details on the write services see DataRecordIDs.
Up- or Download of data
Transfer Data Download Example
A data block shall be downloaded with the size of 0x110 bytes. The parameters for this download are:
- RecordID: 0xCAFE
- Parameter: 0x02
- SenderNodeID (SID): 0x123
- ReceiverNodeID (RID): 0x456
-> [WD, SID:123, RID:456] 0xCA 0xFE 0x02
Write Data: start download service, parameter 0x02
<- [RE, SID:456, RID:123] 0xCA 0xFE
Response: download accepted and ready
-> [WD, SID:123, RID:456] 0xFF 0x10 0x01 0x00 0x00
Write Data: init transfer data service, length 0x100, encoding RAW
<- [WD, SID:456, RID:123] 0xFF 0x10 0x01 0x00
Response: transfer data accepted and ready, max. block size 0x100
-> [TD, SID:123] 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
Transfer Data: data download #0
-> [Repeated download messages 1..30]
-> [TD, SID:123] 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
Transfer Data: data download #0
<- [RE, SID:456, RID:123]
Response: data block accepted, ready for more
-> [TD, SID:123] 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
Transfer Data: data download #1
-> [TD, SID:123] 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
Transfer Data: data download #1
<- [RE, SID:456, RID:123]
Response: data block accepted, all data transfered, download finishedRun Length Encoding (RLE Compression)
The run length encoding is used to compress data streams with repeating patterns of the same binary data. For example flash data usually has free areas are filled with the same pattern, which can be reduced in size.
A data stream of identical byte values like 'FF FF FF FF FF FF' can be coded as a pattern of 'AA 06 FF' where 'AA' is the so called keyword to mark a coded sequence, '06' is the length of the coded stream and 'FF' is the repeated binary value.
In case the keyword 'AA' exists in the binary file it still can be transmitted using a coded representation 'AA 01 AA'.
Specification:
| Dn | Dn+1 | Dn+2 |
| 0xAA | length | bin |