esp-nimble-cpp
1.4.0
|
A model of a remote BLE service. More...
Public Member Functions | |
virtual | ~NimBLERemoteService () |
When deleting the service make sure we delete all characteristics and descriptors. | |
std::vector< NimBLERemoteCharacteristic * >::iterator | begin () |
Get iterator to the beginning of the vector of remote characteristic pointers. More... | |
std::vector< NimBLERemoteCharacteristic * >::iterator | end () |
Get iterator to the end of the vector of remote characteristic pointers. More... | |
NimBLERemoteCharacteristic * | getCharacteristic (const char *uuid) |
Get the remote characteristic object for the characteristic UUID. More... | |
NimBLERemoteCharacteristic * | getCharacteristic (const NimBLEUUID &uuid) |
Get the characteristic object for the UUID. More... | |
void | deleteCharacteristics () |
Delete the characteristics in the characteristics vector. More... | |
size_t | deleteCharacteristic (const NimBLEUUID &uuid) |
Delete characteristic by UUID. More... | |
NimBLEClient * | getClient (void) |
Get the client associated with this service. More... | |
NimBLEUUID | getUUID (void) |
Get the service UUID. | |
std::string | getValue (const NimBLEUUID &characteristicUuid) |
Read the value of a characteristic associated with this service. More... | |
bool | setValue (const NimBLEUUID &characteristicUuid, const std::string &value) |
Set the value of a characteristic. More... | |
std::string | toString (void) |
Create a string representation of this remote service. More... | |
std::vector< NimBLERemoteCharacteristic * > * | getCharacteristics (bool refresh=false) |
Get a pointer to the vector of found characteristics. More... | |
A model of a remote BLE service.
std::vector< NimBLERemoteCharacteristic * >::iterator NimBLERemoteService::begin | ( | ) |
Get iterator to the beginning of the vector of remote characteristic pointers.
size_t NimBLERemoteService::deleteCharacteristic | ( | const NimBLEUUID & | uuid | ) |
Delete characteristic by UUID.
[in] | uuid | The UUID of the characteristic to be removed from the local database. |
void NimBLERemoteService::deleteCharacteristics | ( | ) |
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 | ( | ) |
Get iterator to the end of the vector of remote characteristic pointers.
NimBLERemoteCharacteristic * NimBLERemoteService::getCharacteristic | ( | const char * | uuid | ) |
Get the remote characteristic object for the characteristic UUID.
[in] | uuid | Remote characteristic uuid. |
NimBLERemoteCharacteristic * NimBLERemoteService::getCharacteristic | ( | const NimBLEUUID & | uuid | ) |
Get the characteristic object for the UUID.
[in] | uuid | Characteristic uuid. |
std::vector< NimBLERemoteCharacteristic * > * NimBLERemoteService::getCharacteristics | ( | bool | refresh = false | ) |
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 | ) |
Get the client associated with this service.
std::string NimBLERemoteService::getValue | ( | const NimBLEUUID & | characteristicUuid | ) |
Read the value of a characteristic associated with this service.
[in] | characteristicUuid | The characteristic to read. |
bool NimBLERemoteService::setValue | ( | const NimBLEUUID & | characteristicUuid, |
const std::string & | value | ||
) |
Set the value of a characteristic.
[in] | characteristicUuid | The characteristic to set. |
[in] | value | The value to set. |
std::string NimBLERemoteService::toString | ( | void | ) |
Create a string representation of this remote service.