Nol.A SDK Library
24.11.0
For IoT System Software Development
|
The model of a BLE Characteristic. More...
#include <BLECharacteristic.hpp>
Public Member Functions | |
BLECharacteristic (const char *uuid, uint32_t properties=0) | |
BLECharacteristic (BLEUUID uuid, uint32_t properties=0) | |
void | addDescriptor (BLEDescriptor *pDescriptor) |
BLEDescriptor * | getDescriptorByUUID (const char *descriptorUUID) |
BLEDescriptor * | getDescriptorByUUID (BLEUUID descriptorUUID) |
BLEUUID | getUUID () |
std::string | getValue () |
uint8_t * | getData () |
void | indicate () |
void | notify (bool is_notification=true) |
Send a notify. A notification is a transmission of up to the first 20 bytes of the characteristic value. An notification will not block; it is a fire and forget. More... | |
void | setBroadcastProperty (bool value) |
void | setCallbacks (BLECharacteristicCallbacks *pCallbacks) |
void | setIndicateProperty (bool value) |
void | setNotifyProperty (bool value) |
void | setReadProperty (bool value) |
void | setValue (uint8_t *data, size_t size) |
Set the value of the characteristic. More... | |
void | setValue (std::string value) |
void | setValue (uint16_t &data16) |
void | setValue (uint32_t &data32) |
void | setValue (float &data32) |
void | setValue (double &data64) |
void | setWriteProperty (bool value) |
void | setWriteNoResponseProperty (bool value) |
std::string | toString () |
uint16_t | getHandle () |
void | setAccessPermissions (ble_gatt_perm_t perm) |
The model of a BLE Characteristic.
A BLE Characteristic is an identified value container that manages a value. It is exposed by a BLE server and can be read and written to by a BLE client.
void BLECharacteristic::notify | ( | bool | is_notification = true | ) |
Send a notify. A notification is a transmission of up to the first 20 bytes of the characteristic value. An notification will not block; it is a fire and forget.
void BLECharacteristic::setValue | ( | uint8_t * | data, |
size_t | size | ||
) |
Set the value of the characteristic.
[in] | data | The data to set for the characteristic. |
[in] | length | The length of the data in bytes. |