Nol.A SDK Library  24.11.0
For IoT System Software Development
Public Member Functions | Static Public Attributes | List of all members
BLECharacteristic Class Reference

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)
 
BLEDescriptorgetDescriptorByUUID (const char *descriptorUUID)
 
BLEDescriptorgetDescriptorByUUID (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)
 

Static Public Attributes

static const uint32_t PROPERTY_READ = 1<<0
 
static const uint32_t PROPERTY_WRITE = 1<<1
 
static const uint32_t PROPERTY_NOTIFY = 1<<2
 
static const uint32_t PROPERTY_BROADCAST = 1<<3
 
static const uint32_t PROPERTY_INDICATE = 1<<4
 
static const uint32_t PROPERTY_WRITE_NR = 1<<5
 

Detailed Description

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.

Member Function Documentation

◆ notify()

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.

Returns
N/A.

◆ setValue()

void BLECharacteristic::setValue ( uint8_t *  data,
size_t  size 
)

Set the value of the characteristic.

Parameters
[in]dataThe data to set for the characteristic.
[in]lengthThe length of the data in bytes.

The documentation for this class was generated from the following file: