esp_ble_gap_set_scan_params()使用esp_ble_scan_params_t结构体进行设置 static esp_ble_scan_params_t ble_scan_params = { .scan_type = BLE_SCAN_TYPE_ACTIVE, //扫描类型 .own_addr_type = BLE_ADDR_TYPE_PUBLIC, //拥有者的蓝牙设备地址类型 .scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL,...
ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len); ESP_LOGI(GATTC_TAG, "Searched Device Name Len %d", adv_name_len); esp_log_buffer_char(GATTC_TAG, adv_name, adv_name_len); ESP_LOGI(GATTC_TAG, "\n"); if (Isconnecting){ break; } if (conn_device_a && conn_device_b && !stop...
ESP_BLE_AD_TYPE_128SRV_CMPL = 0x07, /* relate to BTM_BLE_AD_TYPE_128SRV_CMPL in stack/btm_ble_api.h */ ESP_BLE_AD_TYPE_NAME_SHORT = 0x08, /* relate to BTM_BLE_AD_TYPE_NAME_SHORT in stack/btm_ble_api.h */ ESP_BLE_AD_TYPE_NAME_CMPL = 0x09, /* relate to BTM_BLE...
adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv, ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len); ESP_LOGI(GATTC_TAG, "searched Device Name Len %d", adv_name_len); esp_log_buffer_char(GATTC_TAG, adv_name, adv_name_len);6...
(type != ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE)) { LOG_ERROR("the eir type not define, type = %x\n", type); *length = 0; return NULL; } if (adv_data == NULL) { LOG_ERROR("Invalid p_eir data.\n"); if (adv_data == NULL || adv_data_len == 0) { LOG_ERROR("Invalid...
ESP_LOGI(GATTS_TABLE_TAG, "key type = %s", esp_key_type_to_str(param->ble_security.ble_key.key_type)); break; 当密钥交换成功后,配对过程就完成了。这会触发“ESP_GAP_BLE_AUTH_CMPL_EVET”事件,该事件用于打印远程设备、地址类型和配对状态等信息: case ESP_GAP_BLE_AUTH_CMPL_EVT: { esp...
(1275) BLEAdvertisedDevice: Type: 0x09 (ESP_BLE_AD_TYPE_NAME_CMPL), length: 5, data: 4368656765 D (1284) BLEAdvertisedDevice: - setName(): name: Chege D (1289) SampleScan: Advertised Device: Name: Chege, Address: 74:91:ae:6f:ee:99, serviceUUID: 000018f0-0000-1000-8000-00805...
ESP_LOGE(GATTC_TAG, "gattc register error: %s", esp_err_to_name_r(status, err_msg, sizeof(err_msg))); return; } esp_ble_gattc_app_register(PROFILE_APP_ID); esp_err_t local_mtu_ret = esp_ble_gatt_set_local_mtu(200); //设置MTU最大为200 ...
adv_name=esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv,ESP_BLE_AD_TYPE_NAME_CMPL,&adv_name_len); 然后,将找到的设备名称与客户端想要连接的服务器名称进行比较。服务器名称在remote_device_name数组中定义: staticconstcharremote_device_name[3][20]={"ESP_GATTS_DEMO_1","ESP_GATTS_D...
, remote_device_name); if (connect == false) { connect = true; ESP_LOGI(GATTC_TAG, "connect to the remote device.1\n"); uint8_t ret = esp_ble_gap_stop_scanning(); ESP_LOGI(GATTC_TAG, "esp_ble_gap_stop_scanning ret = %d\n"...