Yon*_*kee 5 bluetooth dart bluetooth-lowenergy
我有一段时间与BLE合作,但主要是为了阅读和通知特性。
这些设备特别是支持GATTS自行车动力服务的虚拟自行车训练器-0x1818 链接
我知道可以增加此教练机的阻力,但是我已经阅读了有关循环功率控制点-0x2A66 [link] [2]的文档,这是唯一具有强制写入功能的文档,但是似乎没有文档感。
培训师:Cyclopop Magnus
读写特点
// Reads all characteristics
var characteristics = service.characteristics;
for(BluetoothCharacteristic c in characteristics) {
List<int> value = await device.readCharacteristic(c);
print(value);
}
// Writes to a characteristic
await device.writeCharacteristic(c, [0x12, 0x34])
Run Code Online (Sandbox Code Playgroud)
读写描述符
// Reads all descriptors
var descriptors = characteristic.descriptors;
for(BluetoothDescriptor d in descriptors) {
List<int> value = await device.readDescriptor(d);
print(value);
}
// Writes to a descriptor
await device.writeDescriptor(d, [0x12, 0x34])
Run Code Online (Sandbox Code Playgroud)
我能看到的最接近的位置是曲柄长度或链条重量,但是在这个阶段,我只是猜测,正在寻找一些指导。
问题是这个。
我应该使用什么特征或描述符来调整Virtual Power训练器的电阻,什么是最好的方法?
任何编码语言都可以,我可以将其转置。
设备可用服务的屏幕截图
[2]:https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile = org.bluetooth.characteristic.cycling_power_control_point.xml
我认为您为此使用了错误的蓝牙服务。自行车功率服务用于从自行车功率计收集数据,如下所示: https: //www.cyclist.co.uk/reviews/6705/long-term-review-fsa-powerbox-carbon-power-cranks
根据您的要求,我相信您应该使用健身机服务(0x1826),其中包括室内自行车数据特征(0x2AD2),对您来说最重要的是健身机控制点特征。查看健身机器服务规范的第 4.16.1 节,您将看到控制点支持的操作的详细信息,包括对 4.16.2.5 设置目标阻力水平程序的引用。我想这就是你所需要的。