Pull request for i.a. sensor buffer template

Dependencies:   BLE_API MPU6050 mbed nRF51822

Embed: (wiki syntax)

« Back to documentation index

TemperatureService Class Reference

TemperatureService Class Reference

BLE Temperature Service. More...

#include <TemperatureService.h>

Public Member Functions

 TemperatureService (BLE &_ble, int16_t temperature=200)
void updateTemperature (int16_t newTemp)
 Update the temperature with a new value.

Protected Attributes

BLE & ble
 A reference to the underlying BLE instance that this object is attached to.
int16_t temperature
 The current temperature represented as 0.1 degrees Celsius.
ReadOnlyGattCharacteristic
< int16_t > 
temperatureCharacteristic
 A ReadOnlyGattCharacteristic that allows access to the peer device to the temperature value through BLE.

Detailed Description

BLE Temperature Service.

This service displays the temperature, represented as an 16bit number.

Definition at line 14 of file TemperatureService.h.


Constructor & Destructor Documentation

TemperatureService ( BLE &  _ble,
int16_t  temperature = 200 
)
Parameters:
[in]_bleBLE object for the underlying controller.
[in]temperature16bit temperature in 0.1 degrees Celsius

Definition at line 22 of file TemperatureService.h.


Member Function Documentation

void updateTemperature ( int16_t  newTemp )

Update the temperature with a new value.

Valid values lie between -2732 and above.

Parameters:
newTempUpdate to temperature.

Definition at line 39 of file TemperatureService.h.


Field Documentation

BLE& ble [protected]

A reference to the underlying BLE instance that this object is attached to.

The services and characteristics will be registered in this BLE instance.

Definition at line 50 of file TemperatureService.h.

int16_t temperature [protected]

The current temperature represented as 0.1 degrees Celsius.

Definition at line 55 of file TemperatureService.h.

ReadOnlyGattCharacteristic<int16_t> temperatureCharacteristic [protected]

A ReadOnlyGattCharacteristic that allows access to the peer device to the temperature value through BLE.

Definition at line 60 of file TemperatureService.h.