A data mapping used to manage the set of BLE characteristics known to the server.
More...
#include <BLEService.hpp>
A data mapping used to manage the set of BLE characteristics known to the server.
◆ getByHandle()
Return the characteristic by handle.
- Parameters
-
[in] | handle | The handle to look up the characteristic. |
- Returns
- The characteristic.
37 return m_handleMap.at(handle);
◆ getByUUID() [1/2]
Return the characteristic by UUID.
- Parameters
-
[in] | UUID | The UUID to look up the characteristic. |
- Returns
- The characteristic.
57 for (
auto &myPair : m_uuidMap) {
58 if (myPair.first->getUUID().equals(uuid)) {
◆ getByUUID() [2/2]
Return the characteristic by UUID.
- Parameters
-
[in] | UUID | The UUID to look up the characteristic. |
- Returns
- The characteristic.
◆ getFirst()
Get the first characteristic in the map.
- Returns
- The first characteristic in the map.
72 m_iterator = m_uuidMap.begin();
73 if (m_iterator == m_uuidMap.end())
return nullptr;
◆ getNext()
Get the next characteristic in the map.
- Returns
- The next characteristic in the map.
85 if (m_iterator == m_uuidMap.end())
return nullptr;
◆ handleGATTServerEvent()
void BLECharacteristicMap::handleGATTServerEvent |
( |
void * |
info | ) |
|
Pass the GATT server event onwards to each of the characteristics found in the mapping.
- Parameters
-
[in] | event | |
[in] | gatts_if | |
[in] | param | |
100 for (
auto& myPair : m_uuidMap) {
101 myPair.first->handleGATTServerEvent(info);
◆ setByHandle()
void BLECharacteristicMap::setByHandle |
( |
uint16_t |
handle, |
|
|
BLECharacteristic * |
characteristic |
|
) |
| |
Set the characteristic by handle.
- Parameters
-
[in] | handle | The handle of the characteristic. |
[in] | characteristic | The characteristic to cache. |
- Returns
- N/A.
113 m_handleMap.insert(std::pair<uint16_t, BLECharacteristic*>(handle, characteristic));
◆ setByUUID()
Set the characteristic by UUID.
- Parameters
-
[in] | uuid | The uuid of the characteristic. |
[in] | characteristic | The characteristic to cache. |
- Returns
- N/A.
124 m_uuidMap.insert(std::pair<BLECharacteristic*, std::string>(pCharacteristic, uuid.
toString()));
◆ toString()
std::string BLECharacteristicMap::toString |
( |
| ) |
|
Return a string representation of the characteristic map.
- Returns
- A string representation of the characteristic map.
133 std::stringstream stringStream;
134 stringStream << std::hex << std::setfill(
'0');
136 for (
auto &myPair: m_uuidMap) {
138 stringStream <<
"\n";
141 stringStream <<
"handle: 0x" << std::setw(2) << myPair.first->getHandle() <<
", uuid: " + myPair.first->getUUID().toString();
143 return stringStream.str();
The documentation for this class was generated from the following files:
- nola-sdk/include/BLEService.hpp
- src/net/BluetoothLE/BLECharacteristicMap.cpp