8000 Enhancement for #99 · kebot-embedded/esp32-snippets@c288b0b · GitHub
[go: up one dir, main page]

Skip to content

Commit c288b0b

Browse files
committed
Enhancement for nkolban#99
1 parent 4f173d1 commit c288b0b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

cpp_utils/BLERemoteCharacteristic.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ BLERemoteCharacteristic::BLERemoteCharacteristic(
4141
m_pRemoteService = pRemoteService;
4242
m_notifyCallback = nullptr;
4343

44-
getDescriptors(); // Get the descriptors for this characteristic
44+
retrieveCharacteristics(); // Get the descriptors for this characteristic
4545
ESP_LOGD(LOG_TAG, "<< BLERemoteCharacteristic");
4646
} // BLERemoteCharacteristic
4747

@@ -276,8 +276,8 @@ void BLERemoteCharacteristic::gattClientEventHandler(
276276
/**
277277
* @brief Populate the descriptors (if any) for this characteristic.
278278
*/
279-
void BLERemoteCharacteristic::getDescriptors() {
280-
ESP_LOGD(LOG_TAG, ">> getDescriptors() for characteristic: %s", getUUID().toString().c_str());
279+
void BLERemoteCharacteristic::retrieveCharacteristics() {
280+
ESP_LOGD(LOG_TAG, ">> retrieveCharacteristics() for characteristic: %s", getUUID().toString().c_str());
281281

282282
removeDescriptors(); // Remove any existing descriptors.
283283

@@ -326,6 +326,13 @@ void BLERemoteCharacteristic::getDescriptors() {
326326
} // getDescriptors
327327

328328

329+
/**
330+
* @brief Retrieve the map of descriptors keyed by UUID.
331+
*/
332+
std::map<std::string, BLERemoteDescriptor *>* BLERemoteCharacteristic::getDescriptors() {
333+
return &m_descriptorMap;
334+
} // getDescriptors
335+
329336

330337
/**
331338
* @brief Get the handle for this characteristic.

cpp_utils/BLERemoteCharacteristic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ class BLERemoteCharacteristic {
5959
esp_gattc_cb_event_t event,
6060
esp_gatt_if_t gattc_if,
6161
esp_ble_gattc_cb_param_t* evtParam);
62-
void getDescriptors();
62+
std::map<std::string, BLERemoteDescriptor *>* getDescriptors();
6363
uint16_t getHandle();
6464
BLERemoteService* getRemoteService();
6565
void removeDescriptors();
66+
void retrieveCharacteristics();
6667

6768
// Private properties
6869
BLEUUID m_uuid;

0 commit comments

Comments
 (0)
0