Skip to content

Commit

Permalink
Fix issue dotnet-bluetooth-le#280 for iOS using Error.Code for periph…
Browse files Browse the repository at this point in the history
…eral disconnection
  • Loading branch information
jean.bedard@exfo.com committed Jan 30, 2018
1 parent ee02e1b commit b0fa88a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Plugin.BLE.iOS/Adapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public Adapter(CBCentralManager centralManager)
_deviceOperationRegistry.Remove(stringId);
}

// check if it is a peripheral disconnection, which would be treated as normal
if(e.Error != null && e.Error.Code == 7 && e.Error.Domain == "CBErrorDomain")
{
isNormalDisconnect = true;
}

// remove from connected devices
if (_deviceConnectionRegistry.TryGetValue(stringId, out foundDevice))
{
Expand Down

0 comments on commit b0fa88a

Please sign in to comment.