Commit 7ec8c92a authored by 郑萍's avatar 郑萍

🐞 fix:57353 【润通RT200T-2低配】【蓝牙】手机端断开蓝牙连接几秒后,仪表重新连接手机蓝牙 并更改版本号为102

parent 32ba1edc
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "gcc",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
\ No newline at end of file
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "d:/ESP32/esp-idf/CarProess/rt200t_esp32/RT200T_2_ESP32/main",
"program": "d:/ESP32/esp-idf/CarProess/rt200t_esp32/RT200T_2_ESP32/main/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
\ No newline at end of file
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
\ No newline at end of file
...@@ -327,7 +327,7 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型 ...@@ -327,7 +327,7 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
uint8_t ID12[2] = {0}; uint8_t ID12[2] = {0};
ID12[0] |= (uint8_t)(BT_User.BT_Sts << 4);//经典 ID12[0] |= (uint8_t)(BT_User.BT_Sts << 4);//经典
ID12[0] |= Ble_User.Ble_Sts;//ble ID12[0] |= Ble_User.Ble_Sts;//ble
ID12[1] = 101;//esp32软件版本号 ID12[1] = 102;//esp32软件版本号
Protocol_Send(0x12, ID12, 2); Protocol_Send(0x12, ID12, 2);
} }
......
...@@ -92,7 +92,7 @@ void BT_User_Process(void ) ...@@ -92,7 +92,7 @@ void BT_User_Process(void )
//if(BTConnectFlag == 0) //if(BTConnectFlag == 0)
{ {
//BTConnectFlag = 1; //BTConnectFlag = 1;
if(app_BT_Get_BondDev() == 1) if((app_BT_Get_BondDev() == 1) && (g_bt_connectnum != 0x113u))
{ {
esp_hf_client_connect(peer_addr); esp_hf_client_connect(peer_addr);
} }
......
...@@ -253,14 +253,6 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -253,14 +253,6 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
param->conn_stat.chld_feat); param->conn_stat.chld_feat);
memcpy(peer_addr,param->conn_stat.remote_bda,ESP_BD_ADDR_LEN); memcpy(peer_addr,param->conn_stat.remote_bda,ESP_BD_ADDR_LEN);
if(param->conn_stat.state == 0)
{
BT_DisConnect_Event_Pro();
}
else if(param->conn_stat.state == 2)
{
BT_Connect_Event_Pro();
}
break; break;
} }
...@@ -353,7 +345,7 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -353,7 +345,7 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
{ {
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]);
esp_hf_client_query_current_calls();
switch(param->call_setup.status) switch(param->call_setup.status)
{ {
case 0: case 0:
......
...@@ -33,6 +33,7 @@ static char peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; ...@@ -33,6 +33,7 @@ static char peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1];
static uint8_t peer_bdname_len; static uint8_t peer_bdname_len;
int bond_dev_num; int bond_dev_num;
int last_bond_dev_num = -1; int last_bond_dev_num = -1;
uint32_t g_bt_connectnum = 0;
// esp_bt_gap_remove_bond_device // esp_bt_gap_remove_bond_device
...@@ -114,6 +115,7 @@ static bool get_name_from_eir(uint8_t *eir, char *bdname, uint8_t *bdname_len) ...@@ -114,6 +115,7 @@ static bool get_name_from_eir(uint8_t *eir, char *bdname, uint8_t *bdname_len)
void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param) void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param)
{ {
uint8_t *bda = NULL;
switch (event) { switch (event) {
case ESP_BT_GAP_DISC_RES_EVT: { case ESP_BT_GAP_DISC_RES_EVT: {
// esp_hf_client_connect(peer_addr); // esp_hf_client_connect(peer_addr);
...@@ -180,6 +182,30 @@ void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param) ...@@ -180,6 +182,30 @@ 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); // printf("event state %d\n", event);
break; break;
case ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT:
bda = (uint8_t*)param->acl_conn_cmpl_stat.bda;
// ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT Connected to [%02x:%02x:%02x:%02x:%02x:%02x], status: 0x%x",
// bda[0], bda[1], bda[2], bda[3], bda[4], bda[5], param->acl_conn_cmpl_stat.stat);
g_bt_connectnum = 0;
BT_Connect_Event_Pro();
printf("ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT \n");
// Bt_User_Data.Bluetooth_Status = BLUETOOTH_CONNECT;
break;
// /* when ACL disconnection completed, this event comes */
case ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT:
bda = (uint8_t*)param->acl_disconn_cmpl_stat.bda;
// ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_ACL_DISC_CMPL_STAT_EVT Disconnected from [%02x:%02x:%02x:%02x:%02x:%02x], reason: 0x%x",
// bda[0], bda[1], bda[2], bda[3], bda[4], bda[5], param->acl_disconn_cmpl_stat.reason);
printf("param->acl_disconn_cmpl_stat.reason %x \n", param->acl_disconn_cmpl_stat.reason);
g_bt_connectnum = param->acl_disconn_cmpl_stat.reason;
BT_DisConnect_Event_Pro();
// Bt_User_Data.Disconnect_Event = param->acl_disconn_cmpl_stat.reason;
// Bt_User_Data.Bluetooth_Status = BLUETOOTH_DISCONNECT
;
printf("ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT \n");
break;
default: { default: {
ESP_LOGI(BT_HF_TAG, "event: %d", event); ESP_LOGI(BT_HF_TAG, "event: %d", event);
// printf("event state %d\n", event); // printf("event state %d\n", event);
...@@ -199,6 +225,7 @@ static void bt_hf_client_hdl_stack_evt(uint16_t event, void *p_param); ...@@ -199,6 +225,7 @@ static void bt_hf_client_hdl_stack_evt(uint16_t event, void *p_param);
void bsp_BT_Init(void) void bsp_BT_Init(void)
{ {
g_bt_connectnum = 0;
/* Initialize NVS — it is used to store PHY calibration data */ /* Initialize NVS — it is used to store PHY calibration data */
esp_err_t ret = nvs_flash_init(); esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) { if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#ifndef BT_APP_MAN_H #ifndef BT_APP_MAN_H
#define BT_APP_MAN_H #define BT_APP_MAN_H
extern uint32_t g_bt_connectnum;
void bsp_BT_Init(void); void bsp_BT_Init(void);
uint8_t app_BT_Get_BondDev(void ); uint8_t app_BT_Get_BondDev(void );
void app_tpms_main(void); void app_tpms_main(void);
......
...@@ -388,9 +388,9 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par ...@@ -388,9 +388,9 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
(scan_result->scan_rst.ble_adv[7] == 0x4D)&& (scan_result->scan_rst.ble_adv[7] == 0x4D)&&
(scan_result->scan_rst.ble_adv[8] == 0x53)) (scan_result->scan_rst.ble_adv[8] == 0x53))
{ {
//esp_log_buffer_hex("tpms",scan_result->scan_rst.ble_adv,scan_result->scan_rst.adv_data_len); esp_log_buffer_hex("tpms",scan_result->scan_rst.ble_adv,scan_result->scan_rst.adv_data_len);
//printf("99999999999999999999999999 \r\n"); // printf("99999999999999999999999999 \r\n");
// ID01_Len = scan_result->scan_rst.adv_data_len; // // ID01_Len = scan_result->scan_rst.adv_data_len;
// for(i = 0; i < scan_result->scan_rst.adv_data_len; i++) // for(i = 0; i < scan_result->scan_rst.adv_data_len; i++)
// { // {
// ID01[i] = scan_result->scan_rst.ble_adv[i]; // ID01[i] = scan_result->scan_rst.ble_adv[i];
......
...@@ -93,7 +93,7 @@ static void Sys_Run_Tasks(void *arg) ...@@ -93,7 +93,7 @@ static void Sys_Run_Tasks(void *arg)
if(SYS_RUN_TASK_1000MS) if(SYS_RUN_TASK_1000MS)
{ {
esp_hf_client_query_current_calls(); // esp_hf_client_query_current_calls();
// simple_ota_service(); // simple_ota_service();
......
...@@ -211,13 +211,13 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y ...@@ -211,13 +211,13 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y # CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
CONFIG_BOOTLOADER_LOG_LEVEL=3 CONFIG_BOOTLOADER_LOG_LEVEL=0
# #
# Serial Flash Configurations # Serial Flash Configurations
...@@ -1900,13 +1900,13 @@ CONFIG_WPA_MBEDTLS_TLS_CLIENT=y ...@@ -1900,13 +1900,13 @@ CONFIG_WPA_MBEDTLS_TLS_CLIENT=y
# CONFIG_ESP32_NO_BLOBS is not set # CONFIG_ESP32_NO_BLOBS is not set
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set # CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y # CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
CONFIG_LOG_BOOTLOADER_LEVEL=3 CONFIG_LOG_BOOTLOADER_LEVEL=0
# CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_APP_ROLLBACK_ENABLE is not set
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set
# CONFIG_FLASHMODE_QIO is not set # CONFIG_FLASHMODE_QIO is not set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment