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

BLE::init() should also be able to take an <object, member> tuple for its callback #97

Merged
merged 5 commits into from
Nov 3, 2015

Conversation

rgrover
Copy link
Contributor

@rgrover rgrover commented Nov 3, 2015

please review: @pan- @marcuschangarm
this is urgent.

@rgrover
Copy link
Contributor Author

rgrover commented Nov 3, 2015

this change will require updating the demos again :(
the new bleInitComplete() would look like:

void bleInitComplete(BLE::InitializationCompleteCallbackContext *params)
{
    BLE &ble          = params->ble;
    ble_error_t error = params->error;
    ....
``

@marcuschangarm
Copy link
Contributor

That's what the major version number is for! :)

@pan-
Copy link
Member

pan- commented Nov 3, 2015

I have few remarks about this issue:

  • Why the InitializationCompleteCallback_t takes a pointer to an InitializationCompleteCallbackContext as a parameter instead of a reference? If the value pointed can't be null, I think it would be better if we use a reference. But if it is for the sake of consistency accross BLE API I think it is better to use a pointer.
  • For the future, do you think it would be good if we provide a dummy function pointer implementation which map correctly true function pointer concepts ?

If we have a tool like that, this little change would have just been a typedef modification to a FunctionPointer.

…the case <object,member> tuple was used for BLE::init()
@rgrover
Copy link
Contributor Author

rgrover commented Nov 3, 2015

@pan- @marcuschangarm
this latest implementation build correctly for <object, method> use.

@rgrover
Copy link
Contributor Author

rgrover commented Nov 3, 2015

@pan- I agree with your suggestion that we can implement the FunctionPointer concept more properly.

rgrover added a commit that referenced this pull request Nov 3, 2015
BLE::init() should also be able to take an <object, member> tuple for its callback
@rgrover rgrover merged commit 8d38842 into ARMmbed:develop Nov 3, 2015
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.

3 participants