Struggling with creating a BLE server.
Posted: Mon Feb 12, 2018 8:33 pm
I've been trying to get the ESP32 to work as a BLE server with little luck. I just posted what appears to be a bug in the bug reporting section of the forum. Nothing I've tried so far has worked to connect with any app on my Android and I've found what appears to be suspicious behavior. I'v found that in responding to GATT (get by type) requests when the ESP is supposed to respond with a error that the attribute is not found, it does not send the response and appears to disconnect immediately. This would explain why it fails to communicate with any apps and just abruptly disconnects.
I've traced through the stack and found the proper "attribute no found" error response makes it's way all the way to the function...
UINT16 L2CA_SendFixedChnlData (UINT16 fixed_cid, BD_ADDR rem_bda, BT_HDR *p_buf)
The BT_HDR has the correct opcode, len, and the 5 bytes of data that are the proper error response. The function exits successfully, but the BLE packet sniffer never sees the server to client response. Also the connection is dropped in the ESP32 while the client is still hanging out waiting.
Hard to believe that nobody else is seeing this error. Has anyone successfully managed to set up a connection with a "real" BLE client vs one that doesn't query the handles?
I've traced through the stack and found the proper "attribute no found" error response makes it's way all the way to the function...
UINT16 L2CA_SendFixedChnlData (UINT16 fixed_cid, BD_ADDR rem_bda, BT_HDR *p_buf)
The BT_HDR has the correct opcode, len, and the 5 bytes of data that are the proper error response. The function exits successfully, but the BLE packet sniffer never sees the server to client response. Also the connection is dropped in the ESP32 while the client is still hanging out waiting.
Hard to believe that nobody else is seeing this error. Has anyone successfully managed to set up a connection with a "real" BLE client vs one that doesn't query the handles?