CBATTErrorRequestNotSupported while transferring data between Bluetooth LE devices

I am trying to implement BLE communication between installations of an iOS app and I am following Transferring Data Between Bluetooth Low Energy Devices since the data I need to transfer exceeds the 512 byte limit for attribute values.

I already have this working based on an older version of the app, however after I integrated with the mainline of development I am getting CBATTErrorRequestNotSupported which seems to be caused by OSStatus 65535 (which is kBluetoothSDPErrorCodeReservedEnd, but that is documented to not even be present on iOS).

So it seems that a change on our end is causing these errors, but I am completely stumped as to what change that might be. Is anyone able to enlighten me?

I am not sure where you are seeing kBluetoothSDPErrorCodeReservedEndduring testing, but that is not a valid code, and if you are receiving that, it means something has gone very wrong in the Bluetooth stack.

Outside of that, CBATTErrorRequestNotSupported is quite simple. But we need to know when and which state you are getting this error. Is it on the peripheral side, is it on the central side? What CoreBluetooth API are you calling when you get this error?

Typically this error would occur if you are reading or writing to/from a characteristic on the other side, but the connection has dropped.


Argun Tekant /  DTS Engineer / Core Technologies

Hi Argun, thank you; indeed the error occurred while trying to read from a characteristic. Here is a snippet of the log: I just assumed that if 6 was CBATTErrorRequestNotSupported then 65535 would be kBluetoothSDPErrorCodeReservedEnd.

However I was able to resolve the issue. I reviewed all the changes that happened since I had it working and as it turns out the instances' type I store details about the connection in got changed from a class to a struct. This change in semantics make it very likely that the connection got dropped while the read was in process. After I changed the type back to a class everything worked as it did before.

CBATTErrorRequestNotSupported while transferring data between Bluetooth LE devices
 
 
Q