We are developing an iOS and Android App that both communicate with a BLE peripheral. In some cases this peripheral returns an error and we want to use custom status codes to identfy and differentiate the errors.
In our case for example we have error code 0x80 when trying to write a characteristic. When this error is returned our Android app is correctly showing an error with status 128. Unfortunately our iOS app shows an unknown error.
Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo=0x15df3cd0 {NSLocalizedDescription=Unknown error.}
We get this error from the normal CoreBluetooth delegate method when writing a characteristic
func peripheral(peripheral: CBPeripheral,
didWriteValueForCharacteristic characteristic: CBCharacteristic,
error: NSError?)
In the apple docs I have read about possible errors returned during a BLE ATT transaction. The CBATTError enum starts at "0x00 CBATTErrorSuccess" and ends at "0x11 CBATTErrorInsufficientResources".
My question is: Is 0x80 a valid error code in iOS when working with bluetooth LE peripherals or will error code 0x80 always lead to an unknown error on the iOS side because it is not part of the CBATTError enum?
Thanks in advance for your help!
Edit: I found another question related to this topic but the accepted answer isn´t possible anymore.
Is it possible to programmatically access the error codes logged by CoreBluetooth?