mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-18 10:31:09 +00:00
Merge branch 'bugfix/btdm_add_some_comment' into 'master'
Component/bt: add some comments See merge request idf/esp-idf!1949
This commit is contained in:
@@ -38,7 +38,10 @@
|
||||
#define SAMPLE_DEVICE_NAME "ESP_GATTS_DEMO"
|
||||
#define SVC_INST_ID 0
|
||||
|
||||
#define GATTS_DEMO_CHAR_VAL_LEN_MAX 100
|
||||
/* The max length of characteristic value. When the gatt client write or prepare write,
|
||||
* the data length must be less than GATTS_DEMO_CHAR_VAL_LEN_MAX.
|
||||
*/
|
||||
#define GATTS_DEMO_CHAR_VAL_LEN_MAX 500
|
||||
#define PREPARE_BUF_MAX_SIZE 1024
|
||||
#define CHAR_DECLARATION_SIZE (sizeof(uint8_t))
|
||||
|
||||
@@ -378,6 +381,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_
|
||||
break;
|
||||
case ESP_GATTS_WRITE_EVT:
|
||||
if (!param->write.is_prep){
|
||||
// the data length of gattc write must be less than GATTS_DEMO_CHAR_VAL_LEN_MAX.
|
||||
ESP_LOGI(GATTS_TABLE_TAG, "GATT_WRITE_EVT, handle = %d, value len = %d, value :", param->write.handle, param->write.len);
|
||||
esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
|
||||
if (heart_rate_handle_table[IDX_CHAR_CFG_A] == param->write.handle && param->write.len == 2){
|
||||
@@ -420,7 +424,8 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_
|
||||
example_prepare_write_event_env(gatts_if, &prepare_write_env, param);
|
||||
}
|
||||
break;
|
||||
case ESP_GATTS_EXEC_WRITE_EVT:
|
||||
case ESP_GATTS_EXEC_WRITE_EVT:
|
||||
// the length of gattc prapare write data must be less than GATTS_DEMO_CHAR_VAL_LEN_MAX.
|
||||
ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_EXEC_WRITE_EVT");
|
||||
example_exec_write_event_env(&prepare_write_env, param);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user