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
ce75bad9
Commit
ce75bad9
authored
Jul 03, 2024
by
chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改了蓝牙电话的逻辑
parent
d4311824
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
65 deletions
+94
-65
Protocol_User.c
qianjiang/main/Protocol_User.c
+1
-1
app_BT_User.h
qianjiang/main/app_BT_User.h
+2
-0
bt_app_hf.c
qianjiang/main/bt_app_hf.c
+88
-63
bt_app_hf.h
qianjiang/main/bt_app_hf.h
+2
-1
main_user.c
qianjiang/main/main_user.c
+1
-0
No files found.
qianjiang/main/Protocol_User.c
View file @
ce75bad9
...
@@ -350,7 +350,7 @@ void Uart_Send_Id01_Pro(void)
...
@@ -350,7 +350,7 @@ void Uart_Send_Id01_Pro(void)
void
Uart_Send_Id02_Pro
(
void
)
void
Uart_Send_Id02_Pro
(
void
)
{
{
uint8_t
ID02
[
1
]
=
{
0x00
};
uint8_t
ID02
[
1
]
=
{
0x00
};
ID02
[
0
]
=
BT_User
.
Call_
S
ts
;
ID02
[
0
]
=
BT_User
.
Call_
Fitter_s
ts
;
Protocol_Send
(
0x02
,
ID02
,
1
);
Protocol_Send
(
0x02
,
ID02
,
1
);
}
}
...
...
qianjiang/main/app_BT_User.h
View file @
ce75bad9
...
@@ -36,6 +36,8 @@ typedef struct
...
@@ -36,6 +36,8 @@ typedef struct
uint8_t
HF_Ctrl
;
uint8_t
HF_Ctrl
;
char
Number
[
11
];
char
Number
[
11
];
char
CCLC
[
11
];
char
CCLC
[
11
];
char
Get_Call_Num
;
char
Call_Fitter_sts
;
}
BT_User_Control_Struct
;
}
BT_User_Control_Struct
;
extern
BT_User_Control_Struct
BT_User
;
extern
BT_User_Control_Struct
BT_User
;
...
...
qianjiang/main/bt_app_hf.c
View file @
ce75bad9
...
@@ -332,13 +332,13 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
...
@@ -332,13 +332,13 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
ESP_LOGI
(
BT_HF_TAG
,
"--Call indicator %s"
,
ESP_LOGI
(
BT_HF_TAG
,
"--Call indicator %s"
,
c_call_str
[
param
->
call
.
status
]);
c_call_str
[
param
->
call
.
status
]);
if
(
(
param
->
call
.
status
==
0
)
&&
((
BT_User
.
Call_Sts
==
Call_InProcess
)
||
(
BT_User
.
Call_Sts
==
Call_OutCalling
)
||
(
BT_User
.
Call_Sts
==
Call_IncomeCalling
))
)
if
(
param
->
call
.
status
==
0
)
{
{
BT_User
.
Call_Sts
=
Call_Idle
;
BT_User
.
Call_Sts
=
Call_Idle
;
call_timer
=
0
;
call_timer
=
0
;
printf
(
"call Hangup
\r\n
"
);
printf
(
"call Hangup
\r\n
"
);
}
}
else
if
(
(
param
->
call
.
status
==
1
)
&&
((
BT_User
.
Call_Sts
==
Call_OutCalling
)
||
(
BT_User
.
Call_Sts
==
Call_IncomeCalling
)
||
(
BT_User
.
Call_Sts
==
Call_InProcess
))
)
else
if
(
param
->
call
.
status
==
1
)
{
{
BT_User
.
Call_Sts
=
Call_InProcess
;
BT_User
.
Call_Sts
=
Call_InProcess
;
printf
(
"call Call_InProcess
\r\n
"
);
printf
(
"call Call_InProcess
\r\n
"
);
...
@@ -348,43 +348,44 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
...
@@ -348,43 +348,44 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
case
ESP_HF_CLIENT_CIND_CALL_SETUP_EVT
:
case
ESP_HF_CLIENT_CIND_CALL_SETUP_EVT
:
{
{
//
ESP_LOGI(BT_HF_TAG, "--Call setup indicator %s",
ESP_LOGI
(
BT_HF_TAG
,
"--Call setup indicator %s"
,
//
c_call_setup_str[param->call_setup.status]);
c_call_setup_str
[
param
->
call_setup
.
status
]);
// switch(param->call_setup.status)
switch
(
param
->
call_setup
.
status
)
// {
{
// case 0:
case
0
:
// {
{
if
(
param
->
call_setup
.
status
==
0
&&
(
BT_User
.
Call_Sts
==
Call_IncomeCalling
))
if
(
BT_User
.
Call_Sts
==
Call_IncomeCalling
||
BT_User
.
Call_Sts
==
Call_OutCalling
)
{
{
BT_User
.
Call_Sts
=
Call_Idle
;
BT_User
.
Call_Sts
=
Call_Idle
;
}
// BT_User.Call_Sts = Call_Idle;
call_timer
=
0
;
call_timer
=
0
;
printf
(
"call Miss
\r\n
"
);
printf
(
"call Miss
\r\n
"
);
}
break
;
// break;
}
// }
case
1
:
// case 1:
{
// {
BT_User
.
Call_Sts
=
Call_IncomeCalling
;
// BT_User.Call_Sts = Call_IncomeCalling;
//
printf("call income\r\n");
printf
(
"call income
\r\n
"
);
//
break;
break
;
//
}
}
//
case 2:
case
2
:
//
{
{
//
BT_User.Call_Sts = Call_OutCalling;
BT_User
.
Call_Sts
=
Call_OutCalling
;
//
printf("call outcall\r\n");
printf
(
"call outcall
\r\n
"
);
//
break;
break
;
//
}
}
//
case 3:
case
3
:
//
{
{
//
BT_User.Call_Sts = Call_OutCalling;
BT_User
.
Call_Sts
=
Call_OutCalling
;
//
printf("call outcall\r\n");
printf
(
"call outcall
\r\n
"
);
//
break;
break
;
//
}
}
//
}
}
//
if(param->call_setup.status == 0)
if
(
param
->
call_setup
.
status
==
0
)
break
;
break
;
}
}
...
@@ -406,18 +407,18 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
...
@@ -406,18 +407,18 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
{
{
ESP_LOGI
(
BT_HF_TAG
,
"--clip number %s"
,
ESP_LOGI
(
BT_HF_TAG
,
"--clip number %s"
,
(
param
->
clip
.
number
==
NULL
)
?
"NULL"
:
(
param
->
clip
.
number
));
(
param
->
clip
.
number
==
NULL
)
?
"NULL"
:
(
param
->
clip
.
number
));
if
(
param
->
clip
.
number
!=
NULL
)
//
if(param->clip.number != NULL)
{
//
{
for
(
int
i
=
0
;
i
<
11
;
i
++
)
//
for(int i = 0 ; i < 11 ; i++)
{
//
{
BT_User
.
Number
[
i
]
=
param
->
clip
.
number
[
i
];
//
BT_User.Number[i] = param->clip.number[i];
}
//
}
}
//
}
if
(
BT_User
.
Call_Sts
!=
Call_InProcess
)
//
if(BT_User.Call_Sts != Call_InProcess)
BT_User
.
Call_Sts
=
Call_IncomeCalling
;
//
BT_User.Call_Sts = Call_IncomeCalling;
printf
(
"call income
\r\n
"
);
//
printf("call income\r\n");
printf
(
"%s
\n
"
,
param
->
clip
.
number
);
//
printf("%s\n",param->clip.number);
// printf("1\n");
//
// printf("1\n");
break
;
break
;
}
}
...
@@ -436,25 +437,29 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
...
@@ -436,25 +437,29 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
c_call_state_str
[
param
->
clcc
.
status
],
c_call_state_str
[
param
->
clcc
.
status
],
c_call_mpty_type_str
[
param
->
clcc
.
mpty
],
c_call_mpty_type_str
[
param
->
clcc
.
mpty
],
(
param
->
clcc
.
number
==
NULL
)
?
"NULL"
:
(
param
->
clcc
.
number
));
(
param
->
clcc
.
number
==
NULL
)
?
"NULL"
:
(
param
->
clcc
.
number
));
if
((
strstr
(
param
->
clcc
.
number
,
"10000000"
)
==
NULL
)
&&
(
BT_User
.
Call_Sts
!=
Call_IncomeCalling
)
&&
(
BT_User
.
Call_Sts
!=
Call_InProcess
))
// if((strstr(param->clcc.number,"10000000") == NULL) && (BT_User.Call_Sts != Call_IncomeCalling) && (BT_User.Call_Sts != Call_InProcess))
{
// {
if
(
call_timer
==
7
)
// if(call_timer == 7)
{
// {
BT_User
.
Call_Sts
=
Call_OutCalling
;
// BT_User.Call_Sts = Call_OutCalling;
printf
(
"call outcall
\r\n
"
);
// printf("call outcall\r\n");
printf
(
"%s
\n
"
,
param
->
clcc
.
number
);
// printf("%s\n",param->clcc.number);
}
// }
else
// else
{
// {
call_timer
++
;
// call_timer ++;
}
// }
// call_timer ++;
// // call_timer ++;
}
// }
else
// else
// {
// call_timer = 0;
// }
// break;
if
(
strstr
(
param
->
clcc
.
number
,
"10000000"
)
==
NULL
)
{
{
call_timer
=
0
;
BT_User
.
Get_Call_Num
=
1
;
}
}
break
;
}
}
case
ESP_HF_CLIENT_VOLUME_CONTROL_EVT
:
case
ESP_HF_CLIENT_VOLUME_CONTROL_EVT
:
...
@@ -504,6 +509,26 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
...
@@ -504,6 +509,26 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
}
}
}
}
void
Get_Iphone_Fitter_callsts
(
void
)
{
if
(
BT_User
.
Call_Sts
==
Call_Idle
)
{
BT_User
.
Get_Call_Num
=
0
;
BT_User
.
Call_Fitter_sts
=
BT_User
.
Call_Sts
;
}
else
{
if
(
BT_User
.
Get_Call_Num
==
1
)
{
BT_User
.
Call_Fitter_sts
=
BT_User
.
Call_Sts
;
}
else
{
BT_User
.
Call_Fitter_sts
=
Call_Idle
;
}
}
printf
(
"%d
\n
"
,
BT_User
.
Call_Fitter_sts
);
}
...
...
qianjiang/main/bt_app_hf.h
View file @
ce75bad9
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
*/
*/
void
bt_app_hf_client_cb
(
esp_hf_client_cb_event_t
event
,
esp_hf_client_cb_param_t
*
param
);
void
bt_app_hf_client_cb
(
esp_hf_client_cb_event_t
event
,
esp_hf_client_cb_param_t
*
param
);
void
Get_Iphone_Fitter_callsts
(
void
);
int
hf_conn_handler
(
void
);
int
hf_conn_handler
(
void
);
int
hf_disc_handler
(
void
);
int
hf_disc_handler
(
void
);
...
@@ -35,4 +35,5 @@ int hf_stop_vr_handler(void );
...
@@ -35,4 +35,5 @@ int hf_stop_vr_handler(void );
int
hf_query_call_handler
(
void
);
int
hf_query_call_handler
(
void
);
#endif
/* __BT_APP_HF_H__*/
#endif
/* __BT_APP_HF_H__*/
qianjiang/main/main_user.c
View file @
ce75bad9
...
@@ -82,6 +82,7 @@ static void Sys_Run_Tasks(void *arg)
...
@@ -82,6 +82,7 @@ static void Sys_Run_Tasks(void *arg)
if
(
SYS_RUN_TASK_100MS
)
if
(
SYS_RUN_TASK_100MS
)
{
{
Get_Iphone_Fitter_callsts
();
Ble_MsgRec_Navi_Timeout
();
Ble_MsgRec_Navi_Timeout
();
esp_hf_client_query_current_calls
();
esp_hf_client_query_current_calls
();
}
}
...
...
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