Commit 130280ba authored by 时昊's avatar 时昊

feat:修改扫描为一直扫描

parent 67711f5a
......@@ -332,7 +332,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
switch (event) {
case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: {//BLE 扫描参数设置操作已经完成
//the unit of the duration is second
uint32_t duration = 30;
uint32_t duration = 0;
esp_ble_gap_start_scanning(duration);//启动扫描
break;
}
......@@ -354,7 +354,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
//if((scan_result->scan_rst.bda[4] == 0x22)||(scan_result->scan_rst.bda[4] == 0x1c))
{
//esp_log_buffer_hex("1111111111111111111111111111111111111",scan_result->scan_rst.ble_adv,scan_result->scan_rst.adv_data_len);
//ESP_LOGI(GATTC_TAG, "searched Adv Data Len %d, Scan Response Len %d", scan_result->scan_rst.adv_data_len, scan_result->scan_rst.scan_rsp_len);
//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);
......@@ -363,7 +363,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
//printf("scan_result->scan_rst.adv_data_len = %d\r\n",scan_result->scan_rst.adv_data_len);
// //tpms名字
// printf("222222222222222222222222222222222 = %x \r\n",scan_result->scan_rst.ble_adv[2]);
//printf("222222222222222222222222222222222 = %x \r\n",scan_result->scan_rst.ble_adv[2]);
// printf("333333333333333333333333333333333 = %x \r\n",scan_result->scan_rst.ble_adv[3]);
// printf("444444444444444444444444444444444 = %x \r\n",scan_result->scan_rst.ble_adv[4]);
// printf("555555555555555555555555555555555 = %x \r\n",scan_result->scan_rst.ble_adv[5]);
......@@ -387,6 +387,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
(scan_result->scan_rst.ble_adv[7] == 0x4D)&&
(scan_result->scan_rst.ble_adv[8] == 0x53))
{
//esp_log_buffer_hex("tpms",scan_result->scan_rst.ble_adv,scan_result->scan_rst.adv_data_len);
//printf("99999999999999999999999999 \r\n");
ID01_Len = scan_result->scan_rst.adv_data_len;
for(i = 0; i < scan_result->scan_rst.adv_data_len; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment