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

A call to shutdown does not clear the state of some components of BLE API #85

Closed
andresag01 opened this issue Dec 8, 2015 · 4 comments

Comments

@andresag01
Copy link

The implementation of shutdown() does not reinitialise the GattServer. For instance, it does not reset the values of characteristicCount, serviceCount, descriptorCount, etc.

@rgrover
Copy link
Contributor

rgrover commented Dec 8, 2015

thanks for raising this. It is a serious flaw. It could be affecting the functioning of Eddystone and similar services which rely upon being able to flush the GattServer based on a shutdown.

@ciarmcom
Copy link
Member

ciarmcom commented Dec 8, 2015

ARM Internal Ref: IOTSFW-1378

@andresag01
Copy link
Author

@rgrover: I believe there is more state that is not being handled correctly in shutdown(). For instance, if you have two targets, the first running as a GattServer and the second as a GattClient. If you connect the client to the server and then call shutdown() in both this will not clear the Gap state. In other words, if after the call to shutdown() I call getState() in Gap, then the client will tell me that it is currently "connected" and the server tells me it is "advertising" and "connected".

Clearly, this leaves the API into all sorts of inconsistency and further calls to other functions (even after calling init()) might start returning unexpected errors.

@rgrover
Copy link
Contributor

rgrover commented Dec 9, 2015

maybe BLE::shutdown() should call Gap::shutdown(), GattServer::shutdown(), etc.
We might need to create these additional shutdown virtual methods and leave them empty by default.
Thanks for pointing this out.

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

3 participants