From 65ccdbc3fb8583793858c0381f6b8e411cfd293d Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 13 Nov 2023 15:41:26 +0800 Subject: [PATCH 1/9] =?UTF-8?q?1.setup=E4=B8=8B=E5=86=8D=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E8=93=9D=E7=89=99=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/sf_app/code/source/app/sf_system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/app/sf_system.c b/code/application/source/sf_app/code/source/app/sf_system.c index 4c01ae24e..e4e163ee2 100755 --- a/code/application/source/sf_app/code/source/app/sf_system.c +++ b/code/application/source/sf_app/code/source/app/sf_system.c @@ -1321,7 +1321,10 @@ void* sf_app_load_ko_thread(void *arg) sf_load_ko(); - sf_load_bt_ko(); + if(PWR_ON_SETUP == sf_poweron_type_get()) + { + sf_load_bt_ko(); + } /*if((SF_MCU_STARTUP_NORMAL != sf_poweron_type_get()) && (0 == sf_get_fw_update())) { #if SF_IQ_TEST != ENABLE From d1ce4e56c5c54e4296f12f46eb8b3e7721c43235 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 13 Nov 2023 15:42:19 +0800 Subject: [PATCH 2/9] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=BC=8F=E5=8F=91=E9=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/4gMng/sf_eg91_sim.c | 4 +-- .../source/sf_app/code/source/4gMng/sf_ftp.c | 28 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c index 4127e3e96..cd12b26c8 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c @@ -2403,7 +2403,7 @@ SINT32 sf_module_complete_init(void) SLOGD(" s\n"); //needRecordLogFlag = 1; - puiPara->NetGeneration = SF_NET_NO; + //puiPara->NetGeneration = SF_NET_NO; sf_gsm_para_buff_clear(); while(sf_app_while_flag()) @@ -3996,7 +3996,7 @@ SINT32 sf_auto_net_reg(void) SF_LOG(" s\n"); //needRecordLogFlag = 1; - puiPara->NetGeneration = 0; + //puiPara->NetGeneration = 0; sf_gsm_para_buff_clear(); 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 b33b3b98b..2f4059afc 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 @@ -920,20 +920,20 @@ SINT32 sf_pic_send_ftp(void) } piccount = pThumbFileCfg->filecnt; - if(4 == pPara->NetGeneration) - { - if(piccount >= 2) - { - piccount = ((pPara->SendPicSize == 2) ? 2 : piccount); - } - } - else - { - if(piccount >= 1) - { - piccount = 1; - } - } + // if(4 == pPara->NetGeneration) + // { + // if(piccount >= 2) + // { + // piccount = ((pPara->SendPicSize == 2) ? 2 : piccount); + // } + // } + // else + // { + // if(piccount >= 1) + // { + // piccount = 1; + // } + // } MLOGI("NetGeneration:%dG,tempPicSize=%d,piccount=%d,filecnt=%d\n", pPara->NetGeneration, tempPicSize, piccount, pThumbFileCfg->filecnt); //printf("[%s:%d]piccount=%d\n", __FUNCTION__, __LINE__, piccount); From de09e28a1928d2b1d1e9ce61779db8547cd93ffe Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 13 Nov 2023 16:51:24 +0800 Subject: [PATCH 3/9] =?UTF-8?q?1.=E5=8E=BB=E9=99=A4=E4=B8=80=E4=BA=9Blog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BSP/linux-kernel/drivers/iio/adc/nvt_adc.c | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/BSP/linux-kernel/drivers/iio/adc/nvt_adc.c b/BSP/linux-kernel/drivers/iio/adc/nvt_adc.c index 3e21d97bb..bd87d02bc 100755 --- a/BSP/linux-kernel/drivers/iio/adc/nvt_adc.c +++ b/BSP/linux-kernel/drivers/iio/adc/nvt_adc.c @@ -248,9 +248,9 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * t_data[t_data_now] = temp; t_data_now++; } - if (t_data_now != 0 && debug_adc){ - printk("0.temp = %d, t_data[t_data_now = %d] = %d , adc_mid = %u, filter = %u\r\n",temp, t_data_now-1, t_data[t_data_now-1], adc_mid, filter); - } + // if (t_data_now != 0 && debug_adc){ + // printk("0.temp = %d, t_data[t_data_now = %d] = %d , adc_mid = %u, filter = %u\r\n",temp, t_data_now-1, t_data[t_data_now-1], adc_mid, filter); + // } // calculate average if (t_data_now >= adc_avg_times ){ @@ -268,7 +268,7 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * adc_mid_val = adc_mid; adc_mid_vol = (adc_mid +CALI_OFFSET)*adc_trim/511; - printk("reset0 adc_mid_val = %d, adc_mid_vol = %d \r\n",adc_mid_val, adc_mid_vol); + // printk("reset0 adc_mid_val = %d, adc_mid_vol = %d \r\n",adc_mid_val, adc_mid_vol); } } } @@ -310,9 +310,9 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * t_data_now1++; } - if (t_data_now1 != 0 && debug_adc){ - printk("1.temp = %d, t_data1[t_data_now1 = %d] = %d \r\n",temp ,t_data_now1-1, t_data1[t_data_now1-1]); - } + // if (t_data_now1 != 0 && debug_adc){ + // printk("1.temp = %d, t_data1[t_data_now1 = %d] = %d \r\n",temp ,t_data_now1-1, t_data1[t_data_now1-1]); + // } // calculate average if (t_data_now1 >= adc_avg_times ){ @@ -330,7 +330,7 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * adc_mid1_val = adc_mid1; adc_mid1_vol = (adc_mid1 +CALI_OFFSET)*adc_trim/511; - printk("reset1 adc_mid1 = %d, adc_mid1_vol = %d \r\n",adc_mid1, adc_mid1_val); + // printk("reset1 adc_mid1 = %d, adc_mid1_vol = %d \r\n",adc_mid1, adc_mid1_val); } } } @@ -371,9 +371,9 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * t_data_now2++; } - if (t_data_now2 != 0 && debug_adc){ - printk("2.temp = %d, t_data2[t_data_now2 = %d] = %d \r\n",temp ,t_data_now2-1, t_data2[t_data_now2-1]); - } + // if (t_data_now2 != 0 && debug_adc){ + // printk("2.temp = %d, t_data2[t_data_now2 = %d] = %d \r\n",temp ,t_data_now2-1, t_data2[t_data_now2-1]); + // } // calculate average if (t_data_now2 >= adc_avg_times ){ @@ -391,7 +391,7 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * adc_mid2_val = adc_mid2; adc_mid2_vol = (adc_mid2 +CALI_OFFSET)*adc_trim/511; - printk("reset2 adc_mid2 = %d, adc_mid2_vol = %d \r\n",adc_mid2, adc_mid2_val); + // printk("reset2 adc_mid2 = %d, adc_mid2_vol = %d \r\n",adc_mid2, adc_mid2_val); } } } @@ -432,9 +432,9 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * t_data_now3++; } - if (t_data_now3 != 0 && debug_adc){ - printk("3.temp = %d, t_data3[t_data_now3 = %d] = %d \r\n",temp ,t_data_now3-1, t_data3[t_data_now3-1]); - } + // if (t_data_now3 != 0 && debug_adc){ + // printk("3.temp = %d, t_data3[t_data_now3 = %d] = %d \r\n",temp ,t_data_now3-1, t_data3[t_data_now3-1]); + // } // calculate average if (t_data_now3 >= adc_avg_times ){ @@ -452,7 +452,7 @@ static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state * adc_mid3_val = adc_mid3; adc_mid3_vol = (adc_mid3 +CALI_OFFSET)*adc_trim/511; - printk("reset3 adc_mid3 = %d, adc_mid3_vol = %d adc_mid3_vol=%u\r\n",adc_mid3, adc_mid3_val, adc_mid3_vol); + // printk("reset3 adc_mid3 = %d, adc_mid3_vol = %d adc_mid3_vol=%u\r\n",adc_mid3, adc_mid3_val, adc_mid3_vol); } } } @@ -500,7 +500,7 @@ static ssize_t data_proc_cmd_write(struct file *file, const char __user *buf, avg_sel = val; avg_sel_sts = 1; - printk("avg_sel = %d \n", avg_sel); + // printk("avg_sel = %d \n", avg_sel); if ( avg_sel == 5 ){ @@ -514,17 +514,17 @@ static ssize_t data_proc_cmd_write(struct file *file, const char __user *buf, // second value temp = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + 0*4); - printk("ch0 second val = %d \n", temp); + // printk("ch0 second val = %d \n", temp); // cal second trim2 if(temp) adc_trim = adc_mid3_vol * 511 / temp ; else{ adc_trim = 511; - printk("!!!!!!!!! temp is zero\n"); + // printk("!!!!!!!!! temp is zero\n"); } - printk("adc_trim = %d \n", adc_trim); + // printk("adc_trim = %d \n", adc_trim); t_data3[t_data_now3] = temp; t_data_now3++; @@ -555,7 +555,7 @@ static int adc_proc_show(struct seq_file *seq, void *v) //printk("%d\n", adc_mid2_vol); volt = adc_mid2_vol; }else if ( avg_sel == 3 ){ - printk("adc_mid3_vol = %d\n", adc_mid3_vol); + // printk("adc_mid3_vol = %d\n", adc_mid3_vol); volt = adc_mid3_vol; } seq_printf(seq,"%d\n",volt); @@ -903,7 +903,7 @@ static int nvt_adc_probe(struct platform_device *pdev) } //pr_info("%s %d: of_id->compatible = %s\n", __func__, __LINE__, of_id->compatible); #endif -printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); +// printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); iio = iio_device_alloc(sizeof(struct nvt_adc_state) ); if (!iio){ return -ENOMEM; @@ -1004,7 +1004,7 @@ printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); adc_mid_val = adc_mid; adc_mid_vol = (adc_mid +CALI_OFFSET)*adc_trim/511; - printk("adc_mid first value = %u\n", adc_mid_val); + // printk("adc_mid first value = %u\n", adc_mid_val); }else if(avg_sel == 1 ) { adc_mid1 = data_reg.reg; @@ -1012,7 +1012,7 @@ printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); adc_mid1_val = adc_mid1; adc_mid1_vol = (adc_mid1 +CALI_OFFSET)*adc_trim/511; - printk("adc_mid1 first value = %u\n", adc_mid1_val); + // printk("adc_mid1 first value = %u\n", adc_mid1_val); }else if(avg_sel == 2 ) { adc_mid2 = data_reg.reg; @@ -1020,7 +1020,7 @@ printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); adc_mid2_val = adc_mid2; adc_mid2_vol = (adc_mid2 +CALI_OFFSET)*adc_trim/511; - printk("adc_mid2 first value = %u\n", adc_mid2_val); + // printk("adc_mid2 first value = %u\n", adc_mid2_val); }else if(avg_sel == 3 ) { adc_mid3 = data_reg.reg; @@ -1028,7 +1028,7 @@ printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); adc_mid3_val = adc_mid3; adc_mid3_vol = (adc_mid3 +CALI_OFFSET)*adc_trim/511; - printk("adc_mid3 first value = %u\n", adc_mid3_val); + // printk("adc_mid3 first value = %u\n", adc_mid3_val); } From ec944cd1db6c9b44bb1cfa943a0825aec02759c5 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 13 Nov 2023 16:51:54 +0800 Subject: [PATCH 4/9] =?UTF-8?q?1.=E5=BC=80=E5=90=AFlog=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- .../code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 8380c3943..f919a0dac 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -603,7 +603,7 @@ #define UCTRL_APP_MOVIE_FEATURE_SETGET DISABLE #define MEDIA_VASTREAM DISABLE #define IR_CUT_FUNC DISABLE -#define LOGFILE_FUNC DISABLE +#define LOGFILE_FUNC ENABLE #define _ADAS_FUNC_ DISABLE //.............................................................................. // ADAS subsetting (The following sub-functions are available only if _ADAS_FUNC_ = DISABLE diff --git a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index f3c70aa96..c9a892b98 100755 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -620,7 +620,7 @@ #define UCTRL_APP_MOVIE_FEATURE_SETGET DISABLE #define MEDIA_VASTREAM DISABLE #define IR_CUT_FUNC DISABLE -#define LOGFILE_FUNC DISABLE +#define LOGFILE_FUNC ENABLE #define _ADAS_FUNC_ DISABLE //.............................................................................. // ADAS subsetting (The following sub-functions are available only if _ADAS_FUNC_ = DISABLE From cfb6bdd395639bb16fe920eb217c7a88e1755550 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 13 Nov 2023 16:53:26 +0800 Subject: [PATCH 5/9] =?UTF-8?q?1.cardv=E5=90=AF=E5=8A=A8=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E4=B8=8D=E5=8A=A0=E8=BD=BDusb=20ko=EF=BC=8C=E5=9C=A8sfapp?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/SrcCode/System/SysUsb_Exe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c b/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c index b69776c6f..f34c55fd9 100755 --- a/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysUsb_Exe.c @@ -285,7 +285,7 @@ void System_OnUsbInit(void) GxUSB_SetChargerType(FALSE); } else{ - System_InsmodUsb(TRUE); /* insmod usb host ko */ + //System_InsmodUsb(TRUE); /* insmod usb host ko */ } TM_BOOT_END("usb", "init"); } From d7e783bdc6df1f280c03af657bad152abdbb83a2 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 14 Nov 2023 19:21:18 +0800 Subject: [PATCH 6/9] =?UTF-8?q?1.=E6=9B=B4=E6=94=B9SendMaxNum=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/sf_app/code/source/4gMng/sf_ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2f4059afc..7772c040a 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 @@ -158,7 +158,7 @@ SINT32 sf_check_max_num(void) } } - if(SF_MCU_STARTUP_ONKEY == sf_poweron_type_get()) + if((SF_MCU_STARTUP_SYN_PARAM == sf_poweron_type_get()) || (SF_MCU_STARTUP_ONKEY == sf_poweron_type_get())) { ret = SF_SUCCESS; } From 4a7e9058555d89ca536f7655f9ed8802625afbfd Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 14 Nov 2023 19:21:44 +0800 Subject: [PATCH 7/9] =?UTF-8?q?1.4G=E6=A0=87=E8=AF=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/4gMng/sf_eg91_sim.c | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c index cd12b26c8..f2f0330f7 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c @@ -42,7 +42,7 @@ BOOL GprsNetWorkReady = FALSE; time_t sendStartTime; UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE; extern SF_PARA_TIME_S rtcTime; - +CHAR netGeneration = SF_NET_NO; // SF_PARA_TIME_S nowDate = { 0, 0, 0, 0, 0, 0}; typedef struct sf_cimi_id @@ -3696,7 +3696,8 @@ SINT32 sf_net_regist_manual(void) { if(strstr((const char *)gsmPara, "No Service")) { - puiPara->NetGeneration = 2; + //puiPara->NetGeneration = 2; + netGeneration = 2; } else if(NULL != strtok((char *)(char *)gsmPara, "\"")) { @@ -3705,24 +3706,31 @@ SINT32 sf_net_regist_manual(void) if((strstr((const char *)netStr, "DD") != NULL)) { - puiPara->NetGeneration = 4; + //puiPara->NetGeneration = 4; + netGeneration = 4; } else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL)) { - puiPara->NetGeneration = 3; + //puiPara->NetGeneration = 3; + netGeneration = 3; } else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) { - puiPara->NetGeneration = 2; + //puiPara->NetGeneration = 2; + netGeneration = 2; } else { - puiPara->NetGeneration = 2; + // puiPara->NetGeneration = 2; + netGeneration = 2; } } - - if(puiPara->NetGeneration == 4) + if(puiPara->NetGeneration != netGeneration) + { + puiPara->NetGeneration = netGeneration; + } + if(netGeneration == 4) { eNetRegLocation = QUECTEL_NETREG_QCSQ; strcpy((char *)gsmPara, "AT+QCSQ\r"); @@ -4311,7 +4319,8 @@ SINT32 sf_auto_net_reg(void) { if(strstr((const char *)gsmPara, "No Service")) { - puiPara->NetGeneration = 2; + //puiPara->NetGeneration = 2; + netGeneration = 2; } else if(NULL != strtok((char *)(char *)gsmPara, "\"")) { @@ -4320,24 +4329,31 @@ SINT32 sf_auto_net_reg(void) if((strstr((const char *)netStr, "DD") != NULL)) { - puiPara->NetGeneration = 4; + // puiPara->NetGeneration = 4; + netGeneration = 4; } else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL)) { - puiPara->NetGeneration = 3; + // puiPara->NetGeneration = 3; + netGeneration = 3; } else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) { - puiPara->NetGeneration = 2; + // puiPara->NetGeneration = 2; + netGeneration = 2; } else { - puiPara->NetGeneration = 2; + // puiPara->NetGeneration = 2; + netGeneration = 2; } } - - if(puiPara->NetGeneration == 4) + if(puiPara->NetGeneration != netGeneration) + { + puiPara->NetGeneration = netGeneration; + } + if(netGeneration == 4) { eNetRegLocation = QUECTEL_NETREG_QCSQ; strcpy((char *)gsmPara, "AT+QCSQ\r"); From a60cfa1acff5886596957a6a4cb2174959608d02 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 14 Nov 2023 19:22:35 +0800 Subject: [PATCH 8/9] =?UTF-8?q?1.=E6=9B=B4=E6=94=B9gps=20=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=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); From 33dec69bfff09b3ef45f5bab4fc40de7709af2cb Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 14 Nov 2023 19:23:24 +0800 Subject: [PATCH 9/9] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/include/sf_log.h | 75 ++++++++++++++++++- .../source/sf_app/code/source/logMng/sf_log.c | 43 ++++++----- 2 files changed, 99 insertions(+), 19 deletions(-) diff --git a/code/application/source/sf_app/code/include/sf_log.h b/code/application/source/sf_app/code/include/sf_log.h index d3449ad06..419bd9197 100644 --- a/code/application/source/sf_app/code/include/sf_log.h +++ b/code/application/source/sf_app/code/include/sf_log.h @@ -41,7 +41,7 @@ extern "C" { #define WARNING_FILE_PATH SF_SD_ROOT"warning.txt" #define INFO_FILE_PATH SF_SD_ROOT"info.txt" -#define SF_LOG_VAR 1 +#define SF_LOG_VAR 0 #define LOG_AT_FILE_TMP_PATH "/tmp/SF_GPS.TXT" @@ -102,6 +102,43 @@ typedef enum SF_LOG_TYPE_E #define SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) #define SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) #define SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define SYS_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define AE_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define CAM_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define CAM_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define CAM_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define CAM_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define NET_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define NET_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define NET_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define NET_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define WIFI_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define WIFI_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define WIFI_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define WIFI_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define P2P_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define P2P_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define P2P_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define P2P_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + +#define BLU_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, __FUNCTION__, __LINE__, fmt, ##args) +#define BLU_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, __FUNCTION__, __LINE__, fmt, ##args) +#define BLU_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, __FUNCTION__, __LINE__, fmt, ##args) +#define BLU_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, __FUNCTION__, __LINE__, fmt, ##args) + #else #define MLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_MAX, __FUNCTION__, __LINE__, fmt, ##args) @@ -114,6 +151,42 @@ typedef enum SF_LOG_TYPE_E #define SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_MAX, __FUNCTION__, __LINE__, fmt, ##args) #define SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_MAX, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_SYS, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_SYS, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_SYS, __FUNCTION__, __LINE__, fmt, ##args) +#define SYS_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_SYS, __FUNCTION__, __LINE__, fmt, ##args) + +#define AE_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_AE, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_AE, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_AE, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_AE, __FUNCTION__, __LINE__, fmt, ##args) +#define AE_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_AE, __FUNCTION__, __LINE__, fmt, ##args) + +#define CAM_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_CAM, __FUNCTION__, __LINE__, fmt, ##args) +#define CAM_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_CAM, __FUNCTION__, __LINE__, fmt, ##args) +#define CAM_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_CAM, __FUNCTION__, __LINE__, fmt, ##args) +#define CAM_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_CAM, __FUNCTION__, __LINE__, fmt, ##args) + +#define NET_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_4G, __FUNCTION__, __LINE__, fmt, ##args) +#define NET_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_4G, __FUNCTION__, __LINE__, fmt, ##args) +#define NET_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_4G, __FUNCTION__, __LINE__, fmt, ##args) +#define NET_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_4G, __FUNCTION__, __LINE__, fmt, ##args) + +#define WIFI_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_WIFI, __FUNCTION__, __LINE__, fmt, ##args) +#define WIFI_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_WIFI, __FUNCTION__, __LINE__, fmt, ##args) +#define WIFI_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_WIFI, __FUNCTION__, __LINE__, fmt, ##args) +#define WIFI_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_WIFI, __FUNCTION__, __LINE__, fmt, ##args) + +#define P2P_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_P2P, __FUNCTION__, __LINE__, fmt, ##args) +#define P2P_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_P2P, __FUNCTION__, __LINE__, fmt, ##args) +#define P2P_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_P2P, __FUNCTION__, __LINE__, fmt, ##args) +#define P2P_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_P2P, __FUNCTION__, __LINE__, fmt, ##args) + +#define BLU_SLOGE(fmt, args...) sf_log_file(SF_LOG_LEVEL_ERROR, SF_LOG_TYPE_BLU, __FUNCTION__, __LINE__, fmt, ##args) +#define BLU_SLOGW(fmt, args...) sf_log_file(SF_LOG_LEVEL_WARNING, SF_LOG_TYPE_BLU, __FUNCTION__, __LINE__, fmt, ##args) +#define BLU_SLOGI(fmt, args...) sf_log_file(SF_LOG_LEVEL_INFO, SF_LOG_TYPE_BLU, __FUNCTION__, __LINE__, fmt, ##args) +#define BLU_SLOGD(fmt, args...) sf_log_file(SF_LOG_LEVEL_DEBUG, SF_LOG_TYPE_BLU, __FUNCTION__, __LINE__, fmt, ##args) + #endif #define SLOG_DM(fmt, args...) sf_log_module(__FUNCTION__, __LINE__, fmt, ##args) diff --git a/code/application/source/sf_app/code/source/logMng/sf_log.c b/code/application/source/sf_app/code/source/logMng/sf_log.c index fd0a9674f..d7eba7eaa 100644 --- a/code/application/source/sf_app/code/source/logMng/sf_log.c +++ b/code/application/source/sf_app/code/source/logMng/sf_log.c @@ -94,7 +94,6 @@ static int sf_is_sdc_mounted(void) { char line[256]; static int is_mounted = 0; - printf("%s:%d is_mounted:%d", __FUNCTION__, __LINE__,is_mounted); if(is_mounted) { return is_mounted; @@ -114,6 +113,7 @@ static int sf_is_sdc_mounted(void) } fclose(file); + printf("%s:%d is_mounted:%d", __FUNCTION__, __LINE__,is_mounted); return is_mounted; } @@ -302,11 +302,28 @@ void sf_log_file(SF_LOG_LEVEL_e enLevel, SF_LOG_TYPE_e enType,const char *pszFun CHAR tmpBuf[2048] = { 0 }; CHAR enCodeLog[2048] = { 0 }; + enDstLevel = sf_log_Level_get(); if(enLevel <= enDstLevel) { pszFmt = (NULL == pszFmt) ? "" : pszFmt; + if(enLevel == SF_LOG_LEVEL_ERROR) + { + fprintf(stdout,LIGHT_RED "[LOGE][%s:%d]"NONE,pszFunc, u32Line); + }else if(enLevel == SF_LOG_LEVEL_WARNING) + { + fprintf(stdout,YELLOW "[LOGW][%s:%d]"NONE,pszFunc, u32Line); + }else if(enLevel == SF_LOG_LEVEL_INFO) + { + fprintf(stdout,LIGHT_GREEN "[LOGI][%s:%d]"NONE,pszFunc, u32Line); + }else if(enLevel == SF_LOG_LEVEL_DEBUG) + { + fprintf(stdout,LIGHT_PURPLE "[LOGD][%s:%d]"NONE,pszFunc, u32Line); + } + va_start(args, pszFmt); + vfprintf(stdout, pszFmt, args); + va_end(args); if((enLevel == SF_LOG_LEVEL_ERROR) ||(1 == puiPara->DebugMode)) { if(sf_is_sdc_mounted()) @@ -359,6 +376,10 @@ void sf_log_file(SF_LOG_LEVEL_e enLevel, SF_LOG_TYPE_e enType,const char *pszFun p = gmtime(&timep); if(flog != NULL) { + if(p == NULL) + { + printf("%s:%d p NULL", __FUNCTION__, __LINE__); + } fseek(flog, 0L, SEEK_END); if(SF_LOG_LEVEL_ERROR == enLevel) { @@ -395,8 +416,9 @@ void sf_log_file(SF_LOG_LEVEL_e enLevel, SF_LOG_TYPE_e enType,const char *pszFun if(SF_LOG_TYPE_SYS == enType) { - sprintf((char*)tmpBuf,"[%04d/%02d/%02d %02d:%02d:%02d][LOG][SYS]",p->tm_year + 1900, p->tm_mon + 1, p->tm_mday, + snprintf((char *)tmpBuf, sizeof(tmpBuf), "[%04d/%02d/%02d %02d:%02d:%02d][LOG][SYS]",p->tm_year + 1900, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + } else if(SF_LOG_TYPE_AE == enType) { @@ -461,22 +483,7 @@ void sf_log_file(SF_LOG_LEVEL_e enLevel, SF_LOG_TYPE_e enType,const char *pszFun } } - if(enLevel == SF_LOG_LEVEL_ERROR) - { - fprintf(stdout,LIGHT_RED "[LOGE][%s:%d]"NONE,pszFunc, u32Line); - }else if(enLevel == SF_LOG_LEVEL_WARNING) - { - fprintf(stdout,YELLOW "[LOGW][%s:%d]"NONE,pszFunc, u32Line); - }else if(enLevel == SF_LOG_LEVEL_INFO) - { - fprintf(stdout,LIGHT_GREEN "[LOGI][%s:%d]"NONE,pszFunc, u32Line); - }else if(enLevel == SF_LOG_LEVEL_DEBUG) - { - fprintf(stdout,LIGHT_PURPLE "[LOGD][%s:%d]"NONE,pszFunc, u32Line); - } - va_start(args, pszFmt); - vfprintf(stdout, pszFmt, args); - va_end(args); + } return; }