Characteristic value declaration attribute permission
property
Characteristic Properties
char_val
The pointer to the characteristic value
control
The pointer to the attribute response control byte
Return value
- ESP_OK: Success - ESP_ERR_INVALID_ARG: Invalid arguments - ESP_FAIL: Failure due to other reasons
Notes
1. This function triggers `ESP_GATTS_ADD_CHAR_EVT`. 2. `control->auto_rsp` should be set to `ESP_GATT_AUTO_RSP` or `ESP_GATT_RSP_BY_APP`. 3. For stack respond attribute (`ESP_GATT_AUTO_RSP`), `char_val` should not be NULL and `char_val->attr_max_len` must be greater than 0.
Examples
esp_ble_gatts_add_char() is referenced by 5 libraries and example projects: