Open kamil-chmiel opened 3 years ago
Can you try the following sequence?
(await all awaitable operations)
When you disconnect you should get a disconnected
state and the second read should with with device disconnected or device not connected error (code 201 or 205).
I'm connecting to BLE device to read some characteristics and listen for notifications. When I'm done I would like to disconnect the device. When I call disconnectOrCancelConnection() it says device was disconnected, but I can see on my BLE device that it is still connected. Also when I look into iOS system settings I can see that my device is still connected.
Am I missing something or this method doesn't work as it should?
I found some info, but I'm not sure if this is the case: "...canceling a local connection does not guarantee that the underlying physical link is immediately disconnected. From your app’s perspective, however, the peripheral is considered disconnected, and the central manager object calls the centralManager:didDisconnectPeripheral:error: method of its delegate object."
Source: https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/1518952-cancelperipheralconnection