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: ADXL345 BLE_API mbed nRF51822
Fork of BLE_CycleSpeedCadence by
CyclingSpeedAndCadenceService Class Reference
BLE Service for Cycling Speed and Cadence. More...
#include <CyclingSpeedAndCadenceService.h>
Public Types | |
| enum | { LOCATION_OTHER, LOCATION_TOP_OF_SHOE, LOCATION_IN_SHOE, LOCATION_HIP, LOCATION_FRONT_WHEEL, LOCATION_LEFT_CRANK, LOCATION_RIGHT_CRANK, LOCATION_LEFT_PEDAL, LOCATION_RIGHT_PEDAL, LOCATION_FRONT_HUB, LOCATION_REAR_DROPOUT, LOCATION_CHAINSTAY, LOCATION_REAR_WHEEL, LOCATION_REAR_HUB, LOCATION_CHEST } |
Public Member Functions | |
| CyclingSpeedAndCadenceService (BLE &_ble, Mode _mode, uint8_t location) | |
| Constructor with initial counter values. | |
| void | updateWheelCounter (uint32_t wheelCounter, uint16_t eventTime) |
| Set a new value for wheel revolutions. | |
| void | updateCrankCounter (uint16_t crankCounter, uint16_t eventTime) |
| Set a new value for crank revolutions. | |
| virtual void | onDataWritten (const GattWriteCallbackParams *params) |
| This callback allows the CyclingSpeedAndCadenceService to receive updates to the controlPoint Characteristic. | |
Detailed Description
BLE Service for Cycling Speed and Cadence.
This BLE Service contains the location of the sensor, the total wheel revolutions, total crank revolutiosn.
Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.cycling_speed_and_cadence.xml
CSC Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.csc_measurement.xml
Location: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.sensor_location.xml
Definition at line 29 of file CyclingSpeedAndCadenceService.h.
Member Enumeration Documentation
| anonymous enum |
- Enumerator:
Definition at line 44 of file CyclingSpeedAndCadenceService.h.
Constructor & Destructor Documentation
| CyclingSpeedAndCadenceService | ( | BLE & | _ble, |
| Mode | _mode, | ||
| uint8_t | location | ||
| ) |
Constructor with initial counter values.
- Parameters:
-
ref] _ble Reference to the underlying BLE. [in] wheelCounter (32-bit) initial value for the wheel counter. [in] crankCounter (32-bit) initial value for the crank counter. [in] location Sensor's location.
Definition at line 80 of file CyclingSpeedAndCadenceService.h.
Member Function Documentation
| virtual void onDataWritten | ( | const GattWriteCallbackParams * | params ) | [virtual] |
This callback allows the CyclingSpeedAndCadenceService to receive updates to the controlPoint Characteristic.
- Parameters:
-
[in] params Information about the characterisitc being updated.
Definition at line 137 of file CyclingSpeedAndCadenceService.h.
| void updateCrankCounter | ( | uint16_t | crankCounter, |
| uint16_t | eventTime | ||
| ) |
Set a new value for crank revolutions.
- Parameters:
-
[in] crankCounter Total crank revolutions. [in] eventTime Time of event.
Definition at line 118 of file CyclingSpeedAndCadenceService.h.
| void updateWheelCounter | ( | uint32_t | wheelCounter, |
| uint16_t | eventTime | ||
| ) |
Set a new value for wheel revolutions.
- Parameters:
-
[in] wheelCounter Total wheel revolutions. [in] eventTime Time of event.
Definition at line 104 of file CyclingSpeedAndCadenceService.h.
Generated on Thu Jul 21 2022 09:23:01 by
1.7.2
