Set Cycling Power Feature characteristic to advertise Cumulative Torque and Power Output
This commit is contained in:
parent
13ea215996
commit
de9ab0ca51
@ -13,6 +13,8 @@ const (
|
|||||||
bleCyclingPowerFeatureCharacteristic = 0x2A65 // BLE Cycling Power Feature characteristic
|
bleCyclingPowerFeatureCharacteristic = 0x2A65 // BLE Cycling Power Feature characteristic
|
||||||
bleCyclingPowerMeasurementCharacteristic = 0x2A63 // BLE Cycling Power Measurement characteristic
|
bleCyclingPowerMeasurementCharacteristic = 0x2A63 // BLE Cycling Power Measurement characteristic
|
||||||
bleSignalDetectedFlag = 0x20 // Signal Detected bit in BLE payload header
|
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
|
var adapter = bluetooth.DefaultAdapter
|
||||||
@ -34,7 +36,7 @@ func ExposeBluetooth(events <-chan Event) {
|
|||||||
{
|
{
|
||||||
UUID: bluetooth.New16BitUUID(bleCyclingPowerFeatureCharacteristic),
|
UUID: bluetooth.New16BitUUID(bleCyclingPowerFeatureCharacteristic),
|
||||||
Flags: bluetooth.CharacteristicReadPermission,
|
Flags: bluetooth.CharacteristicReadPermission,
|
||||||
Value: []byte{0, 0, 0, 0},
|
Value: []byte{bleCyclingPowerFeatureCumulativeTorque | bleCyclingPowerFeaturePowerOutput, 0, 0, 0},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
UUID: bluetooth.New16BitUUID(bleCyclingPowerMeasurementCharacteristic),
|
UUID: bluetooth.New16BitUUID(bleCyclingPowerMeasurementCharacteristic),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user