From a60cfa1acff5886596957a6a4cb2174959608d02 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 14 Nov 2023 19:22:35 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9B=B4=E6=94=B9gps=20=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/PrjCfg_HUNTING_S550.h | 4 +- .../UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h | 4 +- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 7 +- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h | 8 ++ .../source/sf_app/code/include/sf_ftp.h | 1 + .../source/sf_app/code/include/sf_sms.h | 4 + .../source/sf_app/code/source/4gMng/sf_ftp.c | 77 ++++++++++++ .../source/sf_app/code/source/4gMng/sf_sms.c | 43 ++++++- .../sf_app/code/source/app/sf_service.c | 63 ++++++++-- .../code/source/paramMng/sf_param_common.c | 6 +- .../code/source/sf_blue/src/sf_blue_app.c | 110 +++++++++--------- .../code/source/systemMng/sf_commu_mcu_reg.c | 27 +++-- .../UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h | 2 +- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 7 +- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h | 8 ++ 15 files changed, 277 insertions(+), 94 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index f919a0dac..42dc0ac04 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -946,7 +946,7 @@ #define PHOTO_ISP_STAMP DISABLE #define SF_BASE_VERSION_FEA "R2.3" -#define SF_GPS_SUPPORT 0 +#define SF_GPS_SUPPORT 1 #define SF_SEND_LIST_ITEM_LENGTH 15 #define SF_4G_REGISTER_NETWORK_COUNT 230 #define SUBSCRIBE_MAX_NUM 10 @@ -968,7 +968,7 @@ #define SF_MODULE_UP_FILE_PATH "/mnt/sd/EG915QNA.tar.bz2" #define SF_CAM_UP_FILE "S530.tar.bz2" #define SF_CAM_UP_FILE_PATH "/mnt/sd/S530.tar.bz2" -#define SF_CAMERA_GPS_INFO_FILENAME SF_SD_ROOT"/gps.txt" +#define SF_CAMERA_GPS_INFO_FILENAME SF_SD_ROOT"gps.txt" #define SF_UBOOT_UPDATA_FW ENABLE #ifndef ANR_FUNC diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index ac2fbe2c4..597bd6db5 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -249,12 +249,12 @@ #define DEFAULT_AUTO_LOG_SWITCH SF_OFF #define DEFAULT_RAW_SWITCH SF_OFF #define DEFAULT_GPS_SEND_FLAG SF_OFF -#define DEFAULT_FRIST_SEND_DAILY_AND_GPS SF_OFF +#define DEFAULT_FRIST_SEND_DAILY_AND_GPS SF_ON #define DEFAULT_NET_GENERATION SF_NET_NO #define DEFAULT_QLOG_SWITCH SF_OFF #define DEFAULT_GPS_ANTI_THEFT_SWITCH SF_OFF #define DEFAULT_BATTRERY_LOG_SWITCH SF_OFF -#define DEFAULT_GPS_NUMBER SF_OFF +#define DEFAULT_GPS_NUMBER GPS_NUMBER_TWICE #define DEFAULT_TIMESEND1_SWITCH SF_OFF #define DEFAULT_TIMESEND2_SWITCH SF_OFF #define DEFAULT_TIMESEND3_SWITCH SF_OFF diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 4c287f996..44b1511b7 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -2334,6 +2334,8 @@ void sf_power_on_para_check_init(void) if(0 == puiPara->NetWorkNeedSearch){ puiPara->NetWorkNeedSearch = 1; } + puiPara->FristSendDailyAndGps = 1; + puiPara->GpsSendFlag = 0; memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); } else if(PowerOnMode == PWR_ON_TIME_SYNC) @@ -2343,10 +2345,7 @@ void sf_power_on_para_check_init(void) } else if(PowerOnMode == PWR_ON_DAILY_REPORT) { - //puiPara->NeedTimeSyncStartUp = 1; - if (puiPara->DailyReportSwitch) { - puiPara->GpsSendFlag = 1; // indicate need send dp file in b power on. - } + } printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h index 31c7d4543..7df563732 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h @@ -2052,6 +2052,14 @@ typedef enum { SF_SEND_TIMELY_MAX, } SF_SEND_TYPE_e; +typedef enum +{ + GPS_NUMBER_OFF = 0x00, + GPS_NUMBER_ONE, + GPS_NUMBER_TWICE, + GPS_NUMBER_MAX, +} SF_GPS_NUMBER; + extern void Load_SysInfo(void); extern void Save_SysInfo(void); extern void Init_SysInfo(void); diff --git a/code/application/source/sf_app/code/include/sf_ftp.h b/code/application/source/sf_app/code/include/sf_ftp.h index 51177632e..d9f0b9582 100755 --- a/code/application/source/sf_app/code/include/sf_ftp.h +++ b/code/application/source/sf_app/code/include/sf_ftp.h @@ -223,5 +223,6 @@ SINT32 sf_log_send_ftp(void); SINT32 sf_low_power_warn_send_ftp(void); double sf_sys_s_time_get(time_t end_time); time_t sf_time (time_t *__timer); +SINT32 sf_gps_send_ftp(void); #endif /*_SF_FTP_H_*/ diff --git a/code/application/source/sf_app/code/include/sf_sms.h b/code/application/source/sf_app/code/include/sf_sms.h index b75bbcd3e..ed063e7dc 100644 --- a/code/application/source/sf_app/code/include/sf_sms.h +++ b/code/application/source/sf_app/code/include/sf_sms.h @@ -221,6 +221,8 @@ typedef struct sfCAMERA_CMD_S UINT8 cameraReset; UINT8 cameraRestart; UINT8 GotoServerGetPara; + UINT8 GpsTxt; + } SF_CAMERA_CMD_S; typedef struct SubImgList @@ -267,5 +269,7 @@ UINT8 sf_set_send_video(UINT8 value); UINT8 sf_get_send_log(void); UINT8 sf_set_send_log(UINT8 value); SINT32 sf_power_off_statistics(void); +UINT8 sf_get_send_gps_txt(void); +UINT8 sf_set_send_gps_txt(UINT8 value); #endif /*_SF_SMS_H_*/ diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index 7772c040a..d2df0ee40 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -2229,6 +2229,83 @@ SINT32 sf_low_power_warn_send_ftp(void) //printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret); return ret; } + +SINT32 sf_gps_send_ftp(void) +{ + SINT32 ret = SF_SUCCESS; + SINT32 ret2 = SF_SUCCESS; //0:success; else:fail; + UINT8 uploadFname[64] = { 0 }; + UINT8 customStr[64] = { 0 }; + UINT8 filePath[64] = { 0 }; + int timeout = 120000; + UIMenuStoreInfo *pPara = sf_app_ui_para_get(); + UINT8 ssl = 0; + UINT8 gprsMode = 0; + ssl = ((2 == pPara->FtpSwitch) ? 1 : 0); + gprsMode = 0;//puiPara->GprsMode; + + MLOGD("start\n"); + sf_set_send_gps_txt(0); + if(sf_file_IsExsit(SF_CAMERA_GPS_INFO_FILENAME) != SF_TRUE) + { + printf("%s:%d err file\n", __FUNCTION__, __LINE__); + return SF_FAILURE; + } + + ret = sf_ftp_config(ssl, gprsMode, timeout); + + if(SF_SUCCESS == ret) + { + //sprintf((char *)filePath, "UFS:/%s", SF_LOG_TXT); + sprintf((char *)filePath, "%s", SF_CAMERA_GPS_INFO_FILENAME); + + printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); + + sf_custom_str_get(customStr); + sprintf((char *)uploadFname, "%s-%s-gps.txt",pPara->ModuleImei, customStr); + + ret = SF_SUCCESS;//sf_quectel_upload_file_to_module((UINT8 *)SF_CAMERA_GPS_INFO_FILENAME, (UINT8 *)SF_LOG_TXT); + + if(SF_SUCCESS != ret) + { + printf("%s:%d upload err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + } + else + { + ret = sf_ftp_send(uploadFname, filePath, timeout); + + if(SF_SUCCESS != ret) + { + printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + } + else { + //GPS send success,add gps send flag + if(pPara->FristSendDailyAndGps != 1){ + pPara->GpsSendFlag++; + } + } + } + } + if(ret != SF_FTP_ERROR_TERM) + { + ret2 = sf_ftp_stop(ssl, gprsMode); + } + + #if SF_TEST_ERROR_CODE + sf_set_code_err_flag(0); + #endif + //printf("[%s:%d]ret:[0x%08X],ret2:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret, ret2); + MLOGD(" end ret:[0x%08X],ret2:[0x%08X]\n", ret, ret2); + + if(ret != SF_SUCCESS) + { + return ret; + } + else + { + return ret2; + } +} #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/4gMng/sf_sms.c b/code/application/source/sf_app/code/source/4gMng/sf_sms.c index 19121e764..b15efc500 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -840,15 +840,15 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s { if((strValue[i][0] - '0') == 0 ) { - //pPara_sms_saved->GpsNumber = 0; + pPara_sms_saved->GpsNumber = GPS_NUMBER_OFF; } else if((strValue[i][0] - '0') == 1) { - pPara_sms_saved->GpsNumber = 1; + pPara_sms_saved->GpsNumber = GPS_NUMBER_ONE; } else if((strValue[i][0] - '0') == 2) { - pPara_sms_saved->GpsNumber = 2; + pPara_sms_saved->GpsNumber = GPS_NUMBER_TWICE; } else { @@ -2636,18 +2636,24 @@ SINT32 sf_power_off_statistics(void) SF_PDT_PARAM_STATISTICS_S *psfPara = sf_statistics_param_get(); - if(((PowerOnMode == PWR_ON_TIME_SEND) || (PowerOnMode == PWR_ON_TIMELAPSE) || (PowerOnMode == PWR_ON_PIR)) && (sf_get_signal_ready_flag())) + if(((PowerOnMode == SF_MCU_STARTUP_BATCH_SEND) || (PowerOnMode == SF_MCU_STARTUP_TIMELAPSE) || (PowerOnMode == SF_MCU_STARTUP_PIR)) && (sf_get_signal_ready_flag())) { psfPara->picSendCount++;//Failed to register, counted as sending once. printf("picSendCount=%d\n", psfPara->picSendCount); } - if((PowerOnMode == PWR_ON_TIMELAPSE) || (PowerOnMode == PWR_ON_PIR)) + if((PowerOnMode == SF_MCU_STARTUP_TIMELAPSE) || (PowerOnMode == SF_MCU_STARTUP_PIR)) { psfPara->TirgNum++; psfPara->NewFlieCount+=(puiPara->Multishot+1); printf("TirgNum=%d NewFlieCount=%d\n", psfPara->TirgNum, psfPara->NewFlieCount); } + + if(PowerOnMode == SF_MCU_STARTUP_RESET) + { + psfPara->GpsSearchFailCnt = 0; + printf("GpsSearchFailCnt=%d\n", psfPara->GpsSearchFailCnt); + } return 0; } @@ -2747,4 +2753,31 @@ UINT8 sf_set_send_log(UINT8 value) { CameraCmd.getLog = value; return CameraCmd.getLog; +} + +/************************************************* + Function: sf get send gps txt + Description: get gps txt flag + Input: N/A + Output: N/A + Return: 0:SUCCESS, errcode:FAIL + Others: N/A +*************************************************/ +UINT8 sf_get_send_gps_txt(void) +{ + return CameraCmd.GpsTxt; +} + +/************************************************* + Function: sf set send gps txt + Description: set gps txt flag + Input: N/A + Output: N/A + Return: 0:SUCCESS, errcode:FAIL + Others: N/A +*************************************************/ +UINT8 sf_set_send_gps_txt(UINT8 value) +{ + CameraCmd.GpsTxt = value; + return CameraCmd.GpsTxt; } \ No newline at end of file diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 07ae5b742..3311393da 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -1152,9 +1152,15 @@ static SINT32 app_file_transfer(SF_FN_PARAM_S *pfnParam) { break; case SF_MCU_STARTUP_SYN_PARAM: - if (pCustomerParam->GpsSendFlag) { + + if(sf_get_send_gps_txt()){ + s32ret = sf_gps_send_ftp(); + } + //if (pCustomerParam->GpsSendFlag) + { + s32ret = sf_send_file_to_ftp(2); - pCustomerParam->GpsSendFlag = 0; + //pCustomerParam->GpsSendFlag = 0; if(pCustomerParam->PicUpDailyReport){ sf_sms_set_pic(1); sf_sleep_ms(200); @@ -1598,10 +1604,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) if (0 != sf_get_cq_signal()) { pCustomerParam->NeedTimeSyncStartUp = 1; } - if (pCustomerParam->DailyReportSwitch) { - pCustomerParam->GpsSendFlag = - 1; // indicate need send dp file in b power on. - } + // if (pCustomerParam->DailyReportSwitch) { + // pCustomerParam->GpsSendFlag = + // 1; // indicate need send dp file in b power on. + // } SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST); sf_4G_usb_net_apn_cfg(pfnParam); @@ -1735,7 +1741,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) sf_set_signal_ready_flag(TRUE); } if (0 != sf_get_cq_signal()) { - pCustomerParam->GpsSendFlag = 1; + //pCustomerParam->GpsSendFlag = 1; pCustomerParam->NeedTimeSyncStartUp = 1; // avoid always A mode power on pCustomerParam->NetWorkNeedSearch = 0; @@ -1817,6 +1823,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) { s32ret = sf_log_send_ftp(); } + else if(sf_get_send_gps_txt()) + { + s32ret = sf_gps_send_ftp(); + } // sf_share_mem_customer_down(1); break; @@ -2096,16 +2106,53 @@ int get_gps_location(void) void keep_get_gps_location(const SF_GPS_PARAM param) { int seraching = 0; + int ret = GPS_GET_FAILED; + SF_PDT_PARAM_STATISTICS_S *pStaticParam = sf_statistics_param_get(); + UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); + while(seraching < param.timeout_ms && sf_app_while_flag()) { // const int SERACHING_ONCE_MS = 200; - if (GPS_GET_SUCCEED == get_gps_location()) + ret = get_gps_location(); + if (GPS_GET_SUCCEED == ret) { break; } usleep(param.period_ms * 1000); seraching += param.period_ms; } + + if(SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()) + { + if (ret == GPS_GET_SUCCEED) + { + pStaticParam->GpsSearchFailCnt = 0; + } + else + { + pStaticParam->GpsSearchFailCnt++; /* how to sure sequence or no sequence failed Added by MaxLi 2022/06/17--10:42:9*/ + } + + #if SF_GPS_SUPPORT + if((puiPara->GpsSwitch == 1) || (puiPara->FristSendDailyAndGps)) + { + if((puiPara->FristSendDailyAndGps) || (puiPara->GpsNumber == 2) \ + || ((puiPara->GpsNumber == 1) && (puiPara->GpsSendFlag == 0))) + { + if((pStaticParam->GpsSearchFailCnt <= 5) || (puiPara->FristSendDailyAndGps)) + { + NET_SLOGI("FristSendDaily:%d\n", puiPara->FristSendDailyAndGps); + sf_set_send_gps_txt(1); + } + } + else //if((puiPara->GpsNumber == 1) && (puiPara->GpsSendFlag != 0)) + { + //key is ON: for gpe one number per day, the second 0x0b power on, reset gps send flag + puiPara->GpsSendFlag = 0; + } + } + #endif + } return; } static void *keep_get_gps_location_thread(void *param) diff --git a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c index d0de1ab7e..4b4171e50 100755 --- a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c +++ b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c @@ -305,9 +305,9 @@ void sf_app_power_on_para_check_init(void) else if(PowerOnMode == SF_MCU_STARTUP_DP) { //puiPara->NeedTimeSyncStartUp = 1; - if (puiPara->DailyReportSwitch) { - puiPara->GpsSendFlag = 1; // indicate need send dp file in b power on. - } + // if (puiPara->DailyReportSwitch) { + // puiPara->GpsSendFlag = 1; // indicate need send dp file in b power on. + // } } printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); if(puiPara->Multishot != sf_sys_get_flag(FL_CONTINUE_SHOT)) diff --git a/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_app.c b/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_app.c index 758800b40..05a3ad830 100644 --- a/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_app.c +++ b/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_app.c @@ -64,7 +64,7 @@ void sf_set_ble_status(SF_BLE_STATUS_E enStatus) } else - SLOGE("Type format error\n"); + BLU_SLOGE("Type format error\n"); return; } @@ -82,7 +82,7 @@ int sf_set_ble_name(char *name) { UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); snprintf((char *)puiPara->BluSsid, sizeof(puiPara->BluSsid), "%s", (char *)name); - MLOGI("BluSsid:%s\n", puiPara->BluSsid); + BLU_SLOGI("BluSsid:%s\n", puiPara->BluSsid); } static UINT32 sf_set_pir_sensitivity(UINT8 pirs) { @@ -121,7 +121,7 @@ static void sf_camera_name_check(char* str) len = 4; } - MLOGI("str:%s,len:%d\n", str, len); + BLU_SLOGI("str:%s,len:%d\n", str, len); for(i = 0; i < len; i++) { if((str[i] >= 'a') && (str[i] <= 'z')) @@ -150,7 +150,7 @@ static void *sf_blue_preset_reboot_task(void *arg) static void sf_blue_command_get_wifi_info(MSG_DEV_BLE_WIFI_Get_Rsp_T *wifiInfo) { UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); - SLOGI("wifiInfo:%x\n",wifiInfo->cmdRet); + BLU_SLOGI("wifiInfo:%x\n",wifiInfo->cmdRet); printf("[sf_blue_get_wifi_info],sf_get_sifar_param\n"); wifiInfo->cmdRet = 0; @@ -158,14 +158,14 @@ static void sf_blue_command_get_wifi_info(MSG_DEV_BLE_WIFI_Get_Rsp_T *wifiInfo) wifiInfo->SSIDlength = strlen((const char*)puiPara->strSSID); snprintf((char *)wifiInfo->SSID, sizeof(wifiInfo->SSID), "%s", (char *)puiPara->strSSID); - SLOGI("len:%d, SSID:%s\n", wifiInfo->SSIDlength, wifiInfo->SSID); + BLU_SLOGI("len:%d, SSID:%s\n", wifiInfo->SSIDlength, wifiInfo->SSID); wifiInfo->PWDlength = strlen((const char*)puiPara->WifiApPWD); snprintf((char *)wifiInfo->PWD, sizeof(wifiInfo->PWD), "%s", (char *)puiPara->WifiApPWD); - SLOGI("len:%d, PWD:%s\n", wifiInfo->PWDlength, puiPara->WifiApPWD); + BLU_SLOGI("len:%d, PWD:%s\n", wifiInfo->PWDlength, puiPara->WifiApPWD); wifiInfo->suffix = htons(0xFFEE); - SLOGI("end\n"); + BLU_SLOGI("end\n"); } static void sf_blue_command_get_camera_para(MSG_DEV_BLE_Param_Get_Rsp_T *CamPara) @@ -211,7 +211,7 @@ static void sf_blue_command_get_camera_para(MSG_DEV_BLE_Param_Get_Rsp_T *CamPara { CamPara->imageSize = 2; } - MLOGI("Image Size:%d\n", CamPara->imageSize); + BLU_SLOGI("Image Size:%d\n", CamPara->imageSize); //CamPara->imageSize = puiPara->ImgSize; @@ -225,11 +225,11 @@ static void sf_blue_command_get_camera_para(MSG_DEV_BLE_Param_Get_Rsp_T *CamPara CamPara->timerStartMinute = puiPara->WorkTime[0].StartTime.Min; CamPara->timerEndHour = puiPara->WorkTime[0].StopTime.Hour; CamPara->timerEndMinute = puiPara->WorkTime[0].StopTime.Min; - MLOGI("timer:%d\n", puiPara->WorkTime1Switch); - MLOGI("TimerHstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Hour); - MLOGI("TimerMstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Min); - MLOGI("TimerHstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Hour); - MLOGI("TimerMstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Min); + BLU_SLOGI("timer:%d\n", puiPara->WorkTime1Switch); + BLU_SLOGI("TimerHstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Hour); + BLU_SLOGI("TimerMstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Min); + BLU_SLOGI("TimerHstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Hour); + BLU_SLOGI("TimerMstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Min); CamPara->maxNum = puiPara->SendMaxNum;//MaxNumber CamPara->delay = puiPara->PirDelaySwitch;//DelayFlag @@ -291,11 +291,11 @@ static void sf_blue_command_get_camera_para(MSG_DEV_BLE_Param_Get_Rsp_T *CamPara //!< 蓝牙部分新增内容 CamPara->SSIDlength = strlen((const char*)puiPara->strSSID); snprintf((char *)CamPara->SSID, sizeof(CamPara->SSID), "%s", (char *)puiPara->strSSID); - SLOGI("len:%d, SSID:%s\n", CamPara->SSIDlength, CamPara->SSID); + BLU_SLOGI("len:%d, SSID:%s\n", CamPara->SSIDlength, CamPara->SSID); CamPara->PWDlength = strlen((const char*)puiPara->WifiApPWD); snprintf((char *)CamPara->PWD, sizeof(CamPara->PWD), "%s", (char *)puiPara->WifiApPWD); - SLOGI("len:%d, PWD:%s\n", CamPara->PWDlength, puiPara->WifiApPWD); + BLU_SLOGI("len:%d, PWD:%s\n", CamPara->PWDlength, puiPara->WifiApPWD); strcpy((char *)CamPara->hwType, SF_HW_TYPE); @@ -365,7 +365,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 { sf_clear_poweroff_time();/*reset power off count time*/ - SLOGI("BLE Req cmd=%x.\n", msgParse.cmd); + BLU_SLOGI("BLE Req cmd=%x.\n", msgParse.cmd); switch(msgParse.cmd) { case BLE_GET_CAMERA_CONNECT: //OK @@ -385,7 +385,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 break; case BLE_GET_CAMERA_WIFI_INFO: //o { - SLOGI("[BLE_GET_CAMERA_WIFI_INFO],msgParse.msgBuf.rgetWifiInfo:%x\n",msgParse.msgBuf.rgetWifiInfo.cmdRet); + BLU_SLOGI("[BLE_GET_CAMERA_WIFI_INFO],msgParse.msgBuf.rgetWifiInfo:%x\n",msgParse.msgBuf.rgetWifiInfo.cmdRet); sf_blue_command_get_wifi_info(&msgParse.msgBuf.rgetWifiInfo); msgParse.msglen = htons(sizeof(MSG_DEV_BLE_WIFI_Get_Rsp_T) + 2*sizeof(UINT16) ); respFlag = 1; @@ -394,7 +394,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_GET_CAMERA_PARAM: //o { - SLOGI("[BLE_GET_CAMERA_PARAM]\n"); + BLU_SLOGI("[BLE_GET_CAMERA_PARAM]\n"); sf_blue_command_get_camera_para(&msgParse.msgBuf.rgetDevParam); /* add the cmd + resp total 2*2 bytes */ msgParse.msglen = htons(sizeof(MSG_DEV_BLE_Param_Get_Rsp_T) + 2*sizeof(UINT16) ); @@ -404,7 +404,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_WIFI_PWD: // { - SLOGI("[BLE_SET_WIFI_PWD],newpwd:%s\n",pMsgStruct->msgBuf.wifiPwdSet.PWD); + BLU_SLOGI("[BLE_SET_WIFI_PWD],newpwd:%s\n",pMsgStruct->msgBuf.wifiPwdSet.PWD); int len = pMsgStruct->msgBuf.wifiPwdSet.PWDlength; if (len >= SF_WIFI_AP_PWD_LEN) { @@ -418,7 +418,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 break; case BLE_SET_CAMERA_WIFI_SSID: // { - SLOGI("[BLE_SET_WIFI_SSID],newssid:%s\n",pMsgStruct->msgBuf.wifiSSIDSet.SSID); + BLU_SLOGI("[BLE_SET_WIFI_SSID],newssid:%s\n",pMsgStruct->msgBuf.wifiSSIDSet.SSID); int len = pMsgStruct->msgBuf.wifiSSIDSet.SSIDlength; if (len >= SF_WIFI_AP_SSID_LEN) @@ -434,7 +434,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_Zoom: // { - SLOGI("[BLE_SET_CAMERA_Zoom],Zoom:%d\n",puiPara->Zoom); + BLU_SLOGI("[BLE_SET_CAMERA_Zoom],Zoom:%d\n",puiPara->Zoom); puiPara->Zoom = pMsgStruct->msgBuf.deviceZoomSet.zoom; puiPara->Zoom = (puiPara->Zoom > 4 ? 1 : puiPara->Zoom) - 1; @@ -468,7 +468,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 saveMode = 1; } - SLOGI("[BLE_SET_CAMERA_CameraMode],cameraMode:%d,savemode:%d\n",pMsgStruct->msgBuf.setCameraMode.cameraMode,saveMode); + BLU_SLOGI("[BLE_SET_CAMERA_CameraMode],cameraMode:%d,savemode:%d\n",pMsgStruct->msgBuf.setCameraMode.cameraMode,saveMode); if(saveMode != pMsgStruct->msgBuf.setCameraMode.cameraMode) { @@ -506,7 +506,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_ImageSize: //O { U8 tmpValue; - SLOGI("[BLE_SET_CAMERA_ImageSize],ImgSize:%d\n",puiPara->ImgSize); + BLU_SLOGI("[BLE_SET_CAMERA_ImageSize],ImgSize:%d\n",puiPara->ImgSize); tmpValue = pMsgStruct->msgBuf.setImageSize.imageSize; if(tmpValue == 0) @@ -547,7 +547,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_MultiShot: //O { - SLOGI("Multishot:%d\nMultishotInterval:%d\n,SendMultishot:%d\n", pMsgStruct->msgBuf.setMultiShot.multiShot, + BLU_SLOGI("Multishot:%d\nMultishotInterval:%d\n,SendMultishot:%d\n", pMsgStruct->msgBuf.setMultiShot.multiShot, pMsgStruct->msgBuf.setMultiShot.multiInterval, pMsgStruct->msgBuf.setMultiShot.sendMulti); puiPara->Multishot = pMsgStruct->msgBuf.setMultiShot.multiShot % 3; @@ -587,7 +587,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_PirSensitivity: //O { - SLOGI("[BLE_SET_CAMERA_PirSensitivity],DigitPirSensitivity:%d\n",pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity); + BLU_SLOGI("[BLE_SET_CAMERA_PirSensitivity],DigitPirSensitivity:%d\n",pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity); sf_set_pir_sensitivity(pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity % 10); respFlag = 2; paramSaveFlag = 1; @@ -596,7 +596,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_Timer: //O { - SLOGI("[BLE_SET_CAMERA_Timer],timer:%d\n",pMsgStruct->msgBuf.setTimer.timer); + BLU_SLOGI("[BLE_SET_CAMERA_Timer],timer:%d\n",pMsgStruct->msgBuf.setTimer.timer); puiPara->WorkTime1Switch = !!pMsgStruct->msgBuf.setTimer.timer; puiPara->WorkTime[0].StartTime.Hour = pMsgStruct->msgBuf.setTimer.timerStartHour % 24; puiPara->WorkTime[0].StartTime.Min = pMsgStruct->msgBuf.setTimer.timerStartMinute % 60; @@ -614,7 +614,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_MaxNum: //O { - SLOGI("[BLE_SET_CAMERA_MaxNum],SendMaxNum:%d\n",pMsgStruct->msgBuf.setMaxNum.maxNum); + BLU_SLOGI("[BLE_SET_CAMERA_MaxNum],SendMaxNum:%d\n",pMsgStruct->msgBuf.setMaxNum.maxNum); puiPara->SendMaxNum = pMsgStruct->msgBuf.setMaxNum.maxNum % 100; respFlag = 2; paramSaveFlag = 1; @@ -623,7 +623,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_Delay: //O { - SLOGI("[BLE_SET_CAMERA_Delay],delay:%d\n",pMsgStruct->msgBuf.setDelay.delay); + BLU_SLOGI("[BLE_SET_CAMERA_Delay],delay:%d\n",pMsgStruct->msgBuf.setDelay.delay); puiPara->PirDelaySwitch = !!pMsgStruct->msgBuf.setDelay.delay; puiPara->PirDelayTime.Hour = pMsgStruct->msgBuf.setDelay.delayHour % 24; puiPara->PirDelayTime.Min = pMsgStruct->msgBuf.setDelay.delayMinute % 60; @@ -635,7 +635,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_SDLoop: //O { - SLOGI("[BLE_SET_CAMERA_SDLoop],SDLoop:%d\n",pMsgStruct->msgBuf.setSDLoop.SDLoop); + BLU_SLOGI("[BLE_SET_CAMERA_SDLoop],SDLoop:%d\n",pMsgStruct->msgBuf.setSDLoop.SDLoop); puiPara->SdLoopSwitch = !!pMsgStruct->msgBuf.setSDLoop.SDLoop; respFlag = 2; paramSaveFlag = 1; @@ -644,7 +644,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_FlashPower: //O { - SLOGI("[BLE_SET_CAMERA_FlashPower],flashPower:%d\n",pMsgStruct->msgBuf.setFlashPower.flashPower); + BLU_SLOGI("[BLE_SET_CAMERA_FlashPower],flashPower:%d\n",pMsgStruct->msgBuf.setFlashPower.flashPower); puiPara->FlashLed = !!pMsgStruct->msgBuf.setFlashPower.flashPower; respFlag = 2; paramSaveFlag = 1; @@ -653,7 +653,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_NightMode: //O { - SLOGI("[BLE_SET_CAMERA_NightMode],nightMode:%d\n",pMsgStruct->msgBuf.setNightMode.nightMode); + BLU_SLOGI("[BLE_SET_CAMERA_NightMode],nightMode:%d\n",pMsgStruct->msgBuf.setNightMode.nightMode); puiPara->NightMode = pMsgStruct->msgBuf.setNightMode.nightMode % 3; respFlag = 2; paramSaveFlag = 1; @@ -662,7 +662,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_SendType: //O { - SLOGI("[BLE_SET_CAMERA_SendType],sendType:%d\n",pMsgStruct->msgBuf.setSendType.sendType); + BLU_SLOGI("[BLE_SET_CAMERA_SendType],sendType:%d\n",pMsgStruct->msgBuf.setSendType.sendType); if(puiPara->GprsMode == 0) { puiPara->SendType = pMsgStruct->msgBuf.setSendType.sendType % 3; @@ -702,7 +702,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 puiPara->TimeSend3Switch = 1; puiPara->TimeSend4Switch = 1; } - MLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d TimeSend3Switch:%d %02d:%02d TimeSend4Switch:%d %02d:%02d\n", + BLU_SLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d TimeSend3Switch:%d %02d:%02d TimeSend4Switch:%d %02d:%02d\n", puiPara->SendType, puiPara->TimeSend1Switch, puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min, puiPara->TimeSend2Switch, puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min, @@ -717,7 +717,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_SMSCtrl: //O { - SLOGI("[BLE_SET_CAMERA_SMSCtrl],SMSCtrl:%d\n",pMsgStruct->msgBuf.setSMSCtrl.SMSCtrl); + BLU_SLOGI("[BLE_SET_CAMERA_SMSCtrl],SMSCtrl:%d\n",pMsgStruct->msgBuf.setSMSCtrl.SMSCtrl); puiPara->GprsMode = pMsgStruct->msgBuf.setSMSCtrl.SMSCtrl; if((puiPara->GprsMode == 1) || (puiPara->GprsMode == 2)) @@ -740,7 +740,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_VideoSize://err { - SLOGI("[BLE_SET_CAMERA_VideoSize],videoSize:%d\n",pMsgStruct->msgBuf.setVideoSize.videoSize); + BLU_SLOGI("[BLE_SET_CAMERA_VideoSize],videoSize:%d\n",pMsgStruct->msgBuf.setVideoSize.videoSize); puiPara->VideoSize = pMsgStruct->msgBuf.setVideoSize.videoSize % 3; if(0 == pMsgStruct->msgBuf.setVideoSize.videoSize % 3){ puiPara->VideoSize = MOVIE_SIZE_FRONT_1920x1080P30; @@ -763,7 +763,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_VideoTime: //O { - SLOGI("[BLE_SET_CAMERA_VideoTime],videoTime:%d\n",pMsgStruct->msgBuf.setVideoTime.videoTime); + BLU_SLOGI("[BLE_SET_CAMERA_VideoTime],videoTime:%d\n",pMsgStruct->msgBuf.setVideoTime.videoTime); if(10 == pMsgStruct->msgBuf.setVideoTime.videoTime) { puiPara->VideoLenth = 15; @@ -780,7 +780,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_BatteryType: //O { - SLOGI("[BLE_SET_CAMERA_BatteryType],batType:%d\n",pMsgStruct->msgBuf.setBatType.batType); + BLU_SLOGI("[BLE_SET_CAMERA_BatteryType],batType:%d\n",pMsgStruct->msgBuf.setBatType.batType); puiPara->BatteryType = pMsgStruct->msgBuf.setBatType.batType; puiPara->BatteryType = (puiPara->BatteryType > 3 ? 0 : puiPara->BatteryType); respFlag = 2; @@ -790,12 +790,12 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_CameraID: //O { - SLOGI("[BLE_SET_CAMERA_CameraID],cameraID:%d\n",pMsgStruct->msgBuf.setCameraID.cameraID); + BLU_SLOGI("[BLE_SET_CAMERA_CameraID],cameraID:%d\n",pMsgStruct->msgBuf.setCameraID.cameraID); puiPara->CamNameSwitch = pMsgStruct->msgBuf.setCameraID.cameraID == 0 ? SF_CAMID_OFF : SF_CAMID_ON; strncpy(puiPara->CamNameStr, (char *)pMsgStruct->msgBuf.setCameraID.cameraIDstr, 4); //Use SF_STRNCPY to avoid that APP has not send '\0'. sf_camera_name_check(puiPara->CamNameStr); puiPara->CamNameStr[4] = '\0'; - MLOGI("Camid:%d,str:%s\n", puiPara->CamNameSwitch, puiPara->CamNameStr); + BLU_SLOGI("Camid:%d,str:%s\n", puiPara->CamNameSwitch, puiPara->CamNameStr); respFlag = 2; paramSaveFlag = 1; } @@ -803,7 +803,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_DateTime: //O { - SLOGI("[BLE_SET_CAMERA_DateTime],DateAuto:%d\n",pMsgStruct->msgBuf.setDateTime.dateTimeAuto); + BLU_SLOGI("[BLE_SET_CAMERA_DateTime],DateAuto:%d\n",pMsgStruct->msgBuf.setDateTime.dateTimeAuto); puiPara->DateAuto = !pMsgStruct->msgBuf.setDateTime.dateTimeAuto; //NTPAuto 0: Auto , 1: Manual //puiPara->NTPZone = pMsgStruct->msgBuf.setDateTime.timeZone % 7; time.Year = htons(pMsgStruct->msgBuf.setDateTime.year); @@ -814,7 +814,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 time.Sec = pMsgStruct->msgBuf.setDateTime.second % 60; if(puiPara->DateAuto == 1) //1: Manual { - MLOGI("Set RTC %d %d %d %d:%d%d\n", time.Year, time.Mon, time.Day, time.Hour, time.Min, time.Sec); + BLU_SLOGI("Set RTC %d %d %d %d:%d%d\n", time.Year, time.Mon, time.Day, time.Hour, time.Min, time.Sec); sf_sys_rtc_time_set(&time); sf_set_mcu_rtc_flag(1); } @@ -824,9 +824,11 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_GPS: //o { - SLOGI("[BLE_SET_CAMERA_GPS],gpsSendType:%d\n",pMsgStruct->msgBuf.setGPS.gpsSendType); - puiPara->GpsSwitch = pMsgStruct->msgBuf.setGPS.gpsSwitch; - //puiPara->GpsSendType = pMsgStruct->msgBuf.setGPS.gpsSendType; + BLU_SLOGI("[BLE_SET_CAMERA_GPS],gpsSendType:%d\n",pMsgStruct->msgBuf.setGPS.gpsSendType); + #if SF_GPS_SUPPORT + puiPara->GpsSwitch = pMsgStruct->msgBuf.setGPS.gpsSwitch % 2; + puiPara->GpsNumber = pMsgStruct->msgBuf.setGPS.gpsSendType % 3; + #endif respFlag = 2; paramSaveFlag = 1; } @@ -834,7 +836,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_timeLapse: //O { - SLOGI("[BLE_SET_CAMERA_timeLapse],timelapse:%d\n",pMsgStruct->msgBuf.setTimeLapseTime.timelapse); + BLU_SLOGI("[BLE_SET_CAMERA_timeLapse],timelapse:%d\n",pMsgStruct->msgBuf.setTimeLapseTime.timelapse); puiPara->TimelapseSwitch = pMsgStruct->msgBuf.setTimeLapseTime.timelapse % 2; puiPara->TimelapseTime.Hour = pMsgStruct->msgBuf.setTimeLapseTime.timelapseHour % 24; puiPara->TimelapseTime.Min = pMsgStruct->msgBuf.setTimeLapseTime.timelapseMin % 60; @@ -850,7 +852,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_SET_CAMERA_PicUponDailyReport: //O { - SLOGI("[BLE_SET_CAMERA_PicUponDailyReport],picUponDailyReport:%d\n",pMsgStruct->msgBuf.setDailyReport.picUponDailyReport); + BLU_SLOGI("[BLE_SET_CAMERA_PicUponDailyReport],picUponDailyReport:%d\n",pMsgStruct->msgBuf.setDailyReport.picUponDailyReport); puiPara->PicUpDailyReport = pMsgStruct->msgBuf.setDailyReport.picUponDailyReport; respFlag = 2; paramSaveFlag = 1; @@ -858,21 +860,21 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 break; case BLE_SET_CAMERA_WifiPWD: // snprintf((char *)puiPara->WifiApPWD, sizeof(puiPara->WifiApPWD), "%s", (char *)pMsgStruct->msgBuf.setWifiPWD.newPWD); - SLOGI("new AP PWD: %s\n", puiPara->WifiApPWD); + BLU_SLOGI("new AP PWD: %s\n", puiPara->WifiApPWD); paraNeedReboot = 1; respFlag = 2; paramSaveFlag = 1; break; case BLE_SET_CAMERA_WifiName: // snprintf((char *)puiPara->strSSID, sizeof(puiPara->strSSID), "%s", (char *)pMsgStruct->msgBuf.setWifiSSID.newSSID); - SLOGI("new AP SSID: %s\n", puiPara->strSSID); + BLU_SLOGI("new AP SSID: %s\n", puiPara->strSSID); paraNeedReboot = 1; respFlag = 2; paramSaveFlag = 1; break; case BLE_CONTROL_CAMERA_FormatSDCard: { - SLOGI("[BLE_CONTROL_CAMERA_FormatSDCard],format:%d\n",pMsgStruct->msgBuf.ctrlFormat.format); + BLU_SLOGI("[BLE_CONTROL_CAMERA_FormatSDCard],format:%d\n",pMsgStruct->msgBuf.ctrlFormat.format); if(pMsgStruct->msgBuf.ctrlFormat.format == 1) { if((sf_in_card_exist()) && (sf_is_card())) @@ -903,14 +905,14 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 } break; case BLE_CONTROL_CAMERA_Reboot: - SLOGI("[WIFI_CONTROL_CAMERA_Reboot],reboot:%d\n",pMsgStruct->msgBuf.ctrlReboot.reboot); + BLU_SLOGI("[WIFI_CONTROL_CAMERA_Reboot],reboot:%d\n",pMsgStruct->msgBuf.ctrlReboot.reboot); tmp = pMsgStruct->msgBuf.ctrlReboot.reboot; paraNeedReboot = 1; respFlag = 2; break; case BLE_CONTROL_CAMERA_Recovery: { - SLOGI("[BLE_CONTROL_CAMERA_Recovery]\n"); + BLU_SLOGI("[BLE_CONTROL_CAMERA_Recovery]\n"); SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get(); sf_statistics_param_reset(pSifarPara); stMessageBuf.arg1 = SF_PARA_CMD_RESET; @@ -921,7 +923,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 } break; case BLE_CONTROL_CAMERA_Network_Scan: - SLOGI("[WIFI_CONTROL_CAMERA_Network_Scan] \n"); + BLU_SLOGI("[WIFI_CONTROL_CAMERA_Network_Scan] \n"); //SF_MESSAGE_BUF_S stMessageBuf = {0}; stMessageBuf.arg1 = SF_DEV_CMD_ESIM_OPERATION_SCAN; stMessageBuf.arg2 = SF_CONTROL_TYPE_WIFI; @@ -933,7 +935,7 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8 case BLE_CONTROL_CAMERA_Network_Select: //SF_MESSAGE_BUF_S stMessageBuf = {0}; - SLOGI("[WIFI_CONTROL_CAMERA_Network_Select] , pID:%d\n", \ + BLU_SLOGI("[WIFI_CONTROL_CAMERA_Network_Select] , pID:%d\n", \ pMsgStruct->msgBuf.ctrlNetworkSelect.profileId); stMessageBuf.arg1 = SF_DEV_CMD_ESIM_OPERATION_SELECT; stMessageBuf.arg2 = SF_CONTROL_TYPE_WIFI; @@ -1096,7 +1098,7 @@ static int sf_blue_write_callback(U8 *val, unsigned int nval, U8 **rval, unsig if (nval < 11) { - SLOGE("len err.\n"); + BLU_SLOGE("len err.\n"); return -1; } diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c index 65d6b2696..5047fee9d 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c @@ -1363,17 +1363,22 @@ void sf_dailyReport_set(void) if(PWR_ON_TIME_SYNC == sf_poweron_type_get()) { - if (DailyReportFtpSendSucess == 0) - { - if(puiPara->ReDailyReport==0) - puiPara->ReDailyReport = 1; - else - puiPara->ReDailyReport = 0; - } - else - { - puiPara->ReDailyReport = 0; - } + if (puiPara->FristSendDailyAndGps) + { + puiPara->FristSendDailyAndGps = 0; + puiPara->ReDailyReport = 0; + } + else if (DailyReportFtpSendSucess == 0) + { + if(puiPara->ReDailyReport==0) + puiPara->ReDailyReport = 1; + else + puiPara->ReDailyReport = 0; + } + else + { + puiPara->ReDailyReport = 0; + } sf_dailyReport_refresh(); } diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index ac2fbe2c4..df7f59115 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -254,7 +254,7 @@ #define DEFAULT_QLOG_SWITCH SF_OFF #define DEFAULT_GPS_ANTI_THEFT_SWITCH SF_OFF #define DEFAULT_BATTRERY_LOG_SWITCH SF_OFF -#define DEFAULT_GPS_NUMBER SF_OFF +#define DEFAULT_GPS_NUMBER GPS_NUMBER_TWICE #define DEFAULT_TIMESEND1_SWITCH SF_OFF #define DEFAULT_TIMESEND2_SWITCH SF_OFF #define DEFAULT_TIMESEND3_SWITCH SF_OFF diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 6dd940e2e..aac3609ac 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -1727,6 +1727,8 @@ void sf_power_on_para_check_init(void) if(0 == puiPara->NetWorkNeedSearch){ puiPara->NetWorkNeedSearch = 1; } + puiPara->FristSendDailyAndGps = 1; + puiPara->GpsSendFlag = 0; memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); } else if(PowerOnMode == PWR_ON_TIME_SYNC) @@ -1736,10 +1738,7 @@ void sf_power_on_para_check_init(void) } else if(PowerOnMode == PWR_ON_DAILY_REPORT) { - //puiPara->NeedTimeSyncStartUp = 1; - if (puiPara->DailyReportSwitch) { - puiPara->GpsSendFlag = 1; // indicate need send dp file in b power on. - } + } printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h index f286ef726..f0c57e4fb 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h @@ -2052,6 +2052,14 @@ typedef enum { SF_SEND_TIMELY_MAX, } SF_SEND_TYPE_e; +typedef enum +{ + GPS_NUMBER_OFF = 0x00, + GPS_NUMBER_ONE, + GPS_NUMBER_TWICE, + GPS_NUMBER_MAX, +} SF_GPS_NUMBER; + extern void Load_SysInfo(void); extern void Save_SysInfo(void); extern void Init_SysInfo(void);