Date Format, 2 + 2 bytes

Post questions and issues with Concept2 PM3 SDK
Post Reply
horseshoe7
Paddler
Posts: 15
Joined: April 21st, 2015, 6:28 am

Date Format, 2 + 2 bytes

Post by horseshoe7 » July 9th, 2015, 11:34 am

I'm parsing the data from some of the BTLE Characteristics, and am stumped with this (from BTLE Spec: http://www.concept2.com/files/pdf/us/mo ... nition.pdf)
Data bytes packed as follows:
Log Entry Date Lo,
Log Entry Date Hi,
Log Entry Time Lo,
Log Entry Time Hi,
How am I supposed to parse this? What's the format? It doesn't seem to be UNIX, nor MSDOS. Does anyone know??

User avatar
Citroen
SpamTeam
Posts: 8049
Joined: March 16th, 2006, 3:28 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Date Format, 2 + 2 bytes

Post by Citroen » July 9th, 2015, 12:11 pm

If it works like the old *LCB files then it's a modified version of BCD

Code: Select all

   DateH     DateL     TimeH    TimeL
 00011101 10010100   00010000 00001001 
 0001110 11001 0100  000 10000 0000 1001 
     14   25    4        16    0    9
For a date 25th April 2014 @ 16:09 (4:09pm)

horseshoe7
Paddler
Posts: 15
Joined: April 21st, 2015, 6:28 am

Re: Date Format, 2 + 2 bytes

Post by horseshoe7 » July 9th, 2015, 2:29 pm

Thanks that's exactly how it works!!

Took me a while with all the bit-shifting nonsense, but I finally got it parsed.

Post Reply