Skip to content

Commit 3cac5e5

Browse files
Add Added unimplemented getCharacteristicsByHandle function
Defined in BLERemoteService.h But, Not included in BLERemoteService.cpp
1 parent a5c873b commit 3cac5e5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

libraries/BLE/src/BLERemoteService.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,22 @@ std::map<std::string, BLERemoteCharacteristic*>* BLERemoteService::getCharacteri
226226
return &m_characteristicMap;
227227
} // getCharacteristics
228228

229+
/**
230+
* @brief Retrieve a map of all the characteristics of this service.
231+
* @return A map of all the characteristics of this service.
232+
*/
233+
std::map<uint16_t, BLERemoteCharacteristic*>* BLERemoteService::getCharacteristicsByHandle() {
234+
log_v(">> getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str());
235+
// If is possible that we have not read the characteristics associated with the service so do that
236+
// now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking
237+
// call and does not return until all the characteristics are available.
238+
if (!m_haveCharacteristics) {
239+
retrieveCharacteristics();
240+
}
241+
log_v("<< getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str());
242+
return &m_characteristicMapByHandle;
243+
} // getCharacteristicsByHandle
244+
229245
/**
230246
* @brief This function is designed to get characteristics map when we have multiple characteristics with the same UUID
231247
*/

0 commit comments

Comments
 (0)