thanks for your answer, Thorsten.
Unfortunately I’m still struggling with the byte-decoding.
The syx2asm.pl script produces the correct output: the first byte is 0x04, which is fine, because it’s the version compatibility info for v0.4 (see attached code snippets and ACSensorizer Patch Description)
- however, if I use the suggested dec2bin/bin2dec method, I get a wrong result:
convert the decimal value of each 8bit byte into binary strings, and concatenate them one after another to a long, new string. Thereafter split the string into chunks of 7 characters, and convert back binary->decimal to get the 7bit value.
So in my case:[tt]
0x12 = ‘0001 0010’
’ 000 1001’ = 0x09[/tt]
but 0x09 is not the 0x04 I was hoping to for 
I get the feeling, I’m missing something pretty obvious…
Best Regards,
Michael
0: f0 00 00 7e 40 00 02 40 00 01 00 02 12 6a 32 69 ...~@..@.....j2i
16: 54 5e 30 1c 4c 06 00 00 00 00 00 00 00 0c 40 00 T^0.L.........@.
32: 00 00 00 00 00 60 18 0c 06 03 01 00 00 00 00 00 .....`..........
48: 00 02 02 01 41 00 50 30 1c 00 00 00 00 02 41 20 ....A.P0......A
64: 50 28 07 03 01 60 40 20 10 08 04 00 00 00 00 00 P(...`@ ........
80: 00 00 00 00 00 00 00 00 00 10 08 04 02 00 20 10 .............. .
96: 08 04 01 00 40 20 40 00 00 00 00 00 00 00 00 04 ....@ @.........
(...)
[/code]
[code=syx2asm.pl asm-output ----- this is correct]org 0x400000
db 0x04, 0x4b, 0x53, 0x2d, 0x35, 0x2f, 0x30, 0x39 ;; (0x400000)
db 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ;; (0x400008)
db 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01 ;; (0x400010)
db 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00 ;; (0x400018)
db 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 ;; (0x400020)
db 0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x14 ;; (0x400028)
db 0x07, 0x06, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04 ;; (0x400030)
and here the output from my calculations:
0: 12 6a 32 69 54 5e 30 1c 4c 06 00 00 00 00 00 00 .j2iT^0.L.......
16: 00 0c 40 00 00 00 00 00 00 60 18 0c 06 03 01 00 ..@......`......
32: 00 00 00 00 00 02 02 01 41 00 50 30 1c 00 00 00 ........A.P0....
48: 00 02 41 20 50 28 07 03 01 60 40 20 10 08 04 00 ..A P(...`@ ....
64: 00 00 00 00 00 00 00 00 00 00 00 00 00 10 08 04 ................
80: 02 00 20 10 08 04 01 00 40 20 40 00 00 00 00 00 .. .....@ @.....
96: 00 00 00 04 66 1f 10 46 40 00 00 02 48 04 02 01 ....f..F@...H...
[/code]
[code=Binary representation]
0: 30 30 30 31 30 30 31 30 30 31 31 30 31 30 31 30 0001001001101010
16: 30 30 31 31 30 30 31 30 30 31 31 30 31 30 30 31 0011001001101001
32: 30 31 30 31 30 31 30 30 30 31 30 31 31 31 31 30 0101010001011110
48: 30 30 31 31 30 30 30 30 30 30 30 31 31 31 30 30 0011000000011100
64: 30 31 30 30 31 31 30 30 30 30 30 30 30 31 31 30 0100110000000110
80: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
96: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
0: 09 12 24 49 13 26 4d 1a 35 6a 54 28 51 23 46 0c ..$I.&M.5jT(Q#F.
16: 19 32 64 49 13 26 4d 1a 34 69 52 25 4a 15 2a 55 .2dI.&M.4iR%J.*U
32: 2a 54 28 51 22 45 0b 17 2f 5e 3c 78 71 63 46 0c *T(Q"E../^<xqcF.
48: 18 30 60 40 00 01 03 07 0e 1c 38 71 62 44 09 13 .0`@......8qbD..
64: 26 4c 18 30 60 40 00 01 03 06 0c 18 30 60 40 00 &L.0`@......0`@.
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
96: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[/code]