Author Topic: What's This Format?  (Read 3945 times)

Frederic Bergeron

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://
What's This Format?
« on: August 18, 2007, 10:58:23 pm »
Hi,

When I go to the gym, I took the habit of keeping some data like my blood pressure, pulse and weight.  I store the data using the Database application that came with my Zaurus.  The About dialog says : "Database Ver 1.1.3 - © 2003 Sharp Corporation".  

Now I'm considering to use another database program so I would like to export my data.  There is an option to export to a CSV file.  It works but I don't know how the float number data is encoded.

Code: [Select]
"T","attribute","created time","modified time","sync id","category","date","pressureHigh","pressureLow","pulse","weight"
"D"," ","20061106091718","20061106091718","00000001",,"20061106      ","1a0a9lL0LLL0LLL0LLL0","1;0alLLKLLL0LLL0LLL0","1;0auLLKLLL0LLL0LLL0","1;0anLLSLLL0LLL0LLL0"

So this means that :

1a0a9lL0LLL0LLL0LLL0 = 122
1;0alLLKLLL0LLL0LLL0 = 60
1;0auLLKLLL0LLL0LLL0 = 69
1;0anLLSLLL0LLL0LLL0 = 62.8

What's this format?  Anyone has a clue about the transformation I need to do to "1a0a9lL0LLL0LLL0LLL0" to get "122"?
toMOTko Flashcard Project
SL-C1000 Sharp ROM

sdjf

  • Sr. Member
  • ****
  • Posts: 447
    • View Profile
    • http://www.sdjf.wordpress.com and http://www.sdjf.esmartdesign.com
What's This Format?
« Reply #1 on: August 19, 2007, 03:24:19 am »
Not an expert on this sort of thing, but you might look at documentation around the web for the "od" (octal dump) command that IIRC talks about various format options.

It is included in the arm utilities package:
http://quickening.zapto.org/ZaurusFeed/Non-IPKs/armutils.tgz

May not work if the C1000 isn't an arm processor, but there should be other flavors around, it's a classic.

sdjf
http://www.sdjf.esmartdesign.com
http://www.sdjf.wordpress.com
-----------------
sl5500 running Sharp ROM 2.38 (dead batteries)
sl6000L running Sharp ROM 1.12 (still working)
Opera 7.25 and 7.30
Socket CF 56k modem
3Com USB Ethernet Adapter
Toshiba, Lexar and Kingston SD cards
Lexar, Kingston and Transcend CF cards

dhns

  • Hero Member
  • *****
  • Posts: 699
    • View Profile
    • http://www.goldelico.com
What's This Format?
« Reply #2 on: August 19, 2007, 06:37:03 am »
Quote
1a0a9lL0LLL0LLL0LLL0 = 122
1;0alLLKLLL0LLL0LLL0 = 60
1;0auLLKLLL0LLL0LLL0 = 69
1;0anLLSLLL0LLL0LLL0 = 62.8

What's this format?  Anyone has a clue about the transformation I need to do to "1a0a9lL0LLL0LLL0LLL0" to get "122"?
No idea what it really is. But some observations:

Looks like 20 ASCII characters are used to encode a float.
Could therefore be something like base64 using a 5:4 code (i.e. each 4x4 bits give 5 characters)

Binary would be
122 = 0.953125 * 2^7 = 0.1110100100000000000 exp 000111
60 = 0.9375 * 2^6 = 0.11110000000000000 exp 000110
69 = 0.5390625 * 2^7 = 0.100001001000000000 exp 000111
62.8 = 0.98125 * 2^6 = 0.111110110011001100110011001100110011... exp 000110

Ok, 62.8 is an infinite fraction in Binary float, => your format is most probably a Decimal representation.

1a0a => exponent 10^2
    Mantissa 1.22 -> 9IL0
1;0a => exponent 10^1
    Mantissa 6.0 -> ILLK and 6.9 ULLK and 6.28 NLLS

If you find two values that differ by 1 only (e.g. 60 and 61) you can see which bit changes.

-- hns
« Last Edit: August 19, 2007, 06:38:30 am by dhns »
SL5500G, C860, C3100, WLAN, RTM8000, Powerbook G4, and others...
http://www.handheld-linux.com
http://www.quantum-step.com