Commit 9ac078a8 authored by 薛小虎's avatar 薛小虎

feat: 添加蓝牙反初始化函数,OTA前卸载蓝牙。内部版本号升级

parent 99dd5a82
...@@ -271,8 +271,9 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData) ...@@ -271,8 +271,9 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
// { // {
if(Wifi_OTA_Request == 0) if(Wifi_OTA_Request == 0)
{ {
app_ble_stop();
Wifi_OTA_Request = 1; Wifi_OTA_Request = 1;
// printf("get ota req! \r\n"); printf("get ota req! \r\n");
} }
// } // }
} }
......
...@@ -132,6 +132,35 @@ void simple_ota_service(void) ...@@ -132,6 +132,35 @@ void simple_ota_service(void)
int app_ble_stop(void)
{
esp_err_t err;
err = esp_bluedroid_disable();
if (err != ESP_OK) {
return ESP_FAIL;
}
err = esp_bluedroid_deinit();
if (err != ESP_OK) {
return err;
}
err = esp_bt_controller_disable();
if (err != ESP_OK) {
return ESP_FAIL;
}
/* The API `esp_bt_controller_deinit` will have to be removed when we add support for
* `reset to provisioning`
*/
err = esp_bt_controller_deinit();
if (err != ESP_OK) {
return ESP_FAIL;
}
return ESP_OK;
}
......
...@@ -80,4 +80,5 @@ extern uint8_t BT_Device_Name[14]; ...@@ -80,4 +80,5 @@ extern uint8_t BT_Device_Name[14];
void Get_Mac_Init(void ); void Get_Mac_Init(void );
extern int bsp_Uart_Send_Data(uint8_t * data , unsigned int len); extern int bsp_Uart_Send_Data(uint8_t * data , unsigned int len);
extern uint8_t BT_Device_Name[14]; extern uint8_t BT_Device_Name[14];
int app_ble_stop(void);
#endif #endif
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#define BL_INTERNAL_SW_YEAR 24 #define BL_INTERNAL_SW_YEAR 24
#define BL_INTERNAL_SW_MONTH 7 #define BL_INTERNAL_SW_MONTH 7
#define BL_INTERNAL_SW_DAY 25 #define BL_INTERNAL_SW_DAY 26
#endif #endif
\ No newline at end of file
bootloader.bin bootloader.bin
ota_data_initial.bin ota_data_initial.bin
partition-table.bin partition-table.bin
QJ-70000PBS0002-ESP32-BootApp-S1.1-240711.bin QJ-70000PBS0002-ESP32-BootApp-S240726-240726.bin
是用下载器给仪表下载的工程文件; 是用下载器给仪表下载的工程文件;
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