26
Data structure
Data is saved to fl ash in the following format. Byte order is least signifi cant byte fi rst (little-endian)
Every packet has a header which informs where the packet footer is and also packet footer informs
where packet header is, so data is organized as a two way linked list.
There are 3 kinds of packets and every packet has a recognition byte which tell the type of a pack-
et.
Processed data:
Length-1
1 byte
Time
4 bytes
0xA0
1 byte
ID
2 bytes
Value / Float
4 bytes
Length-1
1 byte
Length gives size of the record including header and footer.
Unprocessed data:
Length-1
1 byte
Time
4 bytes
0xA1
1 byte
ID
2 bytes
Device type
1 byte
Data
0-7 bytes
Length-1
1 byte
Data is dependent on device type and its not described in this manual. Device specifi c data is avail-
able on request if needed.
Interval logged data:
Length-1
1 byte
Time
4 bytes
0xA2
1 byte
ID
2 bytes
Value / Float
4 bytes
ID
2 bytes
Value / Float
4 bytes
Length-1
1 byte
Interval logged data has ID-value pairs N times, and total length or record can not exceed 255
bytes.
Zero padding
Data can contain 0 size packets because there are sector synchronizations and write error fi xes. But
data packet which header and footer are both 0 is totally eligible and need no special rules, since it
can be processed with same jumping rules as normal packets.
Time format
Time is presented with 4 bytes, with following bit fi elds, least signifi cant byte fi rst.
msbit
Year
6 bits
00-63
Month
4 bits
1-12
Day
5 bits
1-31
Hour
5 bits
0-23
Minutes
6 bits
0-59
Seconds
6 bits
0-59