rakha asyrofi / Mbed 2 deprecated BLE_CSCADXL345

Dependencies:   ADXL345 BLE_API mbed nRF51822

Fork of BLE_CycleSpeedCadence by Robert Walker

Embed: (wiki syntax)

« Back to documentation index

CyclingSpeedAndCadenceService Class Reference

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:
LOCATION_OTHER 

Other

LOCATION_TOP_OF_SHOE 

Top of shoe

LOCATION_IN_SHOE 

In shoe

LOCATION_HIP 

Hip

LOCATION_FRONT_WHEEL 

Front Wheel

LOCATION_LEFT_CRANK 

Left Crank

LOCATION_RIGHT_CRANK 

Right Crank

LOCATION_LEFT_PEDAL 

Left Pedal

LOCATION_RIGHT_PEDAL 

Right Pedal

LOCATION_FRONT_HUB 

Front Hub

LOCATION_REAR_DROPOUT 

Rear Dropout

LOCATION_CHAINSTAY 

Chainstay

LOCATION_REAR_WHEEL 

Rear Wheel

LOCATION_REAR_HUB 

Rear Hub

LOCATION_CHEST 

Chest

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]locationSensor'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]paramsInformation 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]crankCounterTotal crank revolutions.
[in]eventTimeTime 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]wheelCounterTotal wheel revolutions.
[in]eventTimeTime of event.

Definition at line 104 of file CyclingSpeedAndCadenceService.h.