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
62b011ae
Commit
62b011ae
authored
May 23, 2024
by
时昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:加注释
parent
dd48d7df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
Protocol_User.c
RT200T_2_ESP32/main/Protocol_User.c
+10
-10
app_BT_User.c
RT200T_2_ESP32/main/app_BT_User.c
+7
-7
bt_app_hf.c
RT200T_2_ESP32/main/bt_app_hf.c
+2
-2
gatts_table_creat_demo.c
RT200T_2_ESP32/main/gatts_table_creat_demo.c
+6
-6
No files found.
RT200T_2_ESP32/main/Protocol_User.c
View file @
62b011ae
...
...
@@ -209,9 +209,9 @@ static Protocol_uint32_t Protocol_UartSend(const Protocol_uint8_t *pData, Protoc
return
0
;
}
static
void
Protocol_UartHandle
(
const
Protocol_Data_t
*
pData
)
static
void
Protocol_UartHandle
(
const
Protocol_Data_t
*
pData
)
//esp接收底板数据
{
if
(
pData
->
CmdID
==
0x20
)
if
(
pData
->
CmdID
==
0x20
)
//收到底板发送的数据后,传状态
{
//printf("0x20 is get\r\n");
if
(
Prot_User
.
State
<
Prot_Start
)
...
...
@@ -220,7 +220,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
printf
(
"Prot_Start
\r\n
"
);
}
}
else
if
(
pData
->
CmdID
==
0x03
)
else
if
(
pData
->
CmdID
==
0x03
)
//收到底板发送的电话状态,来控制esp32蓝牙电话
{
//printf("0x03 is get\r\n");
if
(
Prot_User
.
State
<
Prot_Normal
)
...
...
@@ -234,9 +234,9 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
{
// if(pData->DataLen == 33)
{
if
(
BT_User
.
HF_Ctrl
!=
pData
->
Data
[
0
])
if
(
BT_User
.
HF_Ctrl
!=
pData
->
Data
[
0
])
//和上次数据不同
{
BT_User
.
HF_Ctrl
=
pData
->
Data
[
0
];
BT_User
.
HF_Ctrl
=
pData
->
Data
[
0
];
//esp32接收到的数据
}
if
(
strncmp
((
const
char
*
)
ble_uerid
,
(
const
char
*
)
&
(
pData
->
Data
[
1
]),
32
)
!=
0
)
...
...
@@ -309,18 +309,18 @@ void Protocol_User_Ctrl_Init(void )
Prot_User
.
TimeDelay
=
0
;
}
void
Uart_Send_Id10_Pro
(
void
)
void
Uart_Send_Id10_Pro
(
void
)
//esp32发送启动完成给底板
{
uint8_t
wtemp
[
1
]
=
{
0
};
wtemp
[
0
]
=
1
;
Protocol_Send
(
0x10
,
wtemp
,
1
);
}
void
Uart_Send_Id12_Pro
(
void
)
void
Uart_Send_Id12_Pro
(
void
)
//收到底板回复的0x20后,发送蓝牙类型 ID12[0]是判断蓝牙是否连接 不等于0是连接
{
uint8_t
ID12
[
15
]
=
{
0
};
ID12
[
0
]
|=
(
uint8_t
)(
BT_User
.
BT_Sts
<<
4
);
ID12
[
0
]
|=
Ble_User
.
Ble_Sts
;
ID12
[
0
]
|=
(
uint8_t
)(
BT_User
.
BT_Sts
<<
4
);
//经典
ID12
[
0
]
|=
Ble_User
.
Ble_Sts
;
//ble
unsigned
int
i
=
0
;
for
(
i
=
0
;
i
<
14
;
i
++
)
{
...
...
@@ -351,7 +351,7 @@ void Uart_Send_Id02_Pro(void)
{
uint8_t
ID02
[
1
]
=
{
0x00
};
ID02
[
0
]
=
BT_User
.
Call_Sts
;
Protocol_Send
(
0x02
,
ID02
,
1
);
Protocol_Send
(
0x02
,
ID02
,
1
);
//给底板发送电话状态,用这个标志位显示电话号
}
...
...
RT200T_2_ESP32/main/app_BT_User.c
View file @
62b011ae
...
...
@@ -43,29 +43,29 @@ void BT_DisConnect_Event_Pro(void )
void
BT_User_Process
(
void
)
{
switch
(
BT_User
.
Call_Sts
)
switch
(
BT_User
.
Call_Sts
)
//电话状态
{
case
Call_OutCalling
:
case
Call_OutCalling
:
//打电话中
{
if
(
BT_User
.
HF_Ctrl
==
HF_Reject
)
{
hf_reject_handler
();
hf_reject_handler
();
//挂断
}
break
;
}
case
Call_IncomeCalling
:
case
Call_IncomeCalling
:
//响铃时
{
if
(
BT_User
.
HF_Ctrl
==
HF_Reject
)
{
hf_reject_handler
();
hf_reject_handler
();
//挂断
}
else
if
(
BT_User
.
HF_Ctrl
==
HF_Answer
)
{
hf_answer_handler
();
hf_answer_handler
();
//接听
}
break
;
}
case
Call_InProcess
:
case
Call_InProcess
:
//接电话中
{
if
(
BT_User
.
HF_Ctrl
==
HF_Reject
)
{
...
...
RT200T_2_ESP32/main/bt_app_hf.c
View file @
62b011ae
...
...
@@ -333,13 +333,13 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
if
(
param
->
call
.
status
==
0
)
{
BT_User
.
Call_Sts
=
Call_Idle
;
BT_User
.
Call_Sts
=
Call_Idle
;
//电话空闲
printf
(
"call idle
\r\n
"
);
}
else
if
(
param
->
call
.
status
==
1
)
{
BT_User
.
Call_Sts
=
Call_InProcess
;
BT_User
.
Call_Sts
=
Call_InProcess
;
//正在接电话
printf
(
"call Call_InProcess
\r\n
"
);
}
break
;
...
...
RT200T_2_ESP32/main/gatts_table_creat_demo.c
View file @
62b011ae
...
...
@@ -56,13 +56,13 @@ static const int RX_BUF_SIZE = 1024;
#define TXD_PIN (GPIO_NUM_22)
#define RXD_PIN (GPIO_NUM_26)
typedef
struct
{
uint16_t
Rxlen
;
uint8_t
Rxbuff
[
255
];
}
_QJ_UART_Ctrl
;
//
typedef struct
//
{
//
uint16_t Rxlen;
//
uint8_t Rxbuff[255];
//
} _QJ_UART_Ctrl;
_QJ_UART_Ctrl
QJ_UARTRX
;
//
_QJ_UART_Ctrl QJ_UARTRX;
void
init_Uart
(
void
)
{
const
uart_config_t
uart_config
=
{
...
...
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