When BluetoothDevice::DisconnectGatt is called:
Android: We call BluetoothGatt#disconnectGatt which initiates the disconnection. Once ConnectionStateChanged is called we set gatt_connected_ to false.
BlueZ: Unclear.
macOS: We call CBCentralManager:cancelPeripheralConnection which immediately causes the platform to mark the device as disconnected. After the device actually disconnects DidDisconnectPeripheral is called which causes us to set gatt_connected_ to false.
Windows: Doesn't support disconnecting.
We should define what's the correct behavior and enforce it across platforms. Questions that we should keep in mind:
1. When should a device be marked as "not connected"?
2. What should happen to GATT attributes when DisconnectGatt is called?
3. What happens if ConnectGatt is called before we receive the disconnection event? (This could cause races in macOS).
4. When should DeviceChanged be called?
Comment 1 by sheriffbot@chromium.org
, May 28 2018Status: Untriaged (was: Available)