NordicSemiconductor / IOS-CoreBluetooth-Mock

Mocking library for CoreBluetooth framework.
BSD 3-Clause "New" or "Revised" License
225 stars 51 forks source link

Ensuring peripheral state before reporting disconnection #61

Closed philips77 closed 3 years ago

philips77 commented 3 years ago

This PR should help with issue reported in #25.

When tearDownSimulation() is called immediately after disconnection, the virtualConnections counter was first reset to 0, and then decremented. Hopefully, by checking the peripheral state this will happen less often. It's unlikely, that the peripheral would be in .disconnecting state just interval ms after tearing down the simulation. That seems to be the easiest "fix".