首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >六进制十进制解释

六进制十进制解释
EN

Stack Overflow用户
提问于 2017-01-03 05:53:27
回答 1查看 41关注 0票数 0

我正试图用蓝牙将计步器手表连接到我的手机上,并希望从它读到我制作的应用程序中的步骤。连接成功,我能够从手表读取数据,但我不太清楚如何解释它。

下面是文件,

特征值内容:

代码语言:javascript
复制
(1) all the eigenvalue content inside the endian order are small endian order.

(2) current_pedometer_measurement
    The value of the current_pedometer_measurement consists of four parts
    Value type description
    Flag Uint8 0x01: Number of Steps (Required)
    0x02: Distance (optional)
    0x04: Calories (optional)
    Such as 0x05 that contains the number of steps and calories
    StepCount Uint24 The number of steps
    StepDistancer Uint24 How far, in meters
    StepCalorie Uint24 calories

    Description:

    1.  Distance and calories are optional, may or may not appear
        If only the number of steps, then the value is: 01 (steps) 10 27 00 (1 million steps)
        If there are steps and distances, then the value is: 03 (number of steps, distance) 10 27 00 (1 million steps) 70 17 00 (6 km)
        Other cases and so on.
    2.  Time value to mobile phone time as the standard, that is, the moment the phone receives the data that is the time of this data.

(3) target

    The target value is
    Value type description
    Flag Uint8 0x01: Number of Steps (Required)
    StepCount Uint24 The number of steps

    Description:
    1. If the target is 10,000 steps, then the value is: 01 (steps) 10 27 00 (1 million steps)
    2. If the device writes to the target value, the device is updated. If the device updates the target value, notify the phone.

我从计步器表上得到的读数是:

代码语言:javascript
复制
[7, 64, 1, 0, 144, 0, 0, 24, 0, 0]

有人能帮我解释一下吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-07 16:21:21

数据似乎与你的描述完全一致。第一个字节是标志字段,在本例中,它指示正在报告所有3种度量类型。或比特1、2和3等于7。

接下来的9个字节是3个24位数据值,其中64,1,0是步骤,144,0是距离,24,0是卡路里。如何转换字节有点令人费解,但是如果您使用小endian格式并假设您以十进制方式打印它们,那么这些值是否有意义?

步骤:0001 64 = 0x000140 = 320距离:00144= 0x000090 = 144卡路里:0024=0x0018= 24

从上面的例子来看,这些值可能是十六进制的:

102700= 0x002710 = 10000 701700= 0x001770 = 6000

希望这能帮上忙!

格蕾丝

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41437237

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档