Cycle speed and cadence example for the BLE API using nRF51822 native mode drivers
Dependencies: BLE_API mbed nRF51822
Fork of BLE_HeartRate by
Diff: CyclingSpeedAndCadenceService.h
- Revision:
- 74:98dee483c173
- Parent:
- 73:bae88c99c2ae
--- a/CyclingSpeedAndCadenceService.h Sun Aug 23 14:00:28 2015 +0000 +++ b/CyclingSpeedAndCadenceService.h Sun Aug 23 14:05:22 2015 +0000 @@ -28,10 +28,13 @@ */ class CyclingSpeedAndCadenceService { public: + static const uint8_t FLAG_WHEEL_PRESENT = (1 << 0); + static const uint8_t FLAG_CRANK_PRESENT = (1 << 1); + enum Mode { - MODE_SPEED, - MODE_CADENCE, - MODE_SPEED_CADENCE + MODE_SPEED = FLAG_WHEEL_PRESENT, + MODE_CADENCE = FLAG_CRANK_PRESENT, + MODE_SPEED_CADENCE = FLAG_WHEEL_PRESENT | FLAG_CRANK_PRESENT }; /** @@ -158,8 +161,6 @@ } protected: - static const uint8_t FLAG_WHEEL_PRESENT = (1 << 0); - static const uint8_t FLAG_CRANK_PRESENT = (1 << 1); static const uint16_t MAX_BYTES = (1 + 4 + 2 + 2 + 2); union SpeedCadenceValue {