Python混合Garmin时间戳 [英] python mixing garmin timestamps
问题描述
我属于garmin手表,要报告统计他们有sdk在此SDK中,它们具有两种格式的时间戳一个是32位的真实时间戳另一个是16位的下半部分,必须与第一个
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
我不知道如何用Python编写代码
I dont know to code this in Python Can somebody help me
这是他们的解释和公式
* timestamp_16是timestamp字段的16位版本(32位),代表时间戳的低16位.该字段应与较早的时间戳字段结合使用,该时间戳字段用作高16位的参考.处理此字段的正确方法总结如下:
*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 ; *
我的问题不是获取两个时间戳,而是在python中合并两个
my problem is not to obtain the two timestamp but to combinate the two in python
谢谢
推荐答案
我不确定结果,但我从字面上解释了它们我将32位时间戳的位左移了16个位置然后我向右移动16位,并使用16位时间戳进行逐位或逐位
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
这篇关于Python混合Garmin时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!