首页 > 解决方案 > AmazFit Bip 手表 - 心率

问题描述

我想AmazFit Bip Watch在我自己的应用程序中显示心率值。

UUID:

00002a37-0000-1000-8000-00805f9b34fb

样本字节数组:

byte[0] = 0
byte[1] = 70

来自字节数组的计算值:

if (value.length == 2 && value[0] == 0) {
    final int hrValue = (value[1] & 0xff);
}

问:无论我在手表上看到什么,我都没有得到正确的值。我想在我的应用程序中看到我在手表中看到的确切值。我已经提到了 Gadgetbridge项目。


任何帮助将不胜感激。

标签: androidbluetooth-lowenergy

解决方案


尝试以下任何代码:

Byte b = byte[1];
final int hrValue = b.intValue();

或使用 Byte 构造函数,如下所示:

Byte b = new Byte(byte[1]);
final int hrValue = b.intValue();

感谢byte to int


推荐阅读