android - 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项目。
任何帮助将不胜感激。
解决方案
尝试以下任何代码:
Byte b = byte[1];
final int hrValue = b.intValue();
或使用 Byte 构造函数,如下所示:
Byte b = new Byte(byte[1]);
final int hrValue = b.intValue();
推荐阅读
- angular - 可观察的单元测试在它应该失败时通过
- json - 通过 Get Data 从 Post Data 中获取 URI
- istio - 显示界面 Prometheus
- java - 如何编写每周自动更改变量值的代码?
- ffmpeg - 在为歌曲编写缩略图时,我的 FFMPEG 引发了我意想不到的错误
- sql - Laravel 显示错误拒绝用户访问
- svg - 在错误的坐标中绘制翻译路径
- database - 应如何管理 DB 实体 ID 以有效地避免安全风险?
- xamarin - 在 Xamarin 中删除对 Application 类的依赖
- azure - 将 Azure SSL 证书用于对讲帮助中心