Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
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)
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.
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.
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.

Examples
nordic-nrf52-dk/BLEGATTServer/main.cpp.

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: