A model of a remote BLE service.
More...
#include <BLERemoteService.hpp>
A model of a remote BLE service.
◆ getCharacteristic() [1/2]
Get the characteristic object for the UUID.
- Parameters
-
[in] | uuid | Characteristic uuid. |
- Returns
- Reference to the characteristic object.
- Exceptions
-
71 if (!m_haveCharacteristics) {
72 retrieveCharacteristics();
75 for (
auto &myPair : m_characteristicMap) {
76 if (myPair.first == v) {
◆ getCharacteristic() [2/2]
Get the remote characteristic object for the characteristic UUID.
- Parameters
-
[in] | uuid | Remote characteristic uuid. |
- Returns
- Reference to the remote characteristic object.
- Exceptions
-
◆ getCharacteristics()
Retrieve a map of all the characteristics of this service.
- Returns
- A map of all the characteristics of this service.
90 _debug_print_s(TAG,
">> getCharacteristics() for service", getUUID().
toString().c_str());
94 if (!m_haveCharacteristics) {
95 retrieveCharacteristics();
97 _debug_print_s(TAG,
"<< getCharacteristics() for service", getUUID().
toString().c_str());
98 return &m_characteristicMap;
◆ getCharacteristicsByHandle()
Retrieve a map of all the characteristics of this service.
- Returns
- A map of all the characteristics of this service.
106 _debug_print_s(TAG,
">> getCharacteristicsByHandle() for service", getUUID().
toString().c_str());
110 if (!m_haveCharacteristics) {
111 retrieveCharacteristics();
113 _debug_print_s(TAG,
"<< getCharacteristicsByHandle() for service", getUUID().
toString().c_str());
114 return &m_characteristicMapByHandle;
◆ getClient()
BLEClient * BLERemoteService::getClient |
( |
void |
| ) |
|
Get the client associated with this service.
- Returns
- A reference to the client associated with this service.
◆ setValue()
void BLERemoteService::setValue |
( |
BLEUUID |
characteristicUuid, |
|
|
std::string |
value |
|
) |
| |
Set the value of a characteristic.
- Parameters
-
[in] | characteristicUuid | The characteristic to set. |
[in] | value | The value to set. |
- Exceptions
-
190 _debug_print_s(TAG,
">> setValue: uuid", characteristicUuid.
toString().c_str());
192 _debug_print(TAG,
"<< setValue");
◆ toString()
std::string BLERemoteService::toString |
( |
void |
| ) |
|
Create a string representation of this remote service.
- Returns
- A string representation of this remote service.
201 std::ostringstream ss;
202 ss <<
"Service: uuid: " + m_uuid.
toString();
203 ss <<
", start_handle: " << std::dec << m_startHandle <<
" 0x" << std::hex << m_startHandle <<
204 ", end_handle: " << std::dec << m_endHandle <<
" 0x" << std::hex << m_endHandle;
205 for (
auto &myPair : m_characteristicMap) {
206 ss <<
"\n" << myPair.second->toString();
The documentation for this class was generated from the following files:
BLERemoteCharacteristic * getCharacteristic(const char *uuid)
Get the remote characteristic object for the characteristic UUID.
Definition: BLERemoteService.cpp:54