We checked with the developers on your request.
1. These are standard error responses - Please see the ATT specification LIST of Error codes, Page 374 of the Core_4.2 document: https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439
2. You must also use the appropriate error code.
3. Since you are overriding our responses, you must follow the spec.
4. Our ATT implementation is BQB listed as compliant.
5. We don't know what the implications of using our BQB but we will check with the developers
Thanks for your response.
Our BLE productions are applied to the security Smart Home.
I hope when user want to read our private GATT service and character, he must have a security level.
So I have to have a call back function when user want to read service and character.
if he has a security level, the call back function will bypass to leatt_l2capHandler(l2capHdr) process, otherwise the call back function will return REQ_NOT_SUPPORTED response to client.
Please check with the developers.
I view the leatt.h
void leatt_sendErrResponse(INT32 errCode, INT32 reqOpcode, INT32 handleInError )
I cannot know the definition about the parameters : errCode, reqOpcode and handle.
The third parameter is the attribute handle. When you receive LEATT_OPCODE_READ_REQ you can do processing like
LEATT_PDU_READ_REQ_HDR *p_req = (LEATT_PDU_READ_REQ_HDR *)(l2capHdr +1);
The attribute that peer is trying to read is p_req->attrHandle. You need to match it against your database. And when you want to send error response you should use the same handle.
Maybe it will be written :
LEATT_PDU_READ_REQ_HDR *p_req = (LEATT_PDU_READ_REQ_HDR *)(l2capHdr +4);
Because L2CAP HDR is like as below:
typedef PACKED struct
If your l2capHdr is UINT8 * then you are right. My snippet assumed that it is L2CAP_HDR *.