问题
I belong a garmin watch , to report statistic they have a sdk in this SDK they have a timestamp in two format one is a true timestamp on 32 bit another is the lower part on 16 bit which must be combinate whith the first
I dont know to code this in Python Can somebody help me
here is their explanation and the formula
*timestamp_16 is a 16 bit version of the timestamp field (which is 32 bit) that represents the lower 16 bits of the timestamp. This field is meant to be used in combination with an earlier timestamp field that is used as a reference for the upper 16 bits. The proper way to deal with this field is summarized as follows:
mesgTimestamp += ( timestamp_16 - ( mesgTimestamp & 0xFFFF ) ) & 0xFFFF;*
my problem is not to obtain the two timestamp but to combinate the two in python
thanks
回答1:
I'm not sure of the result but I took them literally explanation I shifted 32-bit timestamps of bits left 16 positions then I shifted 16 places to the right and I made one or bitwise with the 16-bit timestamp
来源:https://stackoverflow.com/questions/39015119/python-mixing-garmin-timestamps