How to declare a ESP_GATT_RSP_BY_APP characteristic value?

zapta1
Posts: 9
Joined: Sat Jan 21, 2023 12:10 am

How to declare a ESP_GATT_RSP_BY_APP characteristic value?

Postby zapta1 » Sun Jan 22, 2023 5:15 am

I am looking at this example of value declaration in the link below

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}},
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?

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}},
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

Who is online

Users browsing this forum: No registered users and 75 guests