Skip to content

Add Added unimplemented getCharacteristicsByHandle function #3277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libraries/BLE/src/BLERemoteService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ std::map<std::string, BLERemoteCharacteristic*>* 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<uint16_t, BLERemoteCharacteristic*>* BLERemoteService::getCharacteristicsByHandle() {
// 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();
}
return &m_characteristicMapByHandle;
} // getCharacteristicsByHandle

/**
* @brief This function is designed to get characteristics map when we have multiple characteristics with the same UUID
*/
Expand Down