1.notif代码
if (count > 0 && (char_elem_result[0].properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY)){
gl_profile_tab[PROFILE_A_APP_ID].char_handle = char_elem_result[0].char_handle;
esp_ble_gattc_register_for_notify (gattc_if, gl_profile_tab[PROFILE_A_APP_ID].remote_bda, char_elem_result[0].char_handle);
}
2.可以在例程中notify代码下增加resd代码
esp_ble_gattc_read_char (gattc_if,
p_data->search_cmpl.conn_id,
char_elem_result[0].char_handle,
ESP_GATT_AUTH_REQ_NONE);
3.同时增加read回调
case ESP_GATTC_READ_CHAR_EVT:
ESP_LOGI(GATTC_TAG, "ESP_GATTC_READ_CHAR_EVT");
esp_log_buffer_hex(GATTC_TAG,p_data->read.value, p_data->read.value_len);
break;