Fork of BLE_SecureHeartRate : should this 'work' i.e. require a secure connection on an nRF51-DK? Hopefully I'm just missing something obvious - or is this broken?

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_SecureHeartRate by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

HeartRateSecService Class Reference

HeartRateSecService Class Reference

BLE Service for HeartRate. More...

#include <HeartRateSecService.h>

Public Types

enum  {
  LOCATION_OTHER = 0, LOCATION_CHEST, LOCATION_WRIST, LOCATION_FINGER,
  LOCATION_HAND, LOCATION_EAR_LOBE, LOCATION_FOOT
}

Public Member Functions

 HeartRateSecService (BLE &_ble, uint8_t hrmCounter, uint8_t location)
 Constructor with 8bit HRM Counter value.
 HeartRateSecService (BLE &_ble, uint16_t hrmCounter, uint8_t location)
 Constructor with a 16-bit HRM Counter value.
void outputSecurityStatus (Gap::Handle_t handle)
void updateHeartRate (uint8_t hrmCounter)
 Set a new 8-bit value for heart rate.
void updateHeartRate (uint16_t hrmCounter)
 Set a new 16-bit value for heart rate.
virtual void onDataWritten (const GattWriteCallbackParams *params)
 This callback allows the HeartRateSecService to receive updates to the controlPoint Characteristic.

Detailed Description

BLE Service for HeartRate.

This BLE Service contains the location of the sensor, the heartrate in beats per minute.
Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml
HRM Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml
Location: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml

Definition at line 29 of file HeartRateSecService.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
LOCATION_OTHER 

Other Location

LOCATION_CHEST 

Chest

LOCATION_WRIST 

Wrist

LOCATION_FINGER 

Finger

LOCATION_HAND 

Hand

LOCATION_EAR_LOBE 

Earlobe

LOCATION_FOOT 

Foot

Definition at line 35 of file HeartRateSecService.h.


Constructor & Destructor Documentation

HeartRateSecService ( BLE &  _ble,
uint8_t  hrmCounter,
uint8_t  location 
)

Constructor with 8bit HRM Counter value.

Parameters:
ref]_ble Reference to the underlying BLEDevice.
[in]hrmCounter(8-bit) initial value for the hrm counter.
[in]locationSensor's location.

Definition at line 56 of file HeartRateSecService.h.

HeartRateSecService ( BLE &  _ble,
uint16_t  hrmCounter,
uint8_t  location 
)

Constructor with a 16-bit HRM Counter value.

Parameters:
[in]_bleReference to the underlying BLEDevice.
[in]hrmCounter(8-bit) initial value for the hrm counter.
[in]locationSensor's location.

Definition at line 77 of file HeartRateSecService.h.


Member Function Documentation

virtual void onDataWritten ( const GattWriteCallbackParams *  params ) [virtual]

This callback allows the HeartRateSecService to receive updates to the controlPoint Characteristic.

Parameters:
[in]paramsInformation about the characterisitc being updated.

Definition at line 161 of file HeartRateSecService.h.

void outputSecurityStatus ( Gap::Handle_t  handle )

< The link is not secured.

< Link security is being established.

Definition at line 110 of file HeartRateSecService.h.

void updateHeartRate ( uint16_t  hrmCounter )

Set a new 16-bit value for heart rate.

Parameters:
[in]hrmCounterHeartRate in bpm.

Definition at line 149 of file HeartRateSecService.h.

void updateHeartRate ( uint8_t  hrmCounter )

Set a new 8-bit value for heart rate.

Parameters:
[in]hrmCounterHeartRate in bpm.

Definition at line 138 of file HeartRateSecService.h.