首页 > 解决方案 > BLE 通信协议 T1S (Smart Band) 获取数据

问题描述

我想将我的android应用程序与这个智能手环(T1S)通信,我已经配对了,但我不知道如何从中提取数据,例如温度等。我从中获得了特征和服务:

{"name":"T1S","id":"F4:C3:33:99:21:5D","advertising":{},"rssi":-78,"services":["1801", "1800","6e400001-b5a3-f393-e0a9-e50e24dcca9e","1812","fee7"],"characteristics":[{"service":"1801","characteristic":"2a05","properties" :["Broadcast","Read","Write","Notify","Indicate","AuthenticateSignedWrites"],"descriptors":[{"uuid":"2902"}]},{"service":" 1800","characteristic":"2a00","properties":["Read"]},{"service":"1800","characteristic":"2a01","properties":["Read"]}, {"服务":"1800","characteristic":"2a02","properties":["Read"]},{"service":"1800","characteristic":"2a04","properties":["Read "]},{"service":"1800","characteristic":"2aa6","properties":["Read"]},{"service":"6e400001-b5a3-f393-e0a9-e50e24dcca9e","特征":"6e400003-b5a3-f393-e0a9-e50e24dcca9e","属性":["通知"],"描述符":[{"uuid":"2902"}]},{"服务":"6e400001- b5a3-f393-e0a9-e50e24dcca9e","特征":"6e400002-b5a3-f393-e0a9-e50e24dcca9e","属性":["WriteWithoutResponse","Write"]},{"服务":"1812","特征":"2a4e","属性":["Read","WriteWithoutResponse"]},{"服务":"1812","特征":"2a4d","属性" :["Read","Write","Notify"],"descriptors":[{"uuid":"2902"},{"uuid":"2908"}]},{"service":"1812" ,"特征":"2a4d","属性":["读取","写入","通知"],"描述符":[{"uuid":"2902"},{"uuid":"2908" }]},{"service":"1812","characteristic":"2a4d","properties":["Read","Write","Notify"],"descriptors":[{"uuid":"2902"},{"uuid":"2908"}]},{"service":"1812","characteristic":"2a4b","properties":["Read"]} ,{"service":"1812","characteristic":"2a33","properties":["Read","Write","Notify"],"descriptors":[{"uuid":"2902"} ]},{"service":"1812","characteristic":"2a4a","properties":["Read"]},{"service":"1812","characteristic":"2a4c","properties ":["WriteWithoutResponse"]},{"service":"fee7","characteristic":"fec9","properties":["Read","Notify"],"descriptors":[{"uuid":"2902"}]},{"service":"fee7","characteristic":"fea1","properties":["Read","Indicate"],"descriptors":[{ "uuid":"2902"}]},{"service":"fee7","characteristic":"fea2","properties":["Read","Write","Indicate"],"descriptors": [{"uuid":"2902"}]}]}"指示"],"描述符":[{"uuid":"2902"}]}]}"指示"],"描述符":[{"uuid":"2902"}]}]}

我分析了另一个 android 应用程序,我用这个智能手环和我的手机用 Wireshark 和蓝牙日志捕获接收和发送的蓝牙数据,以了解传输哪些数据或协议来获取温度,我确信温度的响应是:

0000 02 02 20 14 00 10 00 04 00 1b 12 00 ab 00 0a ff .................. 0010 51 13 14 06 05 06 37 24 05
Q.....7 美元.

在此处输入图像描述

但我不知道如何将此响应转换为以 C° 为单位的实际温度,有人知道如何从这个智能手环中提取真实数据吗?

提前致谢。

在此处输入图像描述

智能手环链接: https ://www.alibaba.com/product-detail/Cheap-High-Quantity-Bluetooth-Smart-Bracelet_1600057978967.html?spm=a2700.icbuShop.111720.6.54226ef9FPTgvq

标签: ionic-frameworkbluetoothhexbluetooth-lowenergy

解决方案


const readCharacteristic = await device.readCharacteristicForService(userDataServiceUUID, heightCharacteristicUUID); // assuming the device is already connected
const heightInCentimeters = Buffer.from(readCharacteristic.value, 'base64').readUInt16LE(0);

https://github.com/Polidea/react-native-ble-plx/wiki/=--FAQ:-Passing-And-Retrieving-Of-Characteristic-Value


推荐阅读