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
4a77af30
Commit
4a77af30
authored
May 23, 2024
by
时昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:替换名字
parent
62b011ae
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
142 deletions
+133
-142
Protocol_User.c
RT200T_2_ESP32/main/Protocol_User.c
+10
-10
Protocol_User.h
RT200T_2_ESP32/main/Protocol_User.h
+0
-9
app_Ble_User.c
RT200T_2_ESP32/main/app_Ble_User.c
+43
-43
app_Ble_User.h
RT200T_2_ESP32/main/app_Ble_User.h
+77
-77
main_user.c
RT200T_2_ESP32/main/main_user.c
+3
-3
No files found.
RT200T_2_ESP32/main/Protocol_User.c
View file @
4a77af30
...
@@ -258,7 +258,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
...
@@ -258,7 +258,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
}
}
}
}
}
}
else
if
(
pData
->
CmdID
==
0x21
)
else
if
(
pData
->
CmdID
==
0x21
)
//esp32收到底板发送的是1,则esp32需要升级
{
{
//printf("Wifi_OTA_Request is %d\r\n",Wifi_OTA_Request);
//printf("Wifi_OTA_Request is %d\r\n",Wifi_OTA_Request);
if
(
pData
->
Data
[
0
]
==
1
)
if
(
pData
->
Data
[
0
]
==
1
)
...
@@ -332,16 +332,16 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
...
@@ -332,16 +332,16 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
void
Uart_Send_Id01_Pro
(
void
)
void
Uart_Send_Id01_Pro
(
void
)
{
{
uint8_t
ID01
[
6
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
uint8_t
ID01
[
6
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
if
(
Ble_User
.
Navi
_Updat
)
if
(
Ble_User
.
Tpms
_Updat
)
{
{
ID01
[
0
]
=
Ble_
Navi_Data
.
Navi
_Sts
;
ID01
[
0
]
=
Ble_
Tpms_Data
.
Tpms
_Sts
;
ID01
[
1
]
=
Ble_
Navi_Data
.
Navi
_Turn
;
ID01
[
1
]
=
Ble_
Tpms_Data
.
Tpms
_Turn
;
ID01
[
2
]
=
Ble_
Navi_Data
.
Navi
_Dte
[
0
];
ID01
[
2
]
=
Ble_
Tpms_Data
.
Tpms
_Dte
[
0
];
ID01
[
3
]
=
Ble_
Navi_Data
.
Navi
_Dte
[
1
];
ID01
[
3
]
=
Ble_
Tpms_Data
.
Tpms
_Dte
[
1
];
ID01
[
4
]
=
Ble_
Navi_Data
.
Navi
_Dte
[
2
];
ID01
[
4
]
=
Ble_
Tpms_Data
.
Tpms
_Dte
[
2
];
ID01
[
5
]
=
Ble_
Navi_Data
.
Navi
_Dte
[
3
];
ID01
[
5
]
=
Ble_
Tpms_Data
.
Tpms
_Dte
[
3
];
//printf("转向编码:%d\r\n",Ble_
Navi_Data.Navi
_Turn);
//printf("转向编码:%d\r\n",Ble_
Tpms_Data.Tpms
_Turn);
}
}
Protocol_Send
(
0x01
,
ID01
,
6
);
Protocol_Send
(
0x01
,
ID01
,
6
);
}
}
...
...
RT200T_2_ESP32/main/Protocol_User.h
View file @
4a77af30
...
@@ -4,15 +4,6 @@
...
@@ -4,15 +4,6 @@
#include "Protocol_Lib.h"
#include "Protocol_Lib.h"
#define BLE_START_STA 0x10
#define MCU_REPLY 0x20
#define BLE_NAVIGATION 0x01
#define BLE_WEATHER 0x02
#define BLE_LOCATION 0x03
#define BLE_STA 0x12
#define MCU_TO_BLE_INFO 0x21
void
Protocol_KL30_Wakeup_Init
(
void
);
void
Protocol_KL30_Wakeup_Init
(
void
);
void
Protocol_Send_Service
(
void
);
// 10ms任务调用
void
Protocol_Send_Service
(
void
);
// 10ms任务调用
void
UART_Put
(
Protocol_uint16_t
Data
);
void
UART_Put
(
Protocol_uint16_t
Data
);
...
...
RT200T_2_ESP32/main/app_Ble_User.c
View file @
4a77af30
...
@@ -34,7 +34,7 @@ SemaphoreHandle_t BleRecSuc_Semaphore;
...
@@ -34,7 +34,7 @@ SemaphoreHandle_t BleRecSuc_Semaphore;
Ble_User_Control_Struct
Ble_User
;
Ble_User_Control_Struct
Ble_User
;
Ble_
Navi_Info_Struct
Ble_Navi
_Data
;
Ble_
Tpms_Info_Struct
Ble_Tpms
_Data
;
uint8_t
tp_Ble_Crc
(
uint8_t
*
data
,
uint32_t
len
)
uint8_t
tp_Ble_Crc
(
uint8_t
*
data
,
uint32_t
len
)
...
@@ -320,7 +320,7 @@ void Ble_MsgRec_Authr_Result_Analysis(void )
...
@@ -320,7 +320,7 @@ void Ble_MsgRec_Authr_Result_Analysis(void )
if
(
BleRecData
.
Msg
.
Param
[
0
]
==
0
)
if
(
BleRecData
.
Msg
.
Param
[
0
]
==
0
)
{
{
Ble_User
.
Ble_Sts
=
Ble_Authr
;
Ble_User
.
Ble_Sts
=
Ble_Authr
;
Ble_User
.
Request_
Navi
=
1
;
Ble_User
.
Request_
Tpms
=
1
;
printf
(
"Authr suc
\n
"
);
printf
(
"Authr suc
\n
"
);
}
}
...
@@ -328,12 +328,12 @@ void Ble_MsgRec_Authr_Result_Analysis(void )
...
@@ -328,12 +328,12 @@ void Ble_MsgRec_Authr_Result_Analysis(void )
void
Ble_Msg_Request
Navi
_RLY
(
void
)
void
Ble_Msg_Request
Tpms
_RLY
(
void
)
{
{
uint8_t
total_frame
=
0
;
uint8_t
total_frame
=
0
;
uint8_t
trans_len
=
0
;
uint8_t
trans_len
=
0
;
if
(
Ble_User
.
Request_
Navi
)
if
(
Ble_User
.
Request_
Tpms
)
{
{
BleTransData
.
Msg
.
FrameHeader
=
0x24
;
BleTransData
.
Msg
.
FrameHeader
=
0x24
;
BleTransData
.
Msg
.
Cmd
=
0x14
;
BleTransData
.
Msg
.
Cmd
=
0x14
;
...
@@ -383,45 +383,45 @@ void Ble_Msg_RequestNavi_RLY(void )
...
@@ -383,45 +383,45 @@ void Ble_Msg_RequestNavi_RLY(void )
// vTaskDelay(1);
// vTaskDelay(1);
}
}
Ble_User
.
Request_
Navi
=
0
;
Ble_User
.
Request_
Tpms
=
0
;
}
}
}
}
void
Ble_MsgRec_
Navi
_Analysis
(
void
)
void
Ble_MsgRec_
Tpms
_Analysis
(
void
)
{
{
//
Navi
data
//
Tpms
data
Ble_
Navi_Data
.
Navi
_Sts
=
BleRecData
.
Msg
.
Param
[
0
];
Ble_
Tpms_Data
.
Tpms
_Sts
=
BleRecData
.
Msg
.
Param
[
0
];
Ble_
Navi_Data
.
Navi
_Turn
=
BleRecData
.
Msg
.
Param
[
1
];
Ble_
Tpms_Data
.
Tpms
_Turn
=
BleRecData
.
Msg
.
Param
[
1
];
Ble_
Navi_Data
.
Navi
_Dte
[
0
]
=
BleRecData
.
Msg
.
Param
[
2
];
Ble_
Tpms_Data
.
Tpms
_Dte
[
0
]
=
BleRecData
.
Msg
.
Param
[
2
];
Ble_
Navi_Data
.
Navi
_Dte
[
1
]
=
BleRecData
.
Msg
.
Param
[
3
];
Ble_
Tpms_Data
.
Tpms
_Dte
[
1
]
=
BleRecData
.
Msg
.
Param
[
3
];
Ble_
Navi_Data
.
Navi
_Dte
[
2
]
=
BleRecData
.
Msg
.
Param
[
4
];
Ble_
Tpms_Data
.
Tpms
_Dte
[
2
]
=
BleRecData
.
Msg
.
Param
[
4
];
Ble_
Navi_Data
.
Navi
_Dte
[
3
]
=
BleRecData
.
Msg
.
Param
[
5
];
Ble_
Tpms_Data
.
Tpms
_Dte
[
3
]
=
BleRecData
.
Msg
.
Param
[
5
];
printf
(
"
Navi sts %d Navi_Turn %x Navi_Dte0 %x Navi_Dte1 %x Navi_Dte2 %x Navi
_Dte3 %x
\r\n
"
,
\
printf
(
"
Tpms sts %d Tpms_Turn %x Tpms_Dte0 %x Tpms_Dte1 %x Tpms_Dte2 %x Tpms
_Dte3 %x
\r\n
"
,
\
Ble_
Navi_Data
.
Navi_Sts
,
Ble_Navi_Data
.
Navi_Turn
,
Ble_Navi_Data
.
Navi_Dte
[
0
],
Ble_Navi_Data
.
Navi_Dte
[
1
],
Ble_Navi_Data
.
Navi_Dte
[
2
],
Ble_Navi_Data
.
Navi
_Dte
[
3
]);
Ble_
Tpms_Data
.
Tpms_Sts
,
Ble_Tpms_Data
.
Tpms_Turn
,
Ble_Tpms_Data
.
Tpms_Dte
[
0
],
Ble_Tpms_Data
.
Tpms_Dte
[
1
],
Ble_Tpms_Data
.
Tpms_Dte
[
2
],
Ble_Tpms_Data
.
Tpms
_Dte
[
3
]);
Ble_User
.
Navi
_Updat
=
1
;
Ble_User
.
Tpms
_Updat
=
1
;
Ble_User
.
Navi
_T
=
0
;
Ble_User
.
Tpms
_T
=
0
;
}
}
void
Ble_MsgRec_
Navi
_Timeout
(
void
)
void
Ble_MsgRec_
Tpms
_Timeout
(
void
)
{
{
if
(
Ble_User
.
Navi
_Updat
)
if
(
Ble_User
.
Tpms
_Updat
)
{
{
Ble_User
.
Navi
_T
++
;
Ble_User
.
Tpms
_T
++
;
if
(
Ble_User
.
Navi
_T
>=
100
)
if
(
Ble_User
.
Tpms
_T
>=
100
)
{
{
Ble_User
.
Navi
_Updat
=
0
;
Ble_User
.
Tpms
_Updat
=
0
;
Ble_User
.
Navi
_T
=
0
;
Ble_User
.
Tpms
_T
=
0
;
}
}
}
}
else
else
{
{
Ble_User
.
Navi
_T
=
0
;
Ble_User
.
Tpms
_T
=
0
;
}
}
}
}
...
@@ -437,9 +437,9 @@ void Ble_Rec_Msg_Analysis_Process(void )
...
@@ -437,9 +437,9 @@ void Ble_Rec_Msg_Analysis_Process(void )
void
Ble_Connect_Event_Pro
(
void
)
void
Ble_Connect_Event_Pro
(
void
)
{
{
Ble_User
.
Ble_Sts
=
Ble_Conn
;
Ble_User
.
Ble_Sts
=
Ble_Conn
;
Ble_User
.
Request_
Navi
=
0
;
Ble_User
.
Request_
Tpms
=
0
;
Ble_User
.
Navi
_Updat
=
0
;
Ble_User
.
Tpms
_Updat
=
0
;
Ble_User
.
Navi
_T
=
0
;
Ble_User
.
Tpms
_T
=
0
;
Ble_Clear_Tx_Buffer
();
Ble_Clear_Tx_Buffer
();
Ble_Clear_Rx_Buffer
();
Ble_Clear_Rx_Buffer
();
...
@@ -449,19 +449,19 @@ void Ble_Connect_Event_Pro(void )
...
@@ -449,19 +449,19 @@ void Ble_Connect_Event_Pro(void )
void
Ble_DisConnect_Event_Pro
(
void
)
void
Ble_DisConnect_Event_Pro
(
void
)
{
{
Ble_User
.
Ble_Sts
=
Ble_Idle
;
Ble_User
.
Ble_Sts
=
Ble_Idle
;
Ble_User
.
Request_
Navi
=
0
;
Ble_User
.
Request_
Tpms
=
0
;
Ble_User
.
Navi
_Updat
=
0
;
Ble_User
.
Tpms
_Updat
=
0
;
Ble_User
.
Navi
_T
=
0
;
Ble_User
.
Tpms
_T
=
0
;
RecCtrl
.
RecLen
=
0
;
RecCtrl
.
RecLen
=
0
;
RecCtrl
.
TotalLen
=
0
;
RecCtrl
.
TotalLen
=
0
;
RecCtrl
.
Sts
=
BleRec_Idle
;
RecCtrl
.
Sts
=
BleRec_Idle
;
Ble_
Navi_Data
.
Navi
_Sts
=
0
;
Ble_
Tpms_Data
.
Tpms
_Sts
=
0
;
Ble_
Navi_Data
.
Navi
_Turn
=
0
;
Ble_
Tpms_Data
.
Tpms
_Turn
=
0
;
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
Ble_
Navi_Data
.
Navi
_Dte
);
i
++
)
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
Ble_
Tpms_Data
.
Tpms
_Dte
);
i
++
)
{
{
Ble_
Navi_Data
.
Navi
_Dte
[
i
]
=
0
;
Ble_
Tpms_Data
.
Tpms
_Dte
[
i
]
=
0
;
}
}
...
@@ -487,11 +487,11 @@ void Ble_User_Task(void *pvParameter)
...
@@ -487,11 +487,11 @@ void Ble_User_Task(void *pvParameter)
else
if
(
BleRecData
.
Msg
.
Cmd
==
EC_BTP_P2C_CHECK_AUTH_RESULT
)
else
if
(
BleRecData
.
Msg
.
Cmd
==
EC_BTP_P2C_CHECK_AUTH_RESULT
)
{
{
Ble_MsgRec_Authr_Result_Analysis
();
Ble_MsgRec_Authr_Result_Analysis
();
Ble_Msg_Request
Navi
_RLY
();
Ble_Msg_Request
Tpms
_RLY
();
}
}
else
if
(
BleRecData
.
Msg
.
Cmd
==
EC_BTP_P2C_HUD
)
else
if
(
BleRecData
.
Msg
.
Cmd
==
EC_BTP_P2C_HUD
)
{
{
Ble_MsgRec_
Navi
_Analysis
();
Ble_MsgRec_
Tpms
_Analysis
();
}
}
Ble_Clear_Tx_Buffer
();
Ble_Clear_Tx_Buffer
();
...
@@ -508,20 +508,20 @@ void Ble_User_Init(void )
...
@@ -508,20 +508,20 @@ void Ble_User_Init(void )
BleRecSuc_Semaphore
=
xSemaphoreCreateBinary
();
BleRecSuc_Semaphore
=
xSemaphoreCreateBinary
();
Ble_User
.
Ble_Sts
=
Ble_Idle
;
Ble_User
.
Ble_Sts
=
Ble_Idle
;
Ble_User
.
Request_
Navi
=
0
;
Ble_User
.
Request_
Tpms
=
0
;
Ble_User
.
Navi
_Updat
=
0
;
Ble_User
.
Tpms
_Updat
=
0
;
Ble_User
.
Navi
_T
=
0
;
Ble_User
.
Tpms
_T
=
0
;
Ble_User
.
UseridUpdate
=
0
;
Ble_User
.
UseridUpdate
=
0
;
RecCtrl
.
RecLen
=
0
;
RecCtrl
.
RecLen
=
0
;
RecCtrl
.
TotalLen
=
0
;
RecCtrl
.
TotalLen
=
0
;
RecCtrl
.
Sts
=
BleRec_Idle
;
RecCtrl
.
Sts
=
BleRec_Idle
;
Ble_
Navi_Data
.
Navi
_Sts
=
0
;
Ble_
Tpms_Data
.
Tpms
_Sts
=
0
;
Ble_
Navi_Data
.
Navi
_Turn
=
0
;
Ble_
Tpms_Data
.
Tpms
_Turn
=
0
;
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
Ble_
Navi_Data
.
Navi
_Dte
);
i
++
)
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
Ble_
Tpms_Data
.
Tpms
_Dte
);
i
++
)
{
{
Ble_
Navi_Data
.
Navi
_Dte
[
i
]
=
0
;
Ble_
Tpms_Data
.
Tpms
_Dte
[
i
]
=
0
;
}
}
...
...
RT200T_2_ESP32/main/app_Ble_User.h
View file @
4a77af30
This diff is collapsed.
Click to expand it.
RT200T_2_ESP32/main/main_user.c
View file @
4a77af30
...
@@ -80,7 +80,7 @@ static void Sys_Run_Tasks(void *arg)
...
@@ -80,7 +80,7 @@ static void Sys_Run_Tasks(void *arg)
if
(
SYS_RUN_TASK_100MS
)
if
(
SYS_RUN_TASK_100MS
)
{
{
Ble_MsgRec_
Navi
_Timeout
();
Ble_MsgRec_
Tpms
_Timeout
();
}
}
if
(
SYS_RUN_TASK_1000MS
)
if
(
SYS_RUN_TASK_1000MS
)
...
@@ -98,12 +98,12 @@ static void Sys_Run_Tasks(void *arg)
...
@@ -98,12 +98,12 @@ static void Sys_Run_Tasks(void *arg)
// esp_log_buffer_hex(TAG, peer_addr, 6);
// esp_log_buffer_hex(TAG, peer_addr, 6);
// printf("Ble_User.
Navi_Updat = %d\r\n", Ble_User.Navi
_Updat);
// printf("Ble_User.
Tpms_Updat = %d\r\n", Ble_User.Tpms
_Updat);
// printf("RecCtrl.Sts = %d\r\n", RecCtrl.Sts);
// printf("RecCtrl.Sts = %d\r\n", RecCtrl.Sts);
// Ble_Msg_Request
Navi
_RLY();
// Ble_Msg_Request
Tpms
_RLY();
...
...
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