Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QJ_500-7c
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
时昊
QJ_500-7c
Commits
b0f55ede
Commit
b0f55ede
authored
2 months ago
by
wangxuhui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'release'
合并请求241219 See merge request
!14
parents
dffbd138
3f1edad1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
25 deletions
+82
-25
app_BT_User.c
qianjiang/main/app_BT_User.c
+28
-14
app_BT_User.h
qianjiang/main/app_BT_User.h
+2
-0
app_Ble_User.c
qianjiang/main/app_Ble_User.c
+3
-4
bt_app_main.c
qianjiang/main/bt_app_main.c
+18
-0
gatts_table_creat_demo.c
qianjiang/main/gatts_table_creat_demo.c
+29
-5
main_user.h
qianjiang/main/main_user.h
+2
-2
No files found.
qianjiang/main/app_BT_User.c
View file @
b0f55ede
...
...
@@ -13,12 +13,18 @@ BT_User_Control_Struct BT_User;
#define BT_ReConn_T 300
#define IPHNOE_ACTIVE_CONNENT 0X113
void
BT_User_Init
(
void
)
{
BT_User
.
BT_Sts
=
BT_Idle
;
BT_User
.
Call_Sts
=
Call_Idle
;
BT_User
.
ReconnTime
=
BT_ReConn_T
-
50
;
BT_User
.
HF_Ctrl
=
HF_Idle
;
BT_User
.
BT_DisConnReason
=
0xffff
;
BT_User
.
Get_Call_Num
=
0
;
BT_User
.
Call_Fitter_sts
=
Call_Idle
;
BT_User
.
HfClient_Req_Cnt
=
0
;
}
...
...
@@ -29,6 +35,11 @@ void BT_Connect_Event_Pro(void )
BT_User
.
ReconnTime
=
BT_ReConn_T
-
50
;
BT_User
.
HF_Ctrl
=
HF_Idle
;
// printf("TB CONN\r\n");
BT_User
.
BT_DisConnReason
=
0xffff
;
BT_User
.
Get_Call_Num
=
0
;
BT_User
.
Call_Fitter_sts
=
Call_Idle
;
BT_User
.
HfClient_Req_Cnt
=
0
;
}
...
...
@@ -39,6 +50,10 @@ void BT_DisConnect_Event_Pro(void )
BT_User
.
ReconnTime
=
BT_ReConn_T
-
50
;
BT_User
.
HF_Ctrl
=
HF_Idle
;
// printf("TB DISCONN\r\n");
BT_User
.
Get_Call_Num
=
0
;
BT_User
.
Call_Fitter_sts
=
Call_Idle
;
BT_User
.
HfClient_Req_Cnt
=
0
;
}
void
BT_User_Process
(
void
)
...
...
@@ -98,26 +113,25 @@ void BT_User_Process(void )
BT_User
.
HF_Ctrl
=
HF_Idle
;
if
(
BT_User
.
BT_Sts
==
BT_Idle
)
// if(BT_User.BT_DisConnReason != IPHNOE_ACTIVE_CONNENT)
{
BT_User
.
ReconnTime
++
;
if
(
BT_User
.
ReconnTime
>=
BT_ReConn_T
)
if
(
BT_User
.
BT_Sts
==
BT_Idle
)
{
// printf("Connect Start.................\n")
;
if
(
app_BT_Get_BondDev
()
==
1
)
BT_User
.
ReconnTime
++
;
if
(
BT_User
.
ReconnTime
>=
BT_ReConn_T
)
{
esp_hf_client_connect
(
peer_addr
);
// printf("Connect Start.................\n");
if
(
app_BT_Get_BondDev
()
==
1
)
{
esp_hf_client_connect
(
peer_addr
);
}
// printf("Connect Over\n");
BT_User
.
ReconnTime
=
0
;
}
// printf("Connect Over\n");
BT_User
.
ReconnTime
=
0
;
}
}
else
{
}
}
...
...
This diff is collapsed.
Click to expand it.
qianjiang/main/app_BT_User.h
View file @
b0f55ede
...
...
@@ -31,6 +31,7 @@ typedef enum
typedef
struct
{
uint8_t
BT_Sts
;
uint32_t
BT_DisConnReason
;
uint8_t
Call_Sts
;
uint16_t
ReconnTime
;
uint8_t
HF_Ctrl
;
...
...
@@ -38,6 +39,7 @@ typedef struct
// char CCLC[11];
char
Get_Call_Num
;
char
Call_Fitter_sts
;
uint8_t
HfClient_Req_Cnt
;
}
BT_User_Control_Struct
;
extern
BT_User_Control_Struct
BT_User
;
...
...
This diff is collapsed.
Click to expand it.
qianjiang/main/app_Ble_User.c
View file @
b0f55ede
...
...
@@ -669,7 +669,6 @@ void Ble_User_Task_Event(void *pvParameter)
vTaskDelete
(
NULL
);
}
uint8_t
BT_User_HfClient_Req_Cnt
;
void
Ble_User_Task_Cyc
(
void
*
pvParameter
)
{
while
(
1
)
...
...
@@ -690,15 +689,15 @@ void Ble_User_Task_Cyc(void *pvParameter)
if
(
BT_User
.
Call_Sts
!=
Call_Idle
)
{
if
(
BT_User
_
HfClient_Req_Cnt
++
>=
15
)
if
(
BT_User
.
HfClient_Req_Cnt
++
>=
15
)
{
BT_User
_
HfClient_Req_Cnt
=
0
;
BT_User
.
HfClient_Req_Cnt
=
0
;
esp_hf_client_query_current_calls
();
}
}
else
{
BT_User
_
HfClient_Req_Cnt
=
0
;
BT_User
.
HfClient_Req_Cnt
=
0
;
}
BT_User_Process
();
...
...
This diff is collapsed.
Click to expand it.
qianjiang/main/bt_app_main.c
View file @
b0f55ede
...
...
@@ -184,6 +184,24 @@ void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param)
// printf("event state %d\n", event);
break
;
case
ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT
:
// ESP_LOGE(BT_HF_TAG, "BT CONN");
// printf("stat :%d \r\n",param->acl_conn_cmpl_stat.stat);
if
(
param
->
acl_conn_cmpl_stat
.
stat
==
ESP_BT_STATUS_HCI_SUCCESS
)
{
// BT_Connect_Event_Pro();
ESP_LOGI
(
BT_HF_TAG
,
"BT CONN"
);
}
break
;
/* when ACL disconnection completed, this event comes */
case
ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT
:
// ESP_LOGW(BT_HF_TAG, "BT DISCONN REASON %x", param->acl_disconn_cmpl_stat.reason);
// BT_DisConnect_Event_Pro();
BT_User
.
BT_DisConnReason
=
param
->
acl_disconn_cmpl_stat
.
reason
;
break
;
default:
{
ESP_LOGI
(
BT_HF_TAG
,
"event: %d"
,
event
);
// printf("event state %d\n", event);
...
...
This diff is collapsed.
Click to expand it.
qianjiang/main/gatts_table_creat_demo.c
View file @
b0f55ede
...
...
@@ -902,24 +902,48 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
void
Get_Mac_Init
(
void
)
{
unsigned
int
i
=
0
;
uint64_t
ble_mac_num
=
0
;
uint8_t
ble_mac
[
10
]
=
{
0
};
char
temp
[
10
]
=
{
0
};
char
temp1
[
20
]
=
{
0
};
esp_read_mac
(
ble_mac
,
ESP_MAC_BT
);
// printf("%d\n",temp);
for
(
i
=
6
;
i
>
0
;
i
--
)
{
ble_mac_num
=
(
ble_mac_num
<<
8
)
|
ble_mac
[
i
-
1
];
// printf("%x ",ble_mac[i-1]);
}
// printf("%llx\r\n",ble_mac_num);
ble_mac_num
=
ble_mac_num
%
500000
;
// printf("%llx\r\n",ble_mac_num);
// sprintf(temp, "%02X%02X", ble_mac[4], ble_mac[5]);
int
g
;
ble_mac
[
0
]
=
ble_mac_num
/
100000
;
ble_mac_num
%=
100000
;
ble_mac
[
1
]
=
ble_mac_num
/
10000
;
ble_mac_num
%=
10000
;
ble_mac
[
2
]
=
ble_mac_num
/
1000
;
ble_mac_num
%=
1000
;
ble_mac
[
3
]
=
ble_mac_num
/
100
;
ble_mac_num
%=
100
;
ble_mac
[
4
]
=
ble_mac_num
/
10
;
ble_mac_num
%=
10
;
ble_mac
[
5
]
=
ble_mac_num
%
10
;
// for (i = 1; i < 6; i++)
// {
// printf("%d ",ble_mac[i]);
// }
// printf("\r\n");
unsigned
int
g
;
for
(
g
=
0
;
g
<
6
;
g
++
)
{
srand
((
int
)
ble_mac
[
g
]);
if
(
g
==
0
)
{
temp
[
g
]
=
(
char
)
rand
()
%
5
;
temp
[
g
]
=
(
ble_mac
[
g
]
%
5
)
;
}
else
{
temp
[
g
]
=
(
char
)
rand
()
%
10
;
temp
[
g
]
=
(
ble_mac
[
g
]
%
10
)
;
temp
[
g
]
+=
48
;
}
// printf("%d ",temp[g]);
...
...
This diff is collapsed.
Click to expand it.
qianjiang/main/main_user.h
View file @
b0f55ede
...
...
@@ -2,8 +2,8 @@
#define _MAIN_USER_H_
#define BL_INTERNAL_SW_YEAR 0x24
#define BL_INTERNAL_SW_MONTH 0x1
1
#define BL_INTERNAL_SW_DAY 0x1
2
#define BL_INTERNAL_SW_MONTH 0x1
2
#define BL_INTERNAL_SW_DAY 0x1
9
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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