0

I want to get codes from Bluetooth documentation for GATT connection errors.

From callback

 func centralManager(_ central: CBCentralManager, 
                     didDisconnectPeripheral peripheral: CBPeripheral, 
                     error: Error?)

I get the error object with code. But this code is only a number which is a raw value in enum CBError.Code.

This "number" is something like random because for example in Bluetooth documentation GATT CONNECTION TIME OUT is coded by 0x08, not 6 how the Core Bluetooth "says".

Is there any way to get GATT connection error codes using Core Bluetooth? Or maybe at least is possible to map the Core Bluetooth errors with GATT connection errors from documentation?
Maybe CBError is storing this information but how?

lapwingg
  • 50
  • 9

0 Answers0