-
-
Notifications
You must be signed in to change notification settings - Fork 72
refactor(RemoteServ): Reduce nesting #291
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
base: master
Are you sure you want to change the base?
Conversation
Same treatment as previous PR. I assumed similar rules apply here, but let me know if it's wrong.
Might have to roll back to |
Looks good and I agree with the consolidation thought. Not sure if creating/inheriting from a class for this purpose is the way to go because the client class would also need to inherit from it. Maybe a utility function instead? |
Sure, that works too. |
Does |
Probably not, unless it's an empty service, which would be weird. Wouldn't be the worst idea to add it anyway though. |
f5aca05
to
75d77d9
Compare
eec32d5
to
2c909ff
Compare
* Adds parameter out to retrieveCharacteristics, default value works as the original method. * out: if not nullptr, will allow caller to obtain the characteristic * Add check to retrieveCharacteristics, return if found the last handle * General cleanup
2c909ff
to
31b2d0f
Compare
} | ||
|
||
NIMBLE_LOGE(LOG_TAG, "<< retrieveCharacteristics() rc=%d %s", rc, NimBLEUtils::returnCodeToString(rc)); | ||
return false; | ||
if (out) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to love those mysterious compiler warnings when it comes to pointers, been there done that lol!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have swore the consolidation PR omits the nullptr check and was able to pass.
Wasted so much time on this stupid error lol, especially since it was building fine on my end.
I'm assuming the build check uses more pedantic flags or something, would be nice to have a similar setup locally.
I introduced some minor changes since the previous successful build. Let me know if I should revert. Btw when a PR gets merged, does it use the message from the OP or the message from the commit? |
I'm not concerned with the naming, as long as it's somewhat consistent throughout the library and obvious/readable for casual observers as to what they represent, in this case the original naming suits but I'm happy to entertain changes.
The title/message on github for each commit in a PR is what will be seen in git log when pulled by anyone else. |
Some of the BLE jargon just adds so much bloat when written in full like characteristic, descriptor, etc.; which then causes the need to break function calls up with one parameter per line. I definitely think some standardization should be established which will make things more concise while still having a clear meaning. Though that's probably a 3.0 discussion.
Good to know. Sometimes I mess up the message in the terminal and wasn't sure if I need to bother repushing. |
Yeah, drives me crazy sometimes.
Absolutely
No promises lol, it comes down to the person merging, it can all be edited. |
out
toretrieveCharacteristics
, default value works as the original method.out
: if not nullptr, will allow caller to obtain the characteristicretrieveCharacteristics
, return if found the last handlecharacteristicDiscCB
tochrDiscCB