Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT200T_ESP32
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RT200T
RT200T_ESP32
Commits
130280ba
Commit
130280ba
authored
Jun 08, 2024
by
时昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:修改扫描为一直扫描
parent
67711f5a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
gattc_demo.c
RT200T_2_ESP32/main/gattc_demo.c
+11
-10
No files found.
RT200T_2_ESP32/main/gattc_demo.c
View file @
130280ba
...
@@ -332,7 +332,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
...
@@ -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
)
{
switch
(
event
)
{
case
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
:
{
//BLE 扫描参数设置操作已经完成
case
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
:
{
//BLE 扫描参数设置操作已经完成
//the unit of the duration is second
//the unit of the duration is second
uint32_t
duration
=
3
0
;
uint32_t
duration
=
0
;
esp_ble_gap_start_scanning
(
duration
);
//启动扫描
esp_ble_gap_start_scanning
(
duration
);
//启动扫描
break
;
break
;
}
}
...
@@ -354,7 +354,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
...
@@ -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))
//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);
//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);
//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_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
...
@@ -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);
//printf("scan_result->scan_rst.adv_data_len = %d\r\n",scan_result->scan_rst.adv_data_len);
// //tpms名字
// //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("333333333333333333333333333333333 = %x \r\n",scan_result->scan_rst.ble_adv[3]);
// printf("444444444444444444444444444444444 = %x \r\n",scan_result->scan_rst.ble_adv[4]);
// printf("444444444444444444444444444444444 = %x \r\n",scan_result->scan_rst.ble_adv[4]);
// printf("555555555555555555555555555555555 = %x \r\n",scan_result->scan_rst.ble_adv[5]);
// 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
...
@@ -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
[
7
]
==
0x4D
)
&&
(
scan_result
->
scan_rst
.
ble_adv
[
8
]
==
0x53
))
(
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");
//printf("99999999999999999999999999 \r\n");
ID01_Len
=
scan_result
->
scan_rst
.
adv_data_len
;
ID01_Len
=
scan_result
->
scan_rst
.
adv_data_len
;
for
(
i
=
0
;
i
<
scan_result
->
scan_rst
.
adv_data_len
;
i
++
)
for
(
i
=
0
;
i
<
scan_result
->
scan_rst
.
adv_data_len
;
i
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment