NimBLE-Arduino 2.3.0
|
A model of a remote BLE service. More...
#include <NimBLERemoteService.h>
Inherits NimBLEAttribute.
Public Member Functions | |
NimBLERemoteCharacteristic * | getCharacteristic (const char *uuid) const |
Get the remote characteristic object for the characteristic UUID. | |
NimBLERemoteCharacteristic * | getCharacteristic (const NimBLEUUID &uuid) const |
Get the characteristic object for the UUID. | |
void | deleteCharacteristics () const |
Delete the characteristics in the characteristics vector. | |
size_t | deleteCharacteristic (const NimBLEUUID &uuid) const |
Delete characteristic by UUID. | |
NimBLEClient * | getClient (void) const |
Get the client associated with this service. | |
NimBLEAttValue | getValue (const NimBLEUUID &characteristicUuid) const |
Read the value of a characteristic associated with this service. | |
bool | setValue (const NimBLEUUID &characteristicUuid, const NimBLEAttValue &value) const |
Set the value of a characteristic. | |
std::string | toString (void) const |
Create a string representation of this remote service. | |
const std::vector< NimBLERemoteCharacteristic * > & | getCharacteristics (bool refresh=false) const |
Get a pointer to the vector of found characteristics. | |
std::vector< NimBLERemoteCharacteristic * >::iterator | begin () const |
Get iterator to the beginning of the vector of remote characteristic pointers. | |
std::vector< NimBLERemoteCharacteristic * >::iterator | end () const |
Get iterator to the end of the vector of remote characteristic pointers. | |
![]() | |
const NimBLEUUID & | getUUID () const |
Get the UUID of the attribute. | |
uint16_t | getHandle () const |
Get the handle of the attribute. | |
Additional Inherited Members | |
![]() | |
NimBLEAttribute (const NimBLEUUID &uuid, uint16_t handle) | |
Construct a new NimBLEAttribute object. | |
~NimBLEAttribute ()=default | |
Destroy the NimBLEAttribute object. | |
A model of a remote BLE service.
std::vector< NimBLERemoteCharacteristic * >::iterator NimBLERemoteService::begin | ( | ) | const |
Get iterator to the beginning of the vector of remote characteristic pointers.
size_t NimBLERemoteService::deleteCharacteristic | ( | const NimBLEUUID & | uuid | ) | const |
Delete characteristic by UUID.
[in] | uuid | The UUID of the characteristic to be removed from the local database. |
void NimBLERemoteService::deleteCharacteristics | ( | ) | const |
Delete the characteristics in the characteristics vector.
We maintain a vector called m_characteristicsVector that contains pointers to BLERemoteCharacteristic object references. Since we allocated these in this class, we are also responsible for deleting them. This method does just that.
std::vector< NimBLERemoteCharacteristic * >::iterator NimBLERemoteService::end | ( | ) | const |
Get iterator to the end of the vector of remote characteristic pointers.
NimBLERemoteCharacteristic * NimBLERemoteService::getCharacteristic | ( | const char * | uuid | ) | const |
Get the remote characteristic object for the characteristic UUID.
[in] | uuid | Remote characteristic uuid. |
NimBLERemoteCharacteristic * NimBLERemoteService::getCharacteristic | ( | const NimBLEUUID & | uuid | ) | const |
Get the characteristic object for the UUID.
[in] | uuid | Characteristic uuid. |
const std::vector< NimBLERemoteCharacteristic * > & NimBLERemoteService::getCharacteristics | ( | bool | refresh = false | ) | const |
Get a pointer to the vector of found characteristics.
[in] | refresh | If true the current characteristics vector will cleared and all characteristics for this service retrieved from the peripheral. If false the vector will be returned with the currently stored characteristics of this service. |
NimBLEClient * NimBLERemoteService::getClient | ( | void | ) | const |
Get the client associated with this service.
NimBLEAttValue NimBLERemoteService::getValue | ( | const NimBLEUUID & | uuid | ) | const |
Read the value of a characteristic associated with this service.
[in] | uuid | The characteristic to read. |
bool NimBLERemoteService::setValue | ( | const NimBLEUUID & | uuid, |
const NimBLEAttValue & | value | ||
) | const |
Set the value of a characteristic.
[in] | uuid | The characteristic UUID to set. |
[in] | value | The value to set. |
std::string NimBLERemoteService::toString | ( | void | ) | const |
Create a string representation of this remote service.