From 576b10ede16e3082a9b7e3a83c0985ff8a965ab1 Mon Sep 17 00:00:00 2001 From: xiaojiazhu <258828110@qq.com> Date: Fri, 3 Nov 2023 19:37:38 +0800 Subject: [PATCH] Fixed wifi and bluetooth status show bug. --- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 36 ++++++++++--------- .../sifar/code/source/common/sf_common.c | 2 ++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index fec978b6d..420d2408a 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c @@ -486,20 +486,21 @@ static void update_camera_message(void) static void update_wifi(void) { + // SF_WIFI_OK = 0x01,/*wifi start success*/ + // SF_WIFI_CON, /*wifi has been connected*/ + // SF_WIFI_FAIL, /*wifi start fail*/ + // SF_WIFI_BUTT, const int EMPTY_IMAGE = 0; SF_WIFI_STATUS_E status = sf_get_wifi_status(); lv_plugin_res_id res[] = { EMPTY_IMAGE, - LV_PLUGIN_IMG_ID_SF_WIFI_UNCONNECTED, + LV_PLUGIN_IMG_ID_SF_WIFI_UNSUPPORT, LV_PLUGIN_IMG_ID_SF_WIFI_CONNECTED, - LV_PLUGIN_IMG_ID_SF_WIFI_UNSUPPORT + LV_PLUGIN_IMG_ID_SF_WIFI_UNCONNECTED }; - const int WIFI_NOT_INIT = 0; - const int WIFI_UNCONNECTED = 1; - const int WIFI_UNSUPPORT = 3; - if (WIFI_NOT_INIT == status - || status < WIFI_UNCONNECTED - || status > WIFI_UNSUPPORT) + if (SF_WIFI_BUTT == status + || status < SF_WIFI_OK + || status > SF_WIFI_FAIL) { lv_obj_set_hidden(image_wifi_connected_scr_uiflowphoto, true); return; @@ -511,20 +512,21 @@ static void update_wifi(void) static void update_bluetooth(void) { + // SF_BLE_OK = 0x01,/*BLE start success*/ + // SF_BLE_CON, /*BLE has been connected*/ + // SF_BLE_FAIL, /*BLE start fail*/ + // SF_BLE_BUTT, const int EMPTY_IMAGE = 0; - SF_WIFI_STATUS_E status = sf_get_wifi_status(); + SF_BLE_STATUS_E status = sf_get_ble_status(); lv_plugin_res_id res[] = { EMPTY_IMAGE, - LV_PLUGIN_IMG_ID_SF_BLUETOOTH_UNCONNECTED, + LV_PLUGIN_IMG_ID_SF_BLUETOOTH_UNSUPPORT, LV_PLUGIN_IMG_ID_SF_BLUETOOTH_CONNECTED, - LV_PLUGIN_IMG_ID_SF_BLUETOOTH_UNSUPPORT + LV_PLUGIN_IMG_ID_SF_BLUETOOTH_UNCONNECTED }; - const int WIFI_NOT_INIT = 0; - const int WIFI_UNCONNECTED = 1; - const int WIFI_UNSUPPORT = 3; - if (WIFI_NOT_INIT == status - || status < WIFI_UNCONNECTED - || status > WIFI_UNSUPPORT) + if (SF_BLE_BUTT == status + || status < SF_BLE_OK + || status > SF_BLE_FAIL) { lv_obj_set_hidden(image_bluetooth_connected_scr_uiflowphoto, true); return; diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index 45782f4f2..bfcdeeacd 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -1706,6 +1706,8 @@ static SINT32 sf_cardv_proccess_cmd_para_update(SF_MESSAGE_BUF_S *pMessageBuf) sf_cardv_para_signaling_start(); break; case SF_PARA_CMD_BLE: + sf_set_ble_status(pMessageBuf->arg2); + break; case SF_PARA_CMD_SIMISINSERT: sf_cardv_set_sim_insert(pMessageBuf->arg2);