docs(ble/bluedroid): Optimize BLE example documentation

This commit is contained in:
zhanghaipeng
2024-12-17 11:16:16 +08:00
parent 45890e88e0
commit a50df596ef
8 changed files with 46 additions and 31 deletions
@@ -363,6 +363,8 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
if (adv_name != NULL) {
if (strlen(remote_device_name) == adv_name_len && strncmp((char *)adv_name, remote_device_name, adv_name_len) == 0) {
// Note: If there are multiple devices with the same device name, the device may connect to an unintended one.
// It is recommended to change the default device name to ensure it is unique.
ESP_LOGI(GATTC_TAG, "Device found %s", remote_device_name);
if (connect == false) {
connect = true;
@@ -365,6 +365,8 @@ We are interested in the `ESP_GAP_SEARCH_INQ_RES_EVT` event, which is called eve
ESP_LOGI(GATTC_TAG, " ");
if (adv_name != NULL) {
if (strlen(remote_device_name) == adv_name_len && strncmp((char *)adv_name, remote_device_name, adv_name_len) == 0) {
// Note: If there are multiple devices with the same device name, the device may connect to an unintended one.
// It is recommended to change the default device name to ensure it is unique.
ESP_LOGI(GATTC_TAG, "searched device %s", remote_device_name);
if (connect == false) {
connect = true;
@@ -458,6 +458,8 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
ESP_LOG_BUFFER_CHAR(GATTC_TAG, adv_name, adv_name_len);
if (adv_name != NULL) {
if (strlen(remote_device_name) == adv_name_len && strncmp((char *)adv_name, remote_device_name, adv_name_len) == 0) {
// Note: If there are multiple devices with the same device name, the device may connect to an unintended one.
// It is recommended to change the default device name to ensure it is unique.
ESP_LOGI(GATTC_TAG, "Device found %s", remote_device_name);
if (connect == false) {
connect = true;