From abeb8975d7212b1bce3dd103a7bc8c1717d9b820 Mon Sep 17 00:00:00 2001 From: alisa Date: Tue, 12 Sep 2023 22:58:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E4=B8=9A=E5=8A=A1]1.=E8=B0=83=E8=AF=95=20?= =?UTF-8?q?E-sim=E7=9A=84=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/include/sf_eg91_gps.h | 1 - .../code/source/4gMng/sf_4G_auto_operation.c | 2 +- .../sf_app/code/source/4gMng/sf_eg91_gps.c | 3 ++- .../sf_app/code/source/4gMng/sf_eg91_sim.c | 17 ++++++++++++++--- .../sf_app/code/source/4gMng/sf_opera_adapt.c | 2 +- .../source/sf_app/code/source/app/sf_app.c | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) mode change 100644 => 100755 code/application/source/sf_app/code/include/sf_eg91_gps.h mode change 100644 => 100755 code/application/source/sf_app/code/source/4gMng/sf_4G_auto_operation.c mode change 100644 => 100755 code/application/source/sf_app/code/source/4gMng/sf_eg91_gps.c mode change 100644 => 100755 code/application/source/sf_app/code/source/4gMng/sf_opera_adapt.c diff --git a/code/application/source/sf_app/code/include/sf_eg91_gps.h b/code/application/source/sf_app/code/include/sf_eg91_gps.h old mode 100644 new mode 100755 index 179b02b1f..d0a1eb2e1 --- a/code/application/source/sf_app/code/include/sf_eg91_gps.h +++ b/code/application/source/sf_app/code/include/sf_eg91_gps.h @@ -62,7 +62,6 @@ SINT32 eg91_gps_search(SF_FN_PARAM_S *pfnParam,SF_PARA_TIME_S *pNowTime,UINT8 au SINT32 eg91_gps_Isupdate(SF_FN_PARAM_S *pfnParam,UINT8 *pIsupdate,SF_PARA_TIME_S *pNowTime,UINT8 u8day); - #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/4gMng/sf_4G_auto_operation.c b/code/application/source/sf_app/code/source/4gMng/sf_4G_auto_operation.c old mode 100644 new mode 100755 index 21773354f..b95e4342d --- a/code/application/source/sf_app/code/source/4gMng/sf_4G_auto_operation.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_4G_auto_operation.c @@ -66,7 +66,7 @@ UINT32 sf_auto_operation_adjust(void) } else if((SF_STRNCMP(puiPara->OperatorCode, "46003", 5) == 0) || (SF_STRNCMP(puiPara->OperatorCode, "46005", 5) == 0) || (SF_STRNCMP(puiPara->OperatorCode, "46011", 5) == 0))//china Telecom { - SF_STRCPY(puiPara->Sim4gApn, "CTNET"); + SF_STRCPY(puiPara->Sim4gApn, "vzwinternet"); SF_STRCPY(puiPara->Sim4gUsr, "\0"); SF_STRCPY(puiPara->Sim4gPwd, "\0"); diff --git a/code/application/source/sf_app/code/source/4gMng/sf_eg91_gps.c b/code/application/source/sf_app/code/source/4gMng/sf_eg91_gps.c old mode 100644 new mode 100755 index 37e46d85c..87a8ad30c --- a/code/application/source/sf_app/code/source/4gMng/sf_eg91_gps.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_eg91_gps.c @@ -14,6 +14,7 @@ #include "sf_hal_ttyusb.h" #include "sf_eg91_server.h" #include "sf_eg91_gps.h" +#include "sf_eg91_sim.h" #include "sf_param_common.h" #include "sf_module.h" @@ -63,6 +64,7 @@ static void gps_infor_convert(SF_CHAR *str) memcpy(str, strTemp, 4); } + SINT32 eg91_gps_greendate_Get(SF_FN_PARAM_S *pfnParam,SF_PARA_TIME_S *pNowTime) { SINT32 ttyRet = SF_SUCCESS; @@ -311,7 +313,6 @@ SINT32 eg91_gps_greendate_Get(SF_FN_PARAM_S *pfnParam,SF_PARA_TIME_S *pNowTime) } return ret; } - SINT32 eg91_gps_Isupdate(SF_FN_PARAM_S *pfnParam,UINT8 *pIsupdate,SF_PARA_TIME_S *pNowTime,UINT8 u8day) { 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 d1ac9e8df..bdd607a2c 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 @@ -3417,7 +3417,13 @@ SINT32 sf_net_regist_manual(void) } else { - sprintf((char *)gsmPara, "AT+RSTSET\r"); + //sprintf((char *)gsmPara, "AT+RSTSET\r"); + //sprintf((char *)gsmPara, "AT+CGREG?\r"); + //eNetRegLocation = QUECTEL_NETREG_CGREG; + //callTime = SF_QUECTEL_NET_REG_CALLTIME_MAX; /*4 min*/ + sprintf((char *)gsmPara, "%s", "AT+CGDCONT=1,\"IPV4V6\",\"\"\r"); + eNetRegLocation = QUECTEL_NETREG_CGDCONT; + } } else @@ -3477,6 +3483,9 @@ SINT32 sf_net_regist_manual(void) if(ret == SF_SUCCESS) { eNetRegLocation = QUECTEL_NETREG_FRIST; + //sprintf((char *)gsmPara, "AT+CGREG?\r"); + //eNetRegLocation = QUECTEL_NETREG_CGREG; + //callTime = SF_QUECTEL_NET_REG_CALLTIME_MAX; } else { @@ -3513,7 +3522,7 @@ SINT32 sf_net_regist_manual(void) #if SF_TEST_ERROR_CODE sf_test_code_err(eNetRegLocation, "+CGREG: 0,2"); #endif - + SF_DEBUG("Sim4gApn=%s", puiPara->Sim4gApn); if((strstr((const char *)gsmPara, "+CGREG: 2,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,5") != NULL)) { if(PWR_ON_TIME_SYNC == sf_poweron_type_get()) @@ -4789,6 +4798,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time) UIMenuStoreInfo *pPara = sf_app_ui_para_get(); SF_TTY_DATA_TYPE_S ttyData = { .waitMs = 2000, .len = 3, .lenMax = (GPRS_INFO_LINE_MAX-1), .cmp = "OK", .cmperr = "ERROR", .data = gsmPara}; + SF_DEBUG("Sim4gApn=%s", pPara->Sim4gApn); sf_gsm_para_buff_clear(); pdpIndex = sf_get_pdp_index(); @@ -4996,7 +5006,8 @@ UINT8 sf_get_pdp_index(void) UINT8 pdpIndex = 0; UIMenuStoreInfo *pPara = sf_app_ui_para_get(); - + + SF_DEBUG("Sim4gApn=%s", pPara->Sim4gApn); if(strstr((const char *)pPara->Sim4gApn, APN_4G_VERIZON)) { pdpIndex = V_PDP_INDEX; diff --git a/code/application/source/sf_app/code/source/4gMng/sf_opera_adapt.c b/code/application/source/sf_app/code/source/4gMng/sf_opera_adapt.c old mode 100644 new mode 100755 index fbc72bfc9..fdf70f324 --- a/code/application/source/sf_app/code/source/4gMng/sf_opera_adapt.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_opera_adapt.c @@ -75,7 +75,7 @@ SINT32 sf_auto_operation_adaptation(SF_CHAR *operatorName, UIMenuStoreInfo *sim_ } else if((strncmp(operatorName, "46003", 5) == 0) || (strncmp(operatorName, "46005", 5) == 0) || (strncmp(operatorName, "46011", 5) == 0))//china telcom { - strcpy(sim_info_t->Sim4gApn, "CTNET"); + strcpy(sim_info_t->Sim4gApn, "vzwinternet"); strcpy(sim_info_t->Sim4gUsr, "\0"); strcpy(sim_info_t->Sim4gPwd, "\0"); diff --git a/code/application/source/sf_app/code/source/app/sf_app.c b/code/application/source/sf_app/code/source/app/sf_app.c index 4f167fb5e..00248ee90 100755 --- a/code/application/source/sf_app/code/source/app/sf_app.c +++ b/code/application/source/sf_app/code/source/app/sf_app.c @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) { printf("*********************************************\n"); printf("* *\n"); - printf("* sf_app-v3 *\n"); + printf("* sf_app-v5-0912 *\n"); printf("* *\n"); printf("*********************************************\n"); //gpio_direction_input(C_GPIO(10)); From 5553611f59b2a266bf646ed4c3f9d6d98fcfc8e9 Mon Sep 17 00:00:00 2001 From: alisa Date: Tue, 12 Sep 2023 23:00:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[sifar=20SDK].=E6=9B=B4=E6=96=B0sifar=20SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/sifarsdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/sifarsdk b/code/application/sifarsdk index 16e808c3a..670d2f3fc 160000 --- a/code/application/sifarsdk +++ b/code/application/sifarsdk @@ -1 +1 @@ -Subproject commit 16e808c3a97ba4c47dd683f1daa79b4459b20202 +Subproject commit 670d2f3fc39f4803f5a72bf125c0aea7a146a100 From ad9a4b1687562dbbb78142212d3385000c3e2aa3 Mon Sep 17 00:00:00 2001 From: alisa Date: Tue, 12 Sep 2023 23:26:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[warning]1.=E5=8E=BB=E9=99=A4=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/source/sifar/code/include/sf_common.h | 2 +- .../sifar/code/source/common/sf_common.c | 42 +------------------ 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index e8e1c26d5..a0a74c4be 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -122,7 +122,7 @@ UINT32 sf_cardv_cap_start(void); UINT32 sf_cardv_hd_cap_start(void); void sf_cardv_set_wait_shared_condition(int in); int sf_cardv_para_signaling_start(void); -UINT32 sf_cardv_wifi_send(void); +void sf_cardv_wifi_send(void); void sf_set_ui_para_flag(UINT8 flag); UINT8 sf_get_ui_para_flag(void); BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv); diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index d7d4c3bde..61f559fb4 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -1711,7 +1711,7 @@ void sf_cardv_wifi_send() if(SF_SUCCESS == sf_share_mem_hd_update()) { - SF_REPORT_WIFI_ATTR_S* wifiCfg = sf_wifi_cfg_get(); + //SF_REPORT_WIFI_ATTR_S* wifiCfg = sf_wifi_cfg_get(); fd = sf_get_wifi_socket(); SF_CHAR filePath[64] = { 0 }; @@ -2684,46 +2684,6 @@ UINT32 sf_cardv_hd_cap_start(void) return SF_SUCCESS; } -UINT32 sf_cardv_wifi_send(void) -{ - SINT32 fd = 0; - SINT32 sendBuffLen = 0; - SINT8 sendBuff[1024] = { 0 }; - SINT32 i = 0; - struct stat statBuf; - - if(SF_SUCCESS == sf_share_mem_hd_update()) - { - //SF_REPORT_WIFI_ATTR_S* wifiCfg = sf_wifi_cfg_get(); - fd = sf_get_wifi_socket(); - - SF_CHAR filePath[64] = { 0 }; - SINT32 fdWifi = -1; - sprintf(filePath, "/tmp/wifiData.txt"); - printf("filePath:%s\n", filePath); - - fdWifi = open(filePath, O_RDWR, 0777); - if(fdWifi >= 0) - { - fstat(fdWifi, &statBuf); - sendBuffLen = statBuf.st_size; - printf("fSize=%d\n", sendBuffLen); - read(fdWifi, sendBuff, sendBuffLen); - close(fdWifi); - - for(i = 0; i < sendBuffLen; i++) - { - printf("[%x]-", sendBuff[i]); - } - printf("\n[cardv-sendBuff-1] e\n"); - - send(fd, sendBuff, sendBuffLen, 0); - remove("/tmp/wifiData.txt"); - } - } - return 0; -} - UINT8 sf_get_ui_para_flag(void) { return UiparaFlag;