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
68c9a9f1
Commit
68c9a9f1
authored
Jun 05, 2024
by
李茂军
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
2fc7171c
79378b94
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
530 additions
and
90 deletions
+530
-90
RT200T-2_partitions_two_ota.csv
RT200T_2_ESP32/RT200T-2_partitions_two_ota.csv
+0
-0
CMakeLists.txt
RT200T_2_ESP32/main/CMakeLists.txt
+1
-0
Protocol_User.c
RT200T_2_ESP32/main/Protocol_User.c
+33
-25
app_Ble_User.c
RT200T_2_ESP32/main/app_Ble_User.c
+1
-56
bt_app_main.h
RT200T_2_ESP32/main/bt_app_main.h
+1
-0
gattc_demo.c
RT200T_2_ESP32/main/gattc_demo.c
+484
-0
main_user.c
RT200T_2_ESP32/main/main_user.c
+6
-5
sdkconfig
RT200T_2_ESP32/sdkconfig
+4
-4
No files found.
RT200T_2_ESP32/
QJ500_7C
_partitions_two_ota.csv
→
RT200T_2_ESP32/
RT200T-2
_partitions_two_ota.csv
View file @
68c9a9f1
File moved
RT200T_2_ESP32/main/CMakeLists.txt
View file @
68c9a9f1
...
...
@@ -9,5 +9,6 @@ idf_component_register(SRCS "mcudata.c" "app_BT_User.c" "bt_app_main.c" "bt_app_
"app_Ble_User.c"
"main_user.c"
"../source/wifi"
"gattc_demo.c"
INCLUDE_DIRS
"."
EMBED_TXTFILES
${
project_dir
}
/server_certs/ca_cert.pem
)
RT200T_2_ESP32/main/Protocol_User.c
View file @
68c9a9f1
...
...
@@ -215,7 +215,7 @@ extern void wifiServiceStart(void);
uint32_t
SwitchMode
=
0
;
static
void
Protocol_UartHandle
(
const
Protocol_Data_t
*
pData
)
//esp接收底板数据
{
if
(
pData
->
CmdID
==
0x20
)
//收到底板发送的数据后,
传状态
if
(
pData
->
CmdID
==
0x20
)
//收到底板发送的数据后,
才会发送0x12,0x01,0x02的id
{
//printf("0x20 is get\r\n");
if
(
Prot_User
.
State
<
Prot_Start
)
...
...
@@ -243,22 +243,22 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
BT_User
.
HF_Ctrl
=
pData
->
Data
[
0
];
//esp32接收到的数据
}
if
(
strncmp
((
const
char
*
)
ble_uerid
,
(
const
char
*
)
&
(
pData
->
Data
[
1
]),
32
)
!=
0
)
{
memcpy
((
uint8_t
*
)
ble_uerid
,
(
uint8_t
*
)
&
(
pData
->
Data
[
1
]),
32
);
}
//
if(strncmp((const char *) ble_uerid, (const char *)&(pData->Data[1]), 32) != 0)
//
{
//
memcpy(( uint8_t * )ble_uerid, (uint8_t *)&(pData->Data[1]), 32);
//
}
// esp_log_buffer_hex(TAG, ble_uerid, 32);
// esp_log_buffer_hex(TAG, &(pData->Data[1]), 32);
//
//
esp_log_buffer_hex(TAG, ble_uerid, 32);
//
//
esp_log_buffer_hex(TAG, &(pData->Data[1]), 32);
if
(
Ble_User
.
UseridUpdate
==
0
)
{
bsp_Ble_Init
();
//
if(Ble_User.UseridUpdate == 0)
//
{
//
bsp_Ble_Init();
printf
(
"get uuid and init ble!!!
\r\n
"
);
}
//
printf("get uuid and init ble!!! \r\n");
//
}
Ble_User
.
UseridUpdate
=
0xAA
;
//
Ble_User.UseridUpdate = 0xAA;
}
}
}
...
...
@@ -334,19 +334,26 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
void
Uart_Send_Id01_Pro
(
void
)
{
uint8_t
ID01
[
6
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
if
(
Ble_User
.
Tpms_Updat
)
uint8_t
ID01
[
7
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
//
if(Ble_User.Tpms_Updat)
{
ID01
[
0
]
=
Ble_Tpms_Data
.
Tpms_Sts
;
ID01
[
1
]
=
Ble_Tpms_Data
.
Tpms_Turn
;
ID01
[
2
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
0
];
ID01
[
3
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
1
];
ID01
[
4
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
2
];
ID01
[
5
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
3
];
// ID01[0] = Ble_Tpms_Data.Tpms_Sts;
// ID01[1] = Ble_Tpms_Data.Tpms_Turn;
// ID01[2] = Ble_Tpms_Data.Tpms_Dte[0];
// ID01[3] = Ble_Tpms_Data.Tpms_Dte[1];
// ID01[4] = Ble_Tpms_Data.Tpms_Dte[2];
// ID01[5] = Ble_Tpms_Data.Tpms_Dte[3];
ID01
[
0
]
=
0xFF
;
//胎压状态
ID01
[
1
]
=
1
;
//前轮高字节气压值
ID01
[
2
]
=
200
;
//前轮低字节气压值
ID01
[
3
]
=
0x28
;
//前轮胎压温度
ID01
[
4
]
=
1
;
//后轮高字节气压值
ID01
[
5
]
=
45
;
//后轮低字节气压值
ID01
[
6
]
=
0xAB
;
//后轮胎压温度
//printf("转向编码:%d\r\n",Ble_Tpms_Data.Tpms_Turn);
}
Protocol_Send
(
0x01
,
ID01
,
6
);
Protocol_Send
(
0x01
,
ID01
,
7
);
}
...
...
@@ -369,20 +376,21 @@ void Prot_Send_Msg_Process(void )
// printf("send 0x10 \r\n");
}
if
(
Prot_User
.
State
>=
Prot_Start
)
//printf("Prot_User.State = %d\r\n",Prot_User.State);
if
(
Prot_User
.
State
>=
Prot_Start
)
//收到底板发送的0x20后,才执行
{
if
(
Prot_User
.
TimeDelay
==
0
)
{
Uart_Send_Id12_Pro
();
Prot_User
.
TimeDelay
++
;
//
printf("send 0x12 \r\n");
//printf("send 0x12 \r\n");
}
else
{
Uart_Send_Id01_Pro
();
Uart_Send_Id02_Pro
();
Prot_User
.
TimeDelay
=
0
;
//printf("send 0x01 0x02 \r\n");
//printf("send 0x01 0x02 \r\n");
}
}
}
...
...
RT200T_2_ESP32/main/app_Ble_User.c
View file @
68c9a9f1
...
...
@@ -75,62 +75,7 @@ uint8_t Ble_Get_User_Info(void )
{
uint8_t
i
=
0
;
uint8_t
ret
=
0
;
// for(i = 24; i<32;i++)
// {
// ble_uerid[i] = 0x30+i-24;
// ble_pwd[i] = 0x30+i-24;
// }
// ble_uerid[0] = 'v';
// ble_uerid[1] = 'i';
// ble_uerid[2] = 'v';
// ble_uerid[3] = 'a';
// ble_uerid[4] = 'v';
// ble_uerid[5] = 'i';
// ble_uerid[6] = 'v';
// ble_uerid[7] = 'a';
// ble_uerid[8] = 'v';
// ble_uerid[9] = 'i';
// ble_uerid[10] = 'v';
// ble_uerid[11] = 'a';
// ble_uerid[12] = 'v';
// ble_uerid[13] = 'i';
// ble_uerid[14] = 'v';
// ble_uerid[15] = 'a';
// ble_uerid[16] = 'v';
// ble_uerid[17] = 'i';
// ble_uerid[18] = 'v';
// ble_uerid[19] = 'a';
// ble_uerid[20] = 'v';
// ble_uerid[21] = 'i';
// ble_uerid[22] = 'v';
// ble_uerid[23] = 'a';
// ble_pwd[0] = 'C';
// ble_pwd[1] = 'C';
// ble_pwd[2] = 'N';
// ble_pwd[3] = 'C';
// ble_pwd[4] = 'v';
// ble_pwd[5] = 'i';
// ble_pwd[6] = 'v';
// ble_pwd[7] = 'a';
// ble_pwd[8] = 'v';
// ble_pwd[9] = 'i';
// ble_pwd[10] = 'v';
// ble_pwd[11] = 'a';
// ble_pwd[12] = 'v';
// ble_pwd[13] = 'i';
// ble_pwd[14] = 'v';
// ble_pwd[15] = 'a';
// ble_pwd[16] = 'v';
// ble_pwd[17] = 'i';
// ble_pwd[18] = 'v';
// ble_pwd[19] = 'a';
// ble_pwd[20] = 'v';
// ble_pwd[21] = 'i';
// ble_pwd[22] = 'v';
// ble_pwd[23] = 'a';
if
(
Ble_User
.
UseridUpdate
)
{
...
...
RT200T_2_ESP32/main/bt_app_main.h
View file @
68c9a9f1
...
...
@@ -9,4 +9,5 @@
void
bsp_BT_Init
(
void
);
uint8_t
app_BT_Get_BondDev
(
void
);
void
app_tpms_main
(
void
);
#endif
\ No newline at end of file
RT200T_2_ESP32/main/gattc_demo.c
0 → 100644
View file @
68c9a9f1
This diff is collapsed.
Click to expand it.
RT200T_2_ESP32/main/main_user.c
View file @
68c9a9f1
...
...
@@ -155,7 +155,8 @@ void app_main(void)
Ble_User_Init
();
Get_Mac_Init
();
bsp_BT_Init
();
bsp_Ble_Init
();
// bsp_Ble_Init();
app_tpms_main
();
bsp_Uart_Init
();
printf
(
"KL30 INIT OVER~~~~~~
\r\n
"
);
...
...
@@ -167,8 +168,8 @@ void app_main(void)
void
delele_tasks
(
void
)
{
vTaskSuspend
(
Sys_Run_Taskshdl
);
vTaskSuspend
(
Ble_User_Task_hdl
);
bt_app_task_shut_down
(
);
vTaskDelay
(
pdMS_TO_TICKS
(
100
));
//
vTaskSuspend(Sys_Run_Taskshdl);
//
vTaskSuspend(Ble_User_Task_hdl);
//
bt_app_task_shut_down( );
//
vTaskDelay(pdMS_TO_TICKS(100));
}
RT200T_2_ESP32/sdkconfig
View file @
68c9a9f1
...
...
@@ -308,8 +308,8 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="
QJ500_7C
_partitions_two_ota.csv"
CONFIG_PARTITION_TABLE_FILENAME="
QJ500_7C
_partitions_two_ota.csv"
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="
RT200T-2
_partitions_two_ota.csv"
CONFIG_PARTITION_TABLE_FILENAME="
RT200T-2
_partitions_two_ota.csv"
CONFIG_PARTITION_TABLE_OFFSET=0xA000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table
...
...
@@ -317,7 +317,7 @@ CONFIG_PARTITION_TABLE_MD5=y
#
# Example Configuration
#
CONFIG_EXAMPLE_FIRMWARE_UPGRADE_URL="http://192.168.137.1:3200/
Qj500-7C
.bin"
CONFIG_EXAMPLE_FIRMWARE_UPGRADE_URL="http://192.168.137.1:3200/
RT200T-2
.bin"
# CONFIG_EXAMPLE_USE_CERT_BUNDLE is not set
CONFIG_EXAMPLE_SKIP_COMMON_NAME_CHECK=y
# CONFIG_EXAMPLE_FIRMWARE_UPGRADE_BIND_IF is not set
...
...
@@ -1355,7 +1355,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="
QJ500-7C
"
CONFIG_LWIP_LOCAL_HOSTNAME="
RT200T-2
"
# CONFIG_LWIP_NETIF_API is not set
CONFIG_LWIP_TCPIP_TASK_PRIO=18
# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set
...
...
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