Skip to content
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

Add Added unimplemented getCharacteristicsByHandle function #3277

Merged
merged 4 commits into from
Oct 1, 2019
Merged

Add Added unimplemented getCharacteristicsByHandle function #3277

merged 4 commits into from
Oct 1, 2019

Conversation

tanakamasayuki
Copy link
Contributor

Defined in BLERemoteService.h
But, Not included in BLERemoteService.cpp

Defined in BLERemoteService.h
But, Not included in BLERemoteService.cpp
* @return A map of all the characteristics of this service.
*/
std::map<uint16_t, BLERemoteCharacteristic*>* BLERemoteService::getCharacteristicsByHandle() {
log_v(">> getCharacteristicsByHandle() for service: %s", getUUID().toString().c_str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log already prints the method name.

Copy link
Member

@me-no-dev me-no-dev Sep 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove >> getCharacteristicsByHandle() for from the log lines

@tanakamasayuki
Copy link
Contributor Author

1.0.3\libraries\BLE\src\BLERemoteService.h

	std::map<std::string, BLERemoteCharacteristic*>* getCharacteristics();
	std::map<uint16_t, BLERemoteCharacteristic*>* getCharacteristicsByHandle();  // Get the characteristics map.

getCharacteristicsByHandle is defined.
But, Not available.

sketch\BLE_clientEx.ino.cpp.o:(.literal._Z15connectToServerv+0x24): undefined reference to `BLERemoteService::getCharacteristicsByHandle()'

Therefore, it was created with reference to the getCharacteristics function.

/**
 * @brief Retrieve a map of all the characteristics of this service.
 * @return A map of all the characteristics of this service.
 */
std::map<std::string, BLERemoteCharacteristic*>* BLERemoteService::getCharacteristics() {
	log_v(">> getCharacteristics() 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("<< getCharacteristics() for service: %s", getUUID().toString().c_str());
	return &m_characteristicMap;
} // getCharacteristics

getCharacteristics to getCharacteristicsByHandle
m_characteristicMap to m_characteristicMapByHandle

@me-no-dev me-no-dev merged commit 64cfb33 into espressif:master Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants