J. Doe
J. Doe

Reputation: 43

iOS BLE Characteristic Control Point Write - ATT Error

I'm having trouble performing a write on a control point characteristic.

Perhaps I'm providing an erroneous value, as I don't fully understand the nature of a control point. I've noted some of the specs about the control point value next to implementation.

Even so, wouldn't I receive a more detailed error description than ATT Unknown, so Im having trouble figuring out the root cause.

char buffer[1];
buffer[0] = 0x01; // opCode - 1 byte
// buffer[1] = 0x00; // Operand - variable length, N/A in this case
// buffer[2] = 0x00; // Crypto Data, 3 bytes, (handled by encryption manager? investigating)
NSData *data = [NSData dataWithBytes:buffer length:1];
NSData *data2 = [self.encryptionManager encrypt:data];
[_peripheral writeValue:data2 forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse];

ATT Error Description

By the way, all other profiles/control points can be successfully read and written to. And this has been successfully tested on Android - not by me.

Upvotes: 2

Views: 1071

Answers (1)

Emil
Emil

Reputation: 18472

It is your remote device that returns that error code. The specification mentions when the device should send this code as following:

2.3 CLIENT CHARACTERISTIC CONFIGURATION DESCRIPTOR IMPROPERLY CONFIGURED (0xFD)

The Client Characteristic Configuration Descriptor Improperly Configured error code is used when a Client Characteristic Configuration descriptor is not configured according to the requirements of the profile or service.

If the error code is being used correctly - I can't tell. Please read the documentation for your remote device how it should be used. Because now it's a bit like you're asking why a random http server responds with error 500.

"Control point" more or less just means a characteristic you write to.

Upvotes: 0

Related Questions