Set Cycling Power Feature characteristic to advertise Cumulative Torque and Power Output

This commit is contained in:
Erik Brakkee 2026-06-06 18:35:00 +00:00
parent 13ea215996
commit de9ab0ca51

View File

@ -13,6 +13,8 @@ const (
bleCyclingPowerFeatureCharacteristic = 0x2A65 // BLE Cycling Power Feature characteristic
bleCyclingPowerMeasurementCharacteristic = 0x2A63 // BLE Cycling Power Measurement characteristic
bleSignalDetectedFlag = 0x20 // Signal Detected bit in BLE payload header
bleCyclingPowerFeatureCumulativeTorque = 0x01 // Cumulative Torque feature bit
bleCyclingPowerFeaturePowerOutput = 0x02 // Power Output feature bit
)
var adapter = bluetooth.DefaultAdapter
@ -34,7 +36,7 @@ func ExposeBluetooth(events <-chan Event) {
{
UUID: bluetooth.New16BitUUID(bleCyclingPowerFeatureCharacteristic),
Flags: bluetooth.CharacteristicReadPermission,
Value: []byte{0, 0, 0, 0},
Value: []byte{bleCyclingPowerFeatureCumulativeTorque | bleCyclingPowerFeaturePowerOutput, 0, 0, 0},
},
{
UUID: bluetooth.New16BitUUID(bleCyclingPowerMeasurementCharacteristic),