Closed andresag01 closed 8 years ago
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.
ARM Internal Ref: IOTSFW-1378
@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.
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.
The implementation of
shutdown()
does not reinitialise theGattServer
. For instance, it does not reset the values of characteristicCount, serviceCount, descriptorCount, etc.