A model of a remote BLE service.
More...
#include <NimBLERemoteService.h>
Inherits NimBLEAttribute.
A model of a remote BLE service.
◆ begin()
Get iterator to the beginning of the vector of remote characteristic pointers.
- Returns
- An iterator to the beginning of the vector of remote characteristic pointers.
◆ deleteCharacteristic()
size_t NimBLERemoteService::deleteCharacteristic |
( |
const NimBLEUUID & |
uuid | ) |
const |
Delete characteristic by UUID.
- Parameters
-
[in] | uuid | The UUID of the characteristic to be removed from the local database. |
- Returns
- Number of characteristics left.
◆ deleteCharacteristics()
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.
◆ end()
Get iterator to the end of the vector of remote characteristic pointers.
- Returns
- An iterator to the end of the vector of remote characteristic pointers.
◆ getCharacteristic() [1/2]
Get the remote characteristic object for the characteristic UUID.
- Parameters
-
[in] | uuid | Remote characteristic uuid. |
- Returns
- A pointer to the remote characteristic object.
◆ getCharacteristic() [2/2]
Get the characteristic object for the UUID.
- Parameters
-
[in] | uuid | Characteristic uuid. |
- Returns
- A pointer to the characteristic object, or nullptr if not found.
◆ getCharacteristics()
Get a pointer to the vector of found characteristics.
- Parameters
-
[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. |
- Returns
- A read-only reference to the vector of characteristics retrieved for this service.
◆ getClient()
NimBLEClient * NimBLERemoteService::getClient |
( |
void |
| ) |
const |
Get the client associated with this service.
- Returns
- A reference to the client associated with this service.
◆ getValue()
Read the value of a characteristic associated with this service.
- Parameters
-
[in] | uuid | The characteristic to read. |
- Returns
- a string containing the value or an empty string if not found or error.
◆ setValue()
Set the value of a characteristic.
- Parameters
-
[in] | uuid | The characteristic UUID to set. |
[in] | value | The value to set. |
- Returns
- true on success, false if not found or error
◆ toString()
std::string NimBLERemoteService::toString |
( |
void |
| ) |
const |
Create a string representation of this remote service.
- Returns
- A string representation of this remote service.