Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822
Fork of Bluetooth_Heart_Rate_Monitor_dummy by
Diff: CycleSpeedCadenceService.h
- Revision:
- 62:2ea9997b5249
- Parent:
- 61:16f888838853
- Child:
- 64:43e7ddf9dba5
--- a/CycleSpeedCadenceService.h Mon May 04 17:18:12 2015 +0000
+++ b/CycleSpeedCadenceService.h Mon May 04 21:55:15 2015 +0000
@@ -53,7 +53,8 @@
enum {
UUID_SENSOR_LOCATION_CHAR = 0x2A5D,
UUID_CSC_MEASUREMENT_CHAR = 0x2A5B,
- UUID_CSC_FEATURE_CHAR = 0x2A5C
+ UUID_CSC_FEATURE_CHAR = 0x2A5C,
+ UUID_CSC_CONTROL_POINT_CHAR = 0x2A55
};
@@ -78,7 +79,7 @@
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
cscFeatures(CycleSpeedCadenceService::UUID_CSC_FEATURE_CHAR, feautureBytes.getPointer()),
sensorLocation(CycleSpeedCadenceService::UUID_SENSOR_LOCATION_CHAR, &location),
- controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, &controlPointValue) {
+ controlPoint(CycleSpeedCadenceService::UUID_CSC_CONTROL_POINT_CHAR, &controlPointValue) {
setupService();
}
@@ -91,7 +92,7 @@
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
cscFeatures(CycleSpeedCadenceService::UUID_CSC_FEATURE_CHAR, feautureBytes.getPointer()),
sensorLocation(CycleSpeedCadenceService::UUID_SENSOR_LOCATION_CHAR, &location),
- controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, &controlPointValue) {
+ controlPoint(CycleSpeedCadenceService::UUID_CSC_CONTROL_POINT_CHAR, &controlPointValue) {
setupService();
}
@@ -104,7 +105,7 @@
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
cscFeatures(CycleSpeedCadenceService::UUID_CSC_FEATURE_CHAR, feautureBytes.getPointer()),
sensorLocation(CycleSpeedCadenceService::UUID_SENSOR_LOCATION_CHAR, &location),
- controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, &controlPointValue) {
+ controlPoint(CycleSpeedCadenceService::UUID_CSC_CONTROL_POINT_CHAR, &controlPointValue) {
setupService();
}
@@ -192,23 +193,23 @@
static const unsigned WHEEL_PRESENCE_BITNUM = 0;
static const uint8_t WHEEL_FLAG = (1 << WHEEL_PRESENCE_BITNUM);
- static const unsigned CADENCE_PRESENCE_BITNUM = 0;
+ static const unsigned CADENCE_PRESENCE_BITNUM = 1;
static const uint8_t CADENCE_FLAG = (1 << CADENCE_PRESENCE_BITNUM);
//speed
CSCValueBytes(uint32_t wheelRevolutions ,uint16_t wheelEvent) : valueBytes() {
- valueBytes[FLAGS_BYTE_INDEX] &= WHEEL_FLAG;
+ valueBytes[FLAGS_BYTE_INDEX] = WHEEL_FLAG;
updateWheel(wheelRevolutions,wheelEvent);
}
//cadence
CSCValueBytes(uint16_t crankRevolutions, uint16_t crankEvent ) : valueBytes() {
- valueBytes[FLAGS_BYTE_INDEX] &= CADENCE_FLAG;
+ valueBytes[FLAGS_BYTE_INDEX] = CADENCE_FLAG;
updateCrank(crankRevolutions,crankEvent);
}
//speed + cadence
CSCValueBytes(uint32_t wheelRevolutions ,uint16_t wheelEvent,uint16_t crankRevolutions, uint16_t crankEvent) : valueBytes() {
- valueBytes[FLAGS_BYTE_INDEX] &= (WHEEL_FLAG |CADENCE_FLAG);
+ valueBytes[FLAGS_BYTE_INDEX] = (WHEEL_FLAG |CADENCE_FLAG);
updateWheel(wheelRevolutions,wheelEvent);
updateCrank(crankRevolutions,crankEvent);
}
