python mixing garmin timestamps

╄→尐↘猪︶ㄣ 提交于 2020-03-03 09:07:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!