How to declare a ESP_GATT_RSP_BY_APP characteristic value?
Posted: Sun Jan 22, 2023 5:15 am
I am looking at this example of value declaration in the link below
Let's say that I change it to be read only and ESP_GATT_RSP_BY_APP. Is it ok in this case to pass zeros in the last three fields?
My thinking is that since the value is read by the response that the app create, the value buffer in the value declaration is not really used. I tried it and it seems to work but wanted to check that it's OK.
https://github.com/espressif/esp-idf/bl ... emo.c#L189
Code: Select all
[IDX_CHAR_VAL_A] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_A,
ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
Code: Select all
[IDX_CHAR_VAL_A] =
{{ESP_GATT_RSP_BY_APP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_A,
ESP_GATT_PERM_READ ,
0, 0, NULL}},
https://github.com/espressif/esp-idf/bl ... emo.c#L189