mbed.org local branch of microbit-dal. The real version lives in git at https://github.com/lancaster-university/microbit-dal

Dependencies:   BLE_API nRF51822 mbed-dev-bin

Dependents:   microbit Microbit IoTChallenge1 microbit ... more

Embed: (wiki syntax)

« Back to documentation index

MicroBitTemperatureService Class Reference

MicroBitTemperatureService Class Reference

Class definition for the custom MicroBit Temperature Service. More...

#include <MicroBitTemperatureService.h>

Public Member Functions

 MicroBitTemperatureService (BLEDevice &_ble, MicroBitThermometer &_thermometer)
 Constructor.
void onDataWritten (const GattWriteCallbackParams *params)
 Callback.
void temperatureUpdate (MicroBitEvent e)
 Temperature update callback.

Detailed Description

Class definition for the custom MicroBit Temperature Service.

Provides a BLE service to remotely read the silicon temperature of the nRF51822.

Definition at line 44 of file MicroBitTemperatureService.h.


Constructor & Destructor Documentation

MicroBitTemperatureService ( BLEDevice &  _ble,
MicroBitThermometer _thermometer 
)

Constructor.

Class definition for the custom MicroBit Temperature Service.

Create a representation of the TemperatureService

Parameters:
_bleThe instance of a BLE device that we're running on.
_thermometerAn instance of MicroBitThermometer to use as our temperature source.

Provides a BLE service to remotely read the silicon temperature of the nRF51822. Constructor. Create a representation of the TemperatureService

Parameters:
_bleThe instance of a BLE device that we're running on.
_thermometerAn instance of MicroBitThermometer to use as our temperature source.

Definition at line 41 of file MicroBitTemperatureService.cpp.


Member Function Documentation

void onDataWritten ( const GattWriteCallbackParams *  params )

Callback.

Invoked when any of our attributes are written via BLE.

Definition at line 90 of file MicroBitTemperatureService.cpp.

void temperatureUpdate ( MicroBitEvent  e )

Temperature update callback.

Definition at line 78 of file MicroBitTemperatureService.cpp.