I have a question regarding the Bluetooth LE Implemetation on the ESP32. Im using the ble_gatt_client example as a starting base for my project. I tried just to discover the services and the characteristics.
Finding the services on the device seems to work. Then I try to get the first characteristic of the service.
Both the service and the characteristic have 128-bit UUIDs.
Service UUID: 0x58, 0xe0, 0x69, 0x00, 0x15, 0xd8, 0x11, 0xe6, 0xb7, 0x37, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b
Characteristic UUID: 0x31, 0x41, 0xdd, 0x40, 0x15, 0xdb, 0x11, 0xe6, 0xa2, 0x4b, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b
Now when I call the function esp_ble_gattc_get_characteristic(...) it returns OK.
Then in the event handler ESP_GATTC_GET_CHAR_EVT I only can get an error in the status flag:
p_data->get_char.status
=> returns 0x85 which means ESP_GATT_ERROR
Now I wonder if the problem is the 128-bit UUID. I tried the example with the 16-bit UUID and it worked.
Or am I doing something else wrong?
I would appreciate your help! I will append the files I used.
I use the ESP_Core_board_V2. I use Ubuntu Linux to compile and flash. I updated the IDF yesterday (git status says your branch is up to date).
This is the output from the serial connection to the ESP32 (the last line is the 0x85 error):
Code: Select all
I (6192) GATTC_DEMO: Received a GAP event: ESP_GAP_BLE_SCAN_RESULT_EVT
I (6192) GATTC_DEMO: device address (bda): 00:1a:22:0a:15:e1
I (6192) GATTC_DEMO: device type: ESP_BT_DEVICE_TYPE_BLE
I (6192) GATTC_DEMO: search_evt: ESP_GAP_SEARCH_INQ_RES_EVT
I (6202) GATTC_DEMO: addr_type: BLE_ADDR_TYPE_PUBLIC
I (6212) GATTC_DEMO: rssi: -26
I (6212) GATTC_DEMO: flag: 5
I (6212) GATTC_DEMO: num_resps: 0
I (6222) GATTC_DEMO: payload:
I (6222) GATTC_DEMO: len: 7, KEY-BLE
I (6232) GATTC_DEMO: dump -
I (6232) GATTC_DEMO: Connect to the remote device.
I (6232) GATTC_DEMO:
E (8422) BT: smp_br_connect_callback is called on unexpected transport 2
I (8422) GATTC_DEMO: EVT 2, gattc if 4
I (8422) GATTC_DEMO: ESP_GATTC_OPEN_EVT conn_id 0, if 4, status 0, mtu 23
I (8432) GATTC_DEMO: REMOTE BDA 00:1a:22:0a:15:e1
I (9342) GATTC_DEMO: EVT 7, gattc if 4
I (9342) GATTC_DEMO: SEARCH RES: conn_id = 0
I (9342) GATTC_DEMO: UUID16: 1800
I (9342) GATTC_DEMO: EVT 7, gattc if 4
I (9342) GATTC_DEMO: SEARCH RES: conn_id = 0
I (9352) GATTC_DEMO: UUID16: 1801
I (9352) GATTC_DEMO: EVT 7, gattc if 4
I (9362) GATTC_DEMO: SEARCH RES: conn_id = 0
I (9362) GATTC_DEMO: UUID16: 180a
I (9372) GATTC_DEMO: EVT 7, gattc if 4
I (9372) GATTC_DEMO: SEARCH RES: conn_id = 0
I (9382) GATTC_DEMO: UUID128: 1b,c5,d5,a5,2,0,37,b7,e6,11,d8,15,0,69,e0,58
I (9382) GATTC_DEMO: EVT 7, gattc if 4
I (9392) GATTC_DEMO: SEARCH RES: conn_id = 0
I (9392) GATTC_DEMO: UUID128: 1b,c5,d5,a5,2,0,9b,a2,e6,11,db,15,a0,5d,ee,3a
I (9402) GATTC_DEMO: EVT 6, gattc if 4
I (9402) GATTC_DEMO: SEARCH_CMPL: conn_id = 0, status 0
found KEYBLE application service
get char return: 0
I (9422) GATTC_DEMO: EVT 35, gattc if 4
get char
Get char error 85