I am implementing a BLE central device on the iPhone, using as peripheral a custom BLE device developed (whose firmware has been written by a colleague).
The peripheral for some operation will return a BLE error code, conforming to the standard Bluetooth ATT error codes as defined in BLE specifications.
On the iPhone side, where I'm using the CoreBluetooth stack to develop the central device, I am notified of such errors on the debugger output window of xCode as:
CoreBluetooth[WARNING] Unknown error: XX
and then I receive in the callbacks a CBError* object. My problem is that the CBError* object which I get in the callback (e.g., in CBPeripheralDelegate's didWriteValueForCharacteristic callback) just contains code=0 and localizedDescription="Unknown error".
Is it possible to retrieve somehow the error code which is logged on the debugger output window by the CoreBluetooth stack?
From my research it appears that CoreBluetooth maps almost all BLE standard error codes into "unknown errors" (with internal code 0, see CBError reference); I would like to get more detailed error codes, like those coded by CBAttError.