From 3cac5e5ddaf4eac064c7054dc62a33690b8c2866 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Sep 2019 10:33:43 +0900 Subject: [PATCH 1/2] Add Added unimplemented getCharacteristicsByHandle function Defined in BLERemoteService.h But, Not included in BLERemoteService.cpp --- libraries/BLE/src/BLERemoteService.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/BLE/src/BLERemoteService.cpp b/libraries/BLE/src/BLERemoteService.cpp index 754e8ac22d5..815c6a2fe31 100644 --- a/libraries/BLE/src/BLERemoteService.cpp +++ b/libraries/BLE/src/BLERemoteService.cpp @@ -226,6 +226,22 @@ std::map* BLERemoteService::getCharacteri return &m_characteristicMap; } // getCharacteristics +/** + * @brief Retrieve a map of all the characteristics of this service. + * @return A map of all the characteristics of this service. + */ +std::map* BLERemoteService::getCharacteristicsByHandle() { + log_v(">> getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str()); + // If is possible that we have not read the characteristics associated with the service so do that + // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking + // call and does not return until all the characteristics are available. + if (!m_haveCharacteristics) { + retrieveCharacteristics(); + } + log_v("<< getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str()); + return &m_characteristicMapByHandle; +} // getCharacteristicsByHandle + /** * @brief This function is designed to get characteristics map when we have multiple characteristics with the same UUID */ From 7d1e85099ff21d3269e2ae82d7d0bd8dc79195b8 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 Sep 2019 10:02:07 +0900 Subject: [PATCH 2/2] Delete log output --- libraries/BLE/src/BLERemoteService.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/BLE/src/BLERemoteService.cpp b/libraries/BLE/src/BLERemoteService.cpp index 815c6a2fe31..278e9c1cab4 100644 --- a/libraries/BLE/src/BLERemoteService.cpp +++ b/libraries/BLE/src/BLERemoteService.cpp @@ -231,14 +231,12 @@ std::map* BLERemoteService::getCharacteri * @return A map of all the characteristics of this service. */ std::map* BLERemoteService::getCharacteristicsByHandle() { - log_v(">> getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str()); // If is possible that we have not read the characteristics associated with the service so do that // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking // call and does not return until all the characteristics are available. if (!m_haveCharacteristics) { retrieveCharacteristics(); } - log_v("<< getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str()); return &m_characteristicMapByHandle; } // getCharacteristicsByHandle