BLE temperature profile using digital DS1820 or analog LM35 sensors

Dependencies:   DS1820

Embed: (wiki syntax)

« Back to documentation index

GattService Class Reference

GattService Class Reference

GATT service. More...

#include <GattService.h>

Public Member Functions

 GattService (uint8_t[16])
 Creates a new GattService using the specified 128-bit UUID.
 GattService (uint16_t)
 Creates a new GattService using the specified 16-bit BLE UUID.
virtual ~GattService (void)
 Destructor.
ble_error_t addCharacteristic (GattCharacteristic &)
 Adds a GattCharacterisic to the service.

Detailed Description

GATT service.

Definition at line 32 of file GattService.h.


Constructor & Destructor Documentation

GattService ( uint8_t  base_uuid[16] )

Creates a new GattService using the specified 128-bit UUID.

Note:
The UUID value must be unique on the device
Parameters:
[in]uuidThe 16 byte (128-bit) UUID to use for this characteristic

EXAMPLE

Definition at line 39 of file GattService.cpp.

GattService ( uint16_t  ble_uuid )

Creates a new GattService using the specified 16-bit BLE UUID.

Parameters:
[in]ble_uuidThe standardised 16-bit (2 byte) BLE UUID to use for this characteristic

EXAMPLE

Definition at line 61 of file GattService.cpp.

~GattService ( void   ) [virtual]

Destructor.

Definition at line 73 of file GattService.cpp.


Member Function Documentation

ble_error_t addCharacteristic ( GattCharacteristic characteristic )

Adds a GattCharacterisic to the service.

Note:
This function will not update the .handle field in the GattCharacteristic. This value is updated when the parent service is added via the radio driver.
Parameters:
[in]characteristicThe GattCharacteristic object describing the characteristic to add to this service
Returns:
BLE_ERROR_NONE (0) if everything executed correctly, or an error code if there was a problem
Return values:
BLE_ERROR_NONEEverything executed correctly

EXAMPLE

Definition at line 101 of file GattService.cpp.