NimBLE-Arduino 2.1.2
|
A model of a remote BLE characteristic. More...
#include <NimBLERemoteCharacteristic.h>
Inherits NimBLERemoteValueAttribute.
Public Member Functions | |
std::string | toString () const |
Convert a NimBLERemoteCharacteristic to a string representation;. | |
const NimBLERemoteService * | getRemoteService () const |
Get the remote service associated with this characteristic. | |
void | deleteDescriptors () const |
Delete the descriptors in the descriptor vector. | |
size_t | deleteDescriptor (const NimBLEUUID &uuid) const |
Delete descriptor by UUID. | |
bool | canBroadcast () const |
Does the characteristic support value broadcasting? | |
bool | canRead () const |
Does the characteristic support reading? | |
bool | canWriteNoResponse () const |
Does the characteristic support writing without a response? | |
bool | canWrite () const |
Does the characteristic support writing? | |
bool | canNotify () const |
Does the characteristic support reading with encryption? | |
bool | canIndicate () const |
Does the characteristic support indication? | |
bool | canWriteSigned () const |
Does the characteristic support signed writing? | |
bool | hasExtendedProps () const |
Does the characteristic support extended properties? | |
bool | subscribe (bool notifications=true, const notify_callback notifyCallback=nullptr, bool response=true) const |
Subscribe for notifications or indications. | |
bool | unsubscribe (bool response=true) const |
Unsubscribe for notifications or indications. | |
std::vector< NimBLERemoteDescriptor * >::iterator | begin () const |
Get iterator to the beginning of the vector of remote descriptor pointers. | |
std::vector< NimBLERemoteDescriptor * >::iterator | end () const |
Get iterator to the end of the vector of remote descriptor pointers. | |
NimBLERemoteDescriptor * | getDescriptor (const NimBLEUUID &uuid) const |
Get the descriptor instance with the given UUID that belongs to this characteristic. | |
const std::vector< NimBLERemoteDescriptor * > & | getDescriptors (bool refresh=false) const |
Get a pointer to the vector of found descriptors. | |
A model of a remote BLE characteristic.
std::vector< NimBLERemoteDescriptor * >::iterator NimBLERemoteCharacteristic::begin | ( | ) | const |
Get iterator to the beginning of the vector of remote descriptor pointers.
bool NimBLERemoteCharacteristic::canBroadcast | ( | ) | const |
Does the characteristic support value broadcasting?
bool NimBLERemoteCharacteristic::canIndicate | ( | ) | const |
Does the characteristic support indication?
bool NimBLERemoteCharacteristic::canNotify | ( | ) | const |
Does the characteristic support reading with encryption?
bool NimBLERemoteCharacteristic::canRead | ( | ) | const |
Does the characteristic support reading?
bool NimBLERemoteCharacteristic::canWrite | ( | ) | const |
Does the characteristic support writing?
bool NimBLERemoteCharacteristic::canWriteNoResponse | ( | ) | const |
Does the characteristic support writing without a response?
bool NimBLERemoteCharacteristic::canWriteSigned | ( | ) | const |
Does the characteristic support signed writing?
size_t NimBLERemoteCharacteristic::deleteDescriptor | ( | const NimBLEUUID & | uuid | ) | const |
Delete descriptor by UUID.
[in] | uuid | The UUID of the descriptor to be deleted. |
void NimBLERemoteCharacteristic::deleteDescriptors | ( | ) | const |
Delete the descriptors in the descriptor vector.
We maintain a vector called m_vDescriptors that contains pointers to NimBLERemoteDescriptors object references. Since we allocated these in this class, we are also responsible for deleting them. This method does just that.
std::vector< NimBLERemoteDescriptor * >::iterator NimBLERemoteCharacteristic::end | ( | ) | const |
Get iterator to the end of the vector of remote descriptor pointers.
NimBLERemoteDescriptor * NimBLERemoteCharacteristic::getDescriptor | ( | const NimBLEUUID & | uuid | ) | const |
Get the descriptor instance with the given UUID that belongs to this characteristic.
[in] | uuid | The UUID of the descriptor to find. |
const std::vector< NimBLERemoteDescriptor * > & NimBLERemoteCharacteristic::getDescriptors | ( | bool | refresh = false | ) | const |
Get a pointer to the vector of found descriptors.
[in] | refresh | If true the current descriptor vector will be cleared and all descriptors for this characteristic retrieved from the peripheral. If false the vector will be returned with the currently stored descriptors of this characteristic. |
const NimBLERemoteService * NimBLERemoteCharacteristic::getRemoteService | ( | ) | const |
Get the remote service associated with this characteristic.
bool NimBLERemoteCharacteristic::hasExtendedProps | ( | ) | const |
Does the characteristic support extended properties?
bool NimBLERemoteCharacteristic::subscribe | ( | bool | notifications = true , |
const notify_callback | notifyCallback = nullptr , |
||
bool | response = true |
||
) | const |
Subscribe for notifications or indications.
[in] | notifications | If true, subscribe for notifications, false subscribe for indications. |
[in] | notifyCallback | A callback to be invoked for a notification. |
[in] | response | If true, require a write response from the descriptor write operation. If NULL is provided then no callback is performed. |
std::string NimBLERemoteCharacteristic::toString | ( | ) | const |
Convert a NimBLERemoteCharacteristic to a string representation;.
bool NimBLERemoteCharacteristic::unsubscribe | ( | bool | response = true | ) | const |
Unsubscribe for notifications or indications.
[in] | response | bool if true, require a write response from the descriptor write operation. |