我有一個二進制文件,其內容定義如下:(所有數據以小端(即最低有效字節在前)存儲 )。下面的例子數字是十六進制十六進制和十進制轉換
11 63 39 46 --- Time, UTC in seconds since 1 Jan 1970.
01 00 --- 0001 = No Fix, 0002 = SPS
97 85 ff e0 7b db 4c 40 --- Latitude, as double
a1 d5 ce 56 8d 26 28 40 --- Longitude, as double
f0 37 e1 42 --- Height in meters, as float
fe 2b f0 3a --- Speed in km/h, as float
00 00 00 00 --- Heading (degrees ?), as float
01 00 --- RCR, log reason. 0001=Time, 0004=Distance
59 20 6a f3 4a 26 e3 3f --- Distance in meters, as double,
2a --- ? Don't know
a8 --- Checksum, xor of all bytes above not including 0x2a
從「十六進制」二進制文件中的數據如下
"F25D39460200269652F5032445401F4228D79BCC54C09A3A2743B4ADE73F2A83"
我很感激,如果你可以根據之前的指令支持我這個數據線轉換。
儘管指令的格式不正確,但內容似乎很清楚(當然除了倒數第二個字節)。描述中有什麼具體問題? – 6502 2010-12-12 21:17:43