2020-02-06 12:35 PM
I am using an SPBTLE-RF0 and I am having issues writing data more than 72 bytes to a write-only characteristic. I setup the characteristic as follows:
ret = aci_gatt_add_char(serviceHandle, UUID_TYPE_128, uuid, 128, CHAR_PROP_WRITE,
ATTR_PERMISSION_AUTHEN_WRITE | ATTR_PERMISSION_AUTHOR_WRITE | ATTR_PERMISSION_ENCRY_WRITE,
GATT_NOTIFY_ATTRIBUTE_WRITE | GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP,
16, 1, &requestCharHandle);
It is a variable sized characteristic with a maximum size of 128 bytes. When I write more than 20 bytes to the characteristic, then I start getting Prepare Write Requests and received the new value in 18 byte chunks. If I write 72 bytes of data to the characteristic, I get four Prepare Write Requests followed by the Execute Write Request. However, if I write 73 bytes of data to the characteristic, I get four Prepare Write Requests and then the SPBTLE-RF0 returns an error code 0x09 on what should be the fifth Prepare Write Request. I can't find any documentation anywhere stating what error code 0x09 means. ERR_CONNECTION_TIMEOUT is 0x08 and ERR_COMMAND_DISALLOWED is 0x0C, but I can't find any error codes listed anywhere between those two values.
Is there a limit either from the BlueNRG-MS stack or from the SPBTLE-RF0 that would limit it to four Prepare Write Requests per attempt to write a characteristic value? Does anyone know what error code 0x09 means on a Prepare Write Request?