You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IDF version (run git describe --tags to find it): v3.3-dev-386-gf1b4c18c2
Build System: Make
Compiler version (run xtensa-esp32-elf-gcc --version to find it): 1.22.0-80-g6c4433a
Operating System: Linux
Power Supply: USB
Problem Description
Dug up some old bluetooth code I was working on and brought it up to speed with the latest esp-idf release. I noticed that I get warnings printed to the console when my code was calling esp_ble_gatts_send_response with the *rsp argument set to NULL; this was not the case previously if I recall correctly. Just to be certain it wasn't a problem with my code, I recompiled the example gatts_demo.c and observed the same warning when esp_ble_gatts_send_response is called with a NULL response.
I'm not sure if I am misusing the API, but the existing example code and the API documentation lead me to believe that it is perfectly valid to call that function in this manner. If this call is valid, then I believe that the warning should be removed or changed to a debug level log print as to avoid confusion. Warning a user on a valid use of the API seems very wrong.
For further details, it looks like the warning comes from btc_gatts_arg_deep_copy, which is invoked from within esp_ble_gatts_send_response.
case BTC_GATTS_ACT_SEND_RESPONSE: {
if (src->send_rsp.rsp) {
dst->send_rsp.rsp = (esp_gatt_rsp_t *) osi_malloc(sizeof(esp_gatt_rsp_t));
if (dst->send_rsp.rsp) {
memcpy(dst->send_rsp.rsp, src->send_rsp.rsp, sizeof(esp_gatt_rsp_t));
} else {
BTC_TRACE_ERROR("%s %d no mem\n", __func__, msg->act);
}
} else {
BTC_TRACE_WARNING("%s %d, NULL response", __func__, msg->act);
}
break;
Expected Behavior
No warning printed to console.
Actual Behavior
Warning printed to console.
Steps to repropduce
Compile and flash gatts_demo.c to ESP32.
Connect to the ESP32 using a BLE capable client (I used my Android phone running nRF Connect).
Send one byte of data to either of the custom services defined in gatts_demo.c.
Observe warning printed to console.
Code to reproduce this issue
The example code gatts_demo.c included in the esp-idf can be used to reproduce the issue. Below is the particular call that triggers the warning.
I (485839) GATTS_DEMO: GATT_WRITE_EVT, conn_id 0, trans_id 1, handle 42
I (485839) GATTS_DEMO: GATT_WRITE_EVT, value len 1, value :
I (485849) GATTS_DEMO: bc
W (485849) BT_BTC: btc_gatts_arg_deep_copy 11, NULL response
The text was updated successfully, but these errors were encountered:
Environment
git describe --tags
to find it): v3.3-dev-386-gf1b4c18c2xtensa-esp32-elf-gcc --version
to find it): 1.22.0-80-g6c4433aProblem Description
Dug up some old bluetooth code I was working on and brought it up to speed with the latest esp-idf release. I noticed that I get warnings printed to the console when my code was calling
esp_ble_gatts_send_response
with the*rsp
argument set toNULL
; this was not the case previously if I recall correctly. Just to be certain it wasn't a problem with my code, I recompiled the examplegatts_demo.c
and observed the same warning whenesp_ble_gatts_send_response
is called with aNULL
response.I'm not sure if I am misusing the API, but the existing example code and the API documentation lead me to believe that it is perfectly valid to call that function in this manner. If this call is valid, then I believe that the warning should be removed or changed to a debug level log print as to avoid confusion. Warning a user on a valid use of the API seems very wrong.
For further details, it looks like the warning comes from
btc_gatts_arg_deep_copy
, which is invoked from withinesp_ble_gatts_send_response
.Expected Behavior
No warning printed to console.
Actual Behavior
Warning printed to console.
Steps to repropduce
gatts_demo.c
to ESP32.gatts_demo.c
.Code to reproduce this issue
The example code
gatts_demo.c
included in the esp-idf can be used to reproduce the issue. Below is the particular call that triggers the warning.Debug Logs
The text was updated successfully, but these errors were encountered: