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

unused parameter in BLERemoteService::getCharacteristics() #4660

Closed
cyberman54 opened this issue Dec 26, 2020 · 8 comments
Closed

unused parameter in BLERemoteService::getCharacteristics() #4660

cyberman54 opened this issue Dec 26, 2020 · 8 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@cyberman54
Copy link
Contributor

My compiler complains on a unused, but set, parameter in BLERemoteService::getCharacteristics():

*pCharacteristicMap = m_characteristicMapByHandle;
ist set, but neither used in the function, nor returned by it.

Maybe shall this function have a return value, other than void()?

/cc @Kolban

@chegewara
Copy link
Contributor

I dont remember now why there is 2 getCharacteristics(), but you can use this one:
https://github.com/espressif/arduino-esp32/blob/master/libraries/BLE/src/BLERemoteService.cpp#L217

@cyberman54
Copy link
Contributor Author

@chegewara thanks for the hint! Would be nice to delete the redundant function, if not needed (where?), to get rid of the compiler warning.

@chegewara
Copy link
Contributor

Feel free to make PR, for example add this in function with warning:
(void)pCharacteristicMap

@cyberman54
Copy link
Contributor Author

I am careful to make changes here, as long as i don't know sure what i am doing in this code.

@chegewara
Copy link
Contributor

It is easy change, you can try it in your code. That change does nothing in code except is fooling compiler.

@cyberman54
Copy link
Contributor Author

issue is now adressed by PR #4669

me-no-dev pushed a commit that referenced this issue Jan 11, 2021
Compiler complains on unused parameter pCharacteristicMap:

framework-arduinoespressif32\libraries\BLE\src\BLERemoteService.cpp: In member function 'void BLERemoteService::getCharacteristics(std::map<short unsigned int, BLERemoteCharacteristic*>*)':
\framework-arduinoespressif32\libraries\BLE\src\BLERemoteService.cpp:246:89: warning: parameter 'pCharacteristicMap' set but not used [-Wunused-but-set-parameter]
 void BLERemoteService::getCharacteristics(std::map<uint16_t, BLERemoteCharacteristic*>* pCharacteristicMap) {
@stale
Copy link

stale bot commented Jun 23, 2021

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jun 23, 2021
@stale
Copy link

stale bot commented Jul 8, 2021

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

2 participants