Fix ota percent update for ui

This commit is contained in:
Sebastien
2019-09-28 14:41:11 -04:00
parent 7f5f7b55aa
commit e45ee97a43
3 changed files with 22 additions and 5 deletions

View File

@@ -129,7 +129,9 @@ const int WIFI_MANAGER_SCAN_BIT = BIT7;
const int WIFI_MANAGER_REQUEST_DISCONNECT_BIT = BIT8;
void wifi_manager_refresh_ota_json(){
wifi_manager_send_message(EVENT_REFRESH_OTA, NULL);
}
void wifi_manager_scan_async(){
wifi_manager_send_message(ORDER_START_WIFI_SCAN, NULL);
@@ -1131,9 +1133,15 @@ void wifi_manager( void * pvParameters ){
/* callback */
if(cb_ptr_arr[msg.code]) (*cb_ptr_arr[msg.code])(NULL);
break;
case UPDATE_CONNECTION_OK:
/* refresh JSON with the new ota data */
if(wifi_manager_lock_json_buffer( portMAX_DELAY )){
/* generate the connection info with success */
wifi_manager_generate_ip_info_json( UPDATE_CONNECTION_OK );
wifi_manager_unlock_json_buffer();
}
break;
case ORDER_DISCONNECT_STA:
ESP_LOGI(TAG, "MESSAGE: ORDER_DISCONNECT_STA");

View File

@@ -212,7 +212,8 @@ typedef enum message_code_t {
EVENT_STA_DISCONNECTED = 12,
EVENT_SCAN_DONE = 13,
EVENT_STA_GOT_IP = 14,
MESSAGE_CODE_COUNT = 15 /* important for the callback array */
EVENT_REFRESH_OTA = 15,
MESSAGE_CODE_COUNT = 16 /* important for the callback array */
}message_code_t;