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

Radio Notifications API missing functionality? #121

Open
andresag01 opened this issue Nov 27, 2015 · 5 comments
Open

Radio Notifications API missing functionality? #121

andresag01 opened this issue Nov 27, 2015 · 5 comments

Comments

@andresag01
Copy link

Recently, the Radio notification API was modified to NOT initiate radio notification when a callback is registered using onRadioNotification. This conforms to the documentation, which now enforces applications to execute something like the following to get Radio Notifications started:

ble.gap().onRadioNotification(someHandlerFunction);
ble.gap().initRadioNotification();

Nevertheless, the handler only really gets called when there is radio activity, such as after calling ble.gap().startAdvertising(). Wouldn't it be best if the radio notification is initiated inside the onRadioNotification() call and just modify the documentation to describe this behaviour? After all, you only register a callback because you actually want to get the callback.

Alternatively, if you want to not change the documentation, wouldnt it make sense to have a stopRadioNotification() API that allows you to start and stop the radio notification events whenever you want? i.e. even during the advertising process.

@pan-
Copy link
Member

pan- commented Nov 27, 2015

it make sense to register the callback at the point you start the process but I don't think that it belong to the onRadioNotification function. Even if we change the documentation, the name doesn't indicate what the function actually does. Plus, sometime you just want to register callbacks at the start of your application then later, depending on the program flow, activate/deactivate the process which trigger this callback.

Maybe we can replicate the startScan api.

ble.gap().startRadioNotification(someHandleFunction);

@rgrover
Copy link
Contributor

rgrover commented Nov 27, 2015

yes, I'm happy with setting up a callback along with startRadioNotification()

@andresag01
Copy link
Author

I am happy with the startRadioNotification(), but I also think we should have the stopRadioNotification(). I think that currently the only way to stop the callbacks would be to call ble.shutdown() or perhaps using onRadioNotification(NULL) (havent tested this one though).

@pan-
Copy link
Member

pan- commented Nov 27, 2015

Yes, it would be a great addition Andres, API has to be symmetrical. Start/Stop is easy to understand.

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-1361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants