A management structure for BLE descriptors.
More...
#include <BLECharacteristic.hpp>
A management structure for BLE descriptors.
◆ getByHandle()
Return the descriptor by handle.
- Parameters
-
[in] | handle | The handle to look up the descriptor. |
- Returns
- The descriptor.
62 return m_handleMap.at(handle);
◆ getByUUID() [1/2]
Return the descriptor by UUID.
- Parameters
-
[in] | UUID | The UUID to look up the descriptor. |
- Returns
- The descriptor. If not present, then nullptr is returned.
46 for (
auto &myPair : m_uuidMap) {
47 if (myPair.first->getUUID().equals(uuid)) {
◆ getByUUID() [2/2]
Return the descriptor by UUID.
- Parameters
-
[in] | UUID | The UUID to look up the descriptor. |
- Returns
- The descriptor. If not present, then nullptr is returned.
◆ getFirst()
Get the first descriptor in the map.
- Returns
- The first descriptor in the map.
138 m_iterator = m_uuidMap.begin();
139 if (m_iterator == m_uuidMap.end())
return nullptr;
◆ getNext()
Get the next descriptor in the map.
- Returns
- The next descriptor in the map.
151 if (m_iterator == m_uuidMap.end())
return nullptr;
◆ handleGATTServerEvent()
void BLEDescriptorMap::handleGATTServerEvent |
( |
void * |
info | ) |
|
@breif Pass the GATT server event onwards to each of the descriptors found in the mapping
- Parameters
-
[in] | event | |
[in] | gatts_if | |
[in] | param | |
127 for (
auto &myPair : m_uuidMap) {
128 myPair.first->handleGATTServerEvent(info);
◆ setByHandle()
void BLEDescriptorMap::setByHandle |
( |
uint16_t |
handle, |
|
|
BLEDescriptor * |
pDescriptor |
|
) |
| |
Set the descriptor by handle.
- Parameters
-
[in] | handle | The handle of the descriptor. |
[in] | descriptor | The descriptor to cache. |
- Returns
- N/A.
96 m_handleMap.insert(std::pair<uint16_t, BLEDescriptor*>(handle, pDescriptor));
◆ setByUUID() [1/2]
Set the descriptor by UUID.
- Parameters
-
[in] | uuid | The uuid of the descriptor. |
[in] | characteristic | The descriptor to cache. |
- Returns
- N/A.
85 m_uuidMap.insert(std::pair<BLEDescriptor*, std::string>(pDescriptor, uuid.
toString()));
◆ setByUUID() [2/2]
void BLEDescriptorMap::setByUUID |
( |
const char * |
uuid, |
|
|
BLEDescriptor * |
pDescriptor |
|
) |
| |
Set the descriptor by UUID.
- Parameters
-
[in] | uuid | The uuid of the descriptor. |
[in] | characteristic | The descriptor to cache. |
- Returns
- N/A.
73 m_uuidMap.insert(std::pair<BLEDescriptor*, std::string>(pDescriptor, uuid));
◆ toString()
std::string BLEDescriptorMap::toString |
( |
| ) |
|
Return a string representation of the descriptor map.
- Returns
- A string representation of the descriptor map.
105 std::stringstream stringStream;
106 stringStream << std::hex << std::setfill(
'0');
108 for (
auto &myPair : m_uuidMap) {
110 stringStream <<
"\n";
113 stringStream <<
"handle: 0x" << std::setw(2) << myPair.first->getHandle() <<
", uuid: " + myPair.first->getUUID().toString();
115 return stringStream.str();
The documentation for this class was generated from the following files: