Merge remote-tracking branch 'origin/Branch_S530' into branch_s530
This commit is contained in:
commit
0a5c35d505
|
@ -921,7 +921,7 @@
|
|||
#define HUNTING_MCU_UART ENABLE
|
||||
#define HUNTING_IR_LED_940 ENABLE
|
||||
#define SF_EXIF_MN_BUF_SIZE 256
|
||||
#define SF_BASE_VERSION "7MD4RCwD9T1"
|
||||
#define SF_BASE_VERSION "7MD4RCwD901"
|
||||
#define HW_S530 1
|
||||
#define DCF_DIR_NAME "MEDIA" /* 100MEDIA */
|
||||
#define DCF_FILE_NAME "SYFW" /* SYFW0001.JPG */
|
||||
|
@ -955,10 +955,10 @@
|
|||
|
||||
#define SF_4G_USB_NET_DOWNLOAD 1
|
||||
|
||||
#define SF_TEST_GPRS 1
|
||||
#define SF_TEST_GPRS 0
|
||||
#define CUSTOM_TEST_FTPS 0
|
||||
|
||||
#define SF_TEST_OTA_FTP 1
|
||||
#define SF_TEST_OTA_FTP 0
|
||||
#define CUSTOM_TEST_OTA_FTP 0
|
||||
#define SF_BATTERY_TEST DISABLE
|
||||
#define SF_BATTERY_TEST_FILE "A:\\BATTERY.TXT"
|
||||
|
|
|
@ -1795,14 +1795,14 @@ void SysResetFlag(void)
|
|||
//SF_STRCPY(puiPara ->APNGPRS, "3gnet");
|
||||
#else
|
||||
sf_base64_decode(USER_FTP_IP, (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpIp, sizeof(puiPara->FtpIp), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpPort, sizeof(puiPara->FtpPort), USER_FTP_PORT);
|
||||
snprintf((char *)puiPara->FtpsIp, sizeof(puiPara->FtpsIp), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpsPort, sizeof(puiPara->FtpsPort), USER_FTP_PORT);
|
||||
memset(tmpStr, '\0', sizeof(tmpStr));
|
||||
sf_base64_decode(USER_FTP_USERNAME, (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpUsr, sizeof(puiPara->FtpUsr), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpsUsr, sizeof(puiPara->FtpsUsr), (char *)tmpStr);
|
||||
memset(tmpStr, '\0', sizeof(tmpStr));
|
||||
sf_base64_decode(USER_FTP_PASSWORD, (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpPwd, sizeof(puiPara->FtpPwd), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpsPwd, sizeof(puiPara->FtpsPwd), (char *)tmpStr);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -523,12 +523,12 @@ typedef struct _UIMenuUIMenuStoreInfo {
|
|||
UINT8 FtpIp[40];
|
||||
UINT8 FtpPort[5];
|
||||
UINT8 FtpUsr[40];
|
||||
UINT8 FtpPwd[20];
|
||||
UINT8 FtpPwd[40];
|
||||
|
||||
UINT8 FtpsIp[40];
|
||||
UINT8 FtpsPort[5];
|
||||
UINT8 FtpsUsr[40];
|
||||
UINT8 FtpsPwd[20];
|
||||
UINT8 FtpsPwd[40];
|
||||
|
||||
UINT8 OtaFtpIp[40];
|
||||
UINT8 OtaFtpPort[5];
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
#define INPUT_SUBFOLDER "mnt/sd/config"
|
||||
#define OUTPUT_SUBFOLDER "mnt/sd/logs"
|
||||
|
||||
#ifndef true
|
||||
#define true 1
|
||||
#endif
|
||||
|
||||
#ifndef false
|
||||
#define false 0
|
||||
#endif
|
||||
#ifndef true
|
||||
#define true 1
|
||||
#endif
|
||||
|
||||
#ifndef false
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
|
||||
#define PROFILE_STATE_DISABLED 0
|
||||
|
@ -48,9 +48,9 @@ LPA_API_ERROR sf_enable_profile(UINT8 indexProfiles);
|
|||
UINT32 sf_profile_name_paired(UINT8 *profileName, UINT8 *operatorName);
|
||||
void sf_lpa_profile_active_change(void);
|
||||
|
||||
UINT8 sf_is_esim_card();
|
||||
UINT8 sf_is_esim_init_finish();
|
||||
|
||||
UINT8 sf_is_esim_card(void);
|
||||
UINT8 sf_is_esim_init_finish(void);
|
||||
SF_BOOL sf_get_eid(UINT8 *eidStr);
|
||||
UINT32 sf_get_profile_total(void);
|
||||
UINT32 sf_is_profile_index_enable(UINT8 index);
|
||||
UINT32 sf_get_profile_item(UINT8 index, LPA_PROFILE_INFO *profileInfo);
|
||||
|
@ -70,7 +70,7 @@ SINT32 sf_lpa_set_download_profile_iccid(SINT8* iccid);
|
|||
void sf_set_wifi_socket(int fd);
|
||||
int sf_get_wifi_socket(void);
|
||||
void sf_set_wifi_cmd(UINT8 cmd);
|
||||
UINT8 sf_get_wifi_cmd();
|
||||
UINT8 sf_get_wifi_cmd(void);
|
||||
void sf_network_select(UINT8* profileId);
|
||||
void sf_4g_operator_scan(UINT8 mode);
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ void keep_seraching_gps_location(const int timeout_ms);
|
|||
void app_RegisterNet_stop(void);
|
||||
int sf_check_sd(void);
|
||||
void sf_save_camera_gps_info(void);
|
||||
|
||||
void set_at_parament(void);
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ SINT32 sf_app_load_ko_start(void);
|
|||
SINT32 sf_app_mcu_para_start(void);
|
||||
SINT32 app_auto_poweroff_start(void);
|
||||
UINT8 sf_check_power_on_mode(void);
|
||||
void sf_power_off_msg_to_cardv(void);
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
|
|
@ -1918,7 +1918,7 @@ void sf_set_esim_card(UINT8 flag)
|
|||
g_esim_flag = flag;
|
||||
}
|
||||
|
||||
UINT8 sf_is_esim_card()
|
||||
UINT8 sf_is_esim_card(void)
|
||||
{
|
||||
return g_esim_flag;
|
||||
}
|
||||
|
@ -1930,7 +1930,7 @@ void sf_set_esim_init_finish(UINT8 flag)
|
|||
{
|
||||
g_esim_init_finish_flag = flag;
|
||||
}
|
||||
UINT8 sf_is_esim_init_finish()
|
||||
UINT8 sf_is_esim_init_finish(void)
|
||||
{
|
||||
return g_esim_init_finish_flag;
|
||||
}
|
||||
|
@ -1971,7 +1971,7 @@ void sf_lpa_profile_info_refresh(void)
|
|||
|
||||
|
||||
|
||||
void sf_sample_lpa_thread()
|
||||
void sf_sample_lpa_thread(void)
|
||||
{
|
||||
bool res;
|
||||
const LPA_API_VERSION* lpaApiVersion;
|
||||
|
@ -2346,7 +2346,7 @@ void sf_sample_lpa_init(void)
|
|||
|
||||
if(!SfLpaTskParam.IsRun)
|
||||
{
|
||||
pthread_create(&SfLpaTskParam.TskId, NULL, sf_sample_lpa_thread, NULL);
|
||||
pthread_create(&SfLpaTskParam.TskId, NULL, (void *)sf_sample_lpa_thread, NULL);
|
||||
SfLpaTskParam.IsRun = 1;
|
||||
}
|
||||
}
|
||||
|
@ -2369,7 +2369,7 @@ void sf_profile_active_change_thread(ULONG tmp)
|
|||
void sf_lpa_profile_active_change(void)
|
||||
{
|
||||
pthread_t tLpaProfileActiveTask;
|
||||
pthread_create(&tLpaProfileActiveTask,NULL,sf_profile_active_change_thread,(void *)NULL);
|
||||
pthread_create(&tLpaProfileActiveTask,NULL,(void *)sf_profile_active_change_thread,(void *)NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2803,42 +2803,42 @@ void sf_operator_scan_thread(UINT32 *tmp)
|
|||
{
|
||||
printf("scan network.\n");
|
||||
|
||||
UINT8 totalOperator = 0;
|
||||
UINT8 totalProfile = 0;
|
||||
UINT8 i = 0;
|
||||
UINT8 errCode = CMD_SUCCESS;
|
||||
UINT8 mode = (UINT8)*tmp;
|
||||
UINT8 *sendBuff = NULL;
|
||||
UINT16 sendBuffLen = 0;
|
||||
APP_SVR_PACKET_T *pMsgParse = NULL;
|
||||
SF_OPERATORS_LIST_T operatorInfo;
|
||||
Operator_Info_T *pOperatorInfo = NULL;
|
||||
Profile_Info_T *pProfileInfo = NULL;
|
||||
LPA_PROFILE_INFO profileItem;
|
||||
UINT16 profileListBase = 0;
|
||||
UINT8 totalOperator = 0;
|
||||
UINT8 totalProfile = 0;
|
||||
UINT8 i = 0;
|
||||
UINT8 errCode = CMD_SUCCESS;
|
||||
UINT8 mode = (UINT8)*tmp;
|
||||
UINT8 *sendBuff = NULL;
|
||||
UINT16 sendBuffLen = 0;
|
||||
APP_SVR_PACKET_T *pMsgParse = NULL;
|
||||
SF_OPERATORS_LIST_T operatorInfo;
|
||||
Operator_Info_T *pOperatorInfo = NULL;
|
||||
Profile_Info_T *pProfileInfo = NULL;
|
||||
LPA_PROFILE_INFO profileItem;
|
||||
UINT16 profileListBase = 0;
|
||||
UINT8 OperatorNameL[20] = {0};
|
||||
SF_REPORT_WIFI_ATTR_S* wifiCfg = sf_wifi_cfg_get();
|
||||
|
||||
memset((void *)&profileItem, 0, sizeof(LPA_PROFILE_INFO));
|
||||
memset((void *)&operatorInfo, 0, sizeof(SF_OPERATORS_LIST_T));
|
||||
|
||||
printf("mode=%d\n", mode);
|
||||
|
||||
errCode = sf_check_network_status();
|
||||
|
||||
if(errCode == CMD_SUCCESS)
|
||||
{
|
||||
totalOperator = sf_get_operator_total();
|
||||
|
||||
if(mode == 0) //scan
|
||||
{
|
||||
|
||||
memset((void *)&profileItem, 0, sizeof(LPA_PROFILE_INFO));
|
||||
memset((void *)&operatorInfo, 0, sizeof(SF_OPERATORS_LIST_T));
|
||||
|
||||
printf("mode=%d\n", mode);
|
||||
|
||||
errCode = sf_check_network_status();
|
||||
|
||||
if(errCode == CMD_SUCCESS)
|
||||
{
|
||||
totalOperator = sf_get_operator_total();
|
||||
|
||||
if(mode == 0) //scan
|
||||
{
|
||||
errCode = NETWORK_CMD_NOT_SUPPORT;
|
||||
#if 0
|
||||
sf_operator_delete_to_list();
|
||||
sf_operator_scan();
|
||||
totalOperator = sf_get_operator_total();
|
||||
sf_operator_delete_to_list();
|
||||
sf_operator_scan();
|
||||
totalOperator = sf_get_operator_total();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if(mode == 1) //not scan and return esim info
|
||||
{
|
||||
|
||||
|
@ -2851,71 +2851,71 @@ void sf_operator_scan_thread(UINT32 *tmp)
|
|||
{
|
||||
errCode = NETWORK_CMD_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
totalProfile = sf_get_profile_total();
|
||||
}
|
||||
|
||||
totalProfile = sf_get_profile_total();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//int fd = sf_get_wifi_socket();
|
||||
UINT8 currentCmd = sf_get_wifi_cmd();
|
||||
|
||||
{
|
||||
sendBuffLen = 10/*Magic+MsgLen+CMD+ACK+EndFlag*/ + 5/*Operator/Profile Total,ID*/ + totalOperator * sizeof(Operator_Info_T) + totalProfile * sizeof(Profile_Info_T);
|
||||
printf("sendBuffLen=%d totalOperator=%d totalProfile=%d\n", sendBuffLen, totalOperator, totalProfile);
|
||||
sendBuff = malloc(sendBuffLen);
|
||||
memset((void *)sendBuff, 0, sendBuffLen);
|
||||
pMsgParse = (APP_SVR_PACKET_T *)sendBuff;
|
||||
pMsgParse->magicNum = htons(MSG_PRE_FIX);
|
||||
pMsgParse->cmd = htons(currentCmd);
|
||||
pMsgParse->rsp = htons(MSG_WIFI_2_APP);
|
||||
pMsgParse->msglen = htons(sendBuffLen - 2*sizeof(UINT16));
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.cmdRet = errCode;
|
||||
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[0] = totalOperator;
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[1] = 0xff;
|
||||
pOperatorInfo = (Operator_Info_T *)&(pMsgParse->msgBuf.rctrlNetworkScan.buff[2]);
|
||||
|
||||
{
|
||||
sendBuffLen = 10/*Magic+MsgLen+CMD+ACK+EndFlag*/ + 5/*Operator/Profile Total,ID*/ + totalOperator * sizeof(Operator_Info_T) + totalProfile * sizeof(Profile_Info_T);
|
||||
printf("sendBuffLen=%d totalOperator=%d totalProfile=%d\n", sendBuffLen, totalOperator, totalProfile);
|
||||
sendBuff = malloc(sendBuffLen);
|
||||
memset((void *)sendBuff, 0, sendBuffLen);
|
||||
pMsgParse = (APP_SVR_PACKET_T *)sendBuff;
|
||||
pMsgParse->magicNum = htons(MSG_PRE_FIX);
|
||||
pMsgParse->cmd = htons(currentCmd);
|
||||
pMsgParse->rsp = htons(MSG_WIFI_2_APP);
|
||||
pMsgParse->msglen = htons(sendBuffLen - 2*sizeof(UINT16));
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.cmdRet = errCode;
|
||||
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[0] = totalOperator;
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[1] = 0xff;
|
||||
pOperatorInfo = (Operator_Info_T *)&(pMsgParse->msgBuf.rctrlNetworkScan.buff[2]);
|
||||
|
||||
sf_get_operatorname(OperatorNameL);
|
||||
|
||||
for(i = 0; i < totalOperator; i++)
|
||||
{
|
||||
if(sf_get_operator_item(i, &operatorInfo) == SUCCESS)
|
||||
{
|
||||
pOperatorInfo[i].operatorId = operatorInfo.Index;
|
||||
SF_STRNCPY(&(pOperatorInfo[i].operatorName), &(operatorInfo.OperatorNameLong), 16);
|
||||
pOperatorInfo[i].signalVal = operatorInfo.SignalVal;
|
||||
|
||||
if(SF_STRNCMP(operatorInfo.OperatorNameLong, OperatorNameL, sizeof(operatorInfo.OperatorNameLong)) == 0)
|
||||
{
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[1] = operatorInfo.Index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
profileListBase = 2 + totalOperator * sizeof(Operator_Info_T);
|
||||
printf("profileListBase=%d\n", profileListBase);
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase] = totalProfile; //htons(totalProfile);
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase + 1] = 0xff;
|
||||
pProfileInfo = (Profile_Info_T *)&(pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase + 2]);
|
||||
|
||||
for(i = 0; i < totalProfile; i++)
|
||||
{
|
||||
if(sf_get_profile_item(i, &profileItem) == SUCCESS)
|
||||
{
|
||||
pProfileInfo[i].profileId = i;
|
||||
SF_STRNCPY(&pProfileInfo[i].profileName, profileItem.profileName, 16);
|
||||
|
||||
if(profileItem.profileState[0] == PROFILE_STATE_ENABLED)
|
||||
{
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase + 1] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sendBuff[sendBuffLen - 2] = 0xff;
|
||||
sendBuff[sendBuffLen - 1] = 0xee;
|
||||
|
||||
for(i = 0; i < totalOperator; i++)
|
||||
{
|
||||
if(sf_get_operator_item(i, &operatorInfo) == SUCCESS)
|
||||
{
|
||||
pOperatorInfo[i].operatorId = operatorInfo.Index;
|
||||
SF_STRNCPY(&(pOperatorInfo[i].operatorName), &(operatorInfo.OperatorNameLong), 16);
|
||||
pOperatorInfo[i].signalVal = operatorInfo.SignalVal;
|
||||
|
||||
if(SF_STRNCMP(operatorInfo.OperatorNameLong, OperatorNameL, sizeof(operatorInfo.OperatorNameLong)) == 0)
|
||||
{
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[1] = operatorInfo.Index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
profileListBase = 2 + totalOperator * sizeof(Operator_Info_T);
|
||||
printf("profileListBase=%d\n", profileListBase);
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase] = totalProfile; //htons(totalProfile);
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase + 1] = 0xff;
|
||||
pProfileInfo = (Profile_Info_T *)&(pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase + 2]);
|
||||
|
||||
for(i = 0; i < totalProfile; i++)
|
||||
{
|
||||
if(sf_get_profile_item(i, &profileItem) == SUCCESS)
|
||||
{
|
||||
pProfileInfo[i].profileId = i;
|
||||
SF_STRNCPY(&pProfileInfo[i].profileName, profileItem.profileName, 16);
|
||||
|
||||
if(profileItem.profileState[0] == PROFILE_STATE_ENABLED)
|
||||
{
|
||||
pMsgParse->msgBuf.rctrlNetworkScan.buff[profileListBase + 1] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sendBuff[sendBuffLen - 2] = 0xff;
|
||||
sendBuff[sendBuffLen - 1] = 0xee;
|
||||
|
||||
//memdump(sendBuff, sendBuffLen);
|
||||
//send(fd,(void *)sendBuff, sendBuffLen, 0);
|
||||
wifiCfg->Lenth = sendBuffLen;
|
||||
|
@ -2948,7 +2948,7 @@ void sf_operator_scan_thread(UINT32 *tmp)
|
|||
sf_share_mem_wifi_down(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -3065,16 +3065,16 @@ void sf_network_select_thread(UINT8 * tmp)
|
|||
UINT32 ret = SF_LPA_SUCCESS;
|
||||
UINT32 sts = 0;
|
||||
UINT32 retryTime=0;
|
||||
UINT8 errCode = CMD_SUCCESS;
|
||||
UINT8 errCode = CMD_SUCCESS;
|
||||
UINT8 profileId = *tmp;
|
||||
UINT8 curActiveProfileId = 0;
|
||||
UINT32 totalProfile = 0;
|
||||
LPA_API_ERROR lpaErrCode = LPA_NO_ERROR;
|
||||
|
||||
errCode = sf_check_network_status();
|
||||
|
||||
if(errCode == CMD_SUCCESS)
|
||||
{
|
||||
|
||||
errCode = sf_check_network_status();
|
||||
|
||||
if(errCode == CMD_SUCCESS)
|
||||
{
|
||||
|
||||
|
||||
sf_get_profile_active_index(&curActiveProfileId);
|
||||
|
@ -3108,11 +3108,11 @@ void sf_network_select_thread(UINT8 * tmp)
|
|||
//LOG_DM_RS("Swich Result:0x%02x\n", lpaErrCode);
|
||||
|
||||
if(lpaErrCode == LPA_NO_ERROR)
|
||||
{
|
||||
{
|
||||
sf_lpa_profile_info_refresh();
|
||||
errCode = CMD_SUCCESS;
|
||||
errCode = CMD_SUCCESS;
|
||||
sts = 1;
|
||||
}
|
||||
}
|
||||
else if (lpaErrCode == LPA_ERROR_LOCAL_PROFILE_CAT_BUSY)
|
||||
{
|
||||
retryTime++;
|
||||
|
@ -3147,24 +3147,24 @@ void sf_network_select_thread(UINT8 * tmp)
|
|||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if(lpaErrCode == SF_LPA_ERROR_PROFILE_NOT_FOUND)
|
||||
{
|
||||
printf("status:PROFILE_NOT_FOUND\n");
|
||||
errCode = NETWORK_PROFILE_NOT_FOUND;
|
||||
}
|
||||
{
|
||||
printf("status:PROFILE_NOT_FOUND\n");
|
||||
errCode = NETWORK_PROFILE_NOT_FOUND;
|
||||
}
|
||||
else if(lpaErrCode == SF_LPA_ERROR_PROFILE_IS_ENABLE)
|
||||
{
|
||||
printf("status:PROFILE_IS_ENABLE\n");
|
||||
errCode = NETWORK_NOT_NEED_SET;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("status:SELECT_FAILED\n");
|
||||
errCode = NETWORK_PROFILE_SELECT_FAILED;
|
||||
}
|
||||
{
|
||||
printf("status:PROFILE_IS_ENABLE\n");
|
||||
errCode = NETWORK_NOT_NEED_SET;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("status:SELECT_FAILED\n");
|
||||
errCode = NETWORK_PROFILE_SELECT_FAILED;
|
||||
}
|
||||
sts = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(lpaErrCode == LPA_ERROR_LOCAL_PROFILE_CAT_BUSY)
|
||||
|
@ -3267,9 +3267,9 @@ void sf_network_select_thread(UINT8 * tmp)
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sf_wifi_server_network_select_finish(errCode);
|
||||
sf_wifi_server_network_select_finish(errCode);
|
||||
|
||||
#if ((!SF_IQ_DEBUG)&&(!SF_4G_TEST))
|
||||
if(errCode == CMD_SUCCESS)
|
||||
|
@ -3281,14 +3281,14 @@ void sf_network_select_thread(UINT8 * tmp)
|
|||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if((errCode == CMD_SUCCESS) || (errCode == NETWORK_PROFILE_SELECT_FAILED))
|
||||
{
|
||||
sleep(3);
|
||||
sf_send_poweroff_msg();
|
||||
printf("[power off] %s(%d)\n",__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if((errCode == CMD_SUCCESS) || (errCode == NETWORK_PROFILE_SELECT_FAILED))
|
||||
{
|
||||
sleep(3);
|
||||
sf_send_poweroff_msg();
|
||||
printf("[power off] %s(%d)\n",__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -3307,15 +3307,15 @@ void sf_network_switch_thread()
|
|||
UINT32 ret = SF_LPA_SUCCESS;
|
||||
UINT32 sts = 0;
|
||||
UINT32 retryTime=0;
|
||||
UINT8 errCode = CMD_SUCCESS;
|
||||
UINT8 profileId = 0;
|
||||
UINT8 errCode = CMD_SUCCESS;
|
||||
UINT8 profileId = 0;
|
||||
UINT8 curActiveProfileId = 0;
|
||||
LPA_API_ERROR lpaErrCode = LPA_NO_ERROR;
|
||||
|
||||
errCode = sf_check_network_status();
|
||||
|
||||
errCode = sf_check_network_status();
|
||||
SLOGE("errCode:%x\n", errCode);
|
||||
|
||||
if(errCode == CMD_SUCCESS)
|
||||
if(errCode == CMD_SUCCESS)
|
||||
{
|
||||
if(sf_get_active_profile_next_index(&profileId) == FALSE)
|
||||
{
|
||||
|
@ -3338,11 +3338,11 @@ void sf_network_switch_thread()
|
|||
//LOG_DM_RS("Swich Result:0x%02x\n", lpaErrCode);
|
||||
|
||||
if(lpaErrCode == LPA_NO_ERROR)
|
||||
{
|
||||
{
|
||||
sf_lpa_profile_info_refresh();
|
||||
errCode = CMD_SUCCESS;
|
||||
errCode = CMD_SUCCESS;
|
||||
sts = 1;
|
||||
}
|
||||
}
|
||||
else if (lpaErrCode == LPA_ERROR_LOCAL_PROFILE_CAT_BUSY)
|
||||
{
|
||||
retryTime++;
|
||||
|
@ -3377,24 +3377,24 @@ void sf_network_switch_thread()
|
|||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if(lpaErrCode == SF_LPA_ERROR_PROFILE_NOT_FOUND)
|
||||
{
|
||||
printf("status:PROFILE_NOT_FOUND\n");
|
||||
errCode = NETWORK_PROFILE_NOT_FOUND;
|
||||
}
|
||||
{
|
||||
printf("status:PROFILE_NOT_FOUND\n");
|
||||
errCode = NETWORK_PROFILE_NOT_FOUND;
|
||||
}
|
||||
else if(lpaErrCode == SF_LPA_ERROR_PROFILE_IS_ENABLE)
|
||||
{
|
||||
printf("status:PROFILE_IS_ENABLE\n");
|
||||
errCode = NETWORK_NOT_NEED_SET;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("status:SELECT_FAILED\n");
|
||||
errCode = NETWORK_PROFILE_SELECT_FAILED;
|
||||
}
|
||||
{
|
||||
printf("status:PROFILE_IS_ENABLE\n");
|
||||
errCode = NETWORK_NOT_NEED_SET;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("status:SELECT_FAILED\n");
|
||||
errCode = NETWORK_PROFILE_SELECT_FAILED;
|
||||
}
|
||||
sts = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(lpaErrCode == LPA_ERROR_LOCAL_PROFILE_CAT_BUSY)
|
||||
|
|
|
@ -4684,9 +4684,11 @@ SINT32 sf_get_utc(VOID)
|
|||
rtcTime.Hour = hour;
|
||||
rtcTime.Min = minute;
|
||||
rtcTime.Sec = second;
|
||||
sf_sys_rtc_time_set(&rtcTime);
|
||||
sf_set_mcu_rtc_flag(1);
|
||||
printf("[%s:%d]set RTC: %04d/%02d/%02d %02d:%02d:%02d\n", __FUNCTION__, __LINE__, rtcTime.Year, rtcTime.Mon, rtcTime.Day, rtcTime.Hour, rtcTime.Min, rtcTime.Sec);
|
||||
if (SF_TRUE == sf_sys_rtc_time_check(&rtcTime)) {
|
||||
sf_sys_rtc_time_set(&rtcTime);
|
||||
sf_set_mcu_rtc_flag(1);
|
||||
printf("[%s:%d]set RTC: %04d/%02d/%02d %02d:%02d:%02d\n", __FUNCTION__, __LINE__, rtcTime.Year, rtcTime.Mon, rtcTime.Day, rtcTime.Hour, rtcTime.Min, rtcTime.Sec);
|
||||
}
|
||||
}
|
||||
|
||||
goto SF_UTC_END;
|
||||
|
@ -4848,7 +4850,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time)
|
|||
if(strstr((const char *)gsmPara, "+QNTP: 0") != NULL)
|
||||
{
|
||||
time = 0;
|
||||
int zoneSecond = 0;
|
||||
//int zoneSecond = 0;
|
||||
UINT8 *CCLK = (UINT8 *)strstr((const char *)gsmPara, "+QNTP: 0");
|
||||
|
||||
year = (CCLK[10] - '0') * 1000 + (CCLK[11] - '0') * 100 + (CCLK[12] - '0') * 10 + (CCLK[13] - '0');
|
||||
|
@ -4872,7 +4874,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time)
|
|||
}
|
||||
|
||||
//getUtcTimeFlag = 1;
|
||||
rtcTime.Year = year;
|
||||
/*rtcTime.Year = year;
|
||||
rtcTime.Mon = month;
|
||||
rtcTime.Day = day;
|
||||
rtcTime.Hour = hour;
|
||||
|
@ -4900,7 +4902,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time)
|
|||
sf_sys_rtc_time_set(&rtcTime);
|
||||
sf_set_mcu_rtc_flag(1);
|
||||
printf("[%s:%d]set RTC: %04d/%02d/%02d %02d:%02d:%02d\n", __FUNCTION__, __LINE__, rtcTime.Year, rtcTime.Mon, rtcTime.Day, rtcTime.Hour, rtcTime.Min, rtcTime.Sec);
|
||||
}
|
||||
}*/
|
||||
|
||||
goto SF_GEN_NTP_QIDEACT;
|
||||
}
|
||||
|
|
|
@ -1295,6 +1295,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
|
|||
}
|
||||
else
|
||||
{
|
||||
FtpOpenOk = SUCCESS;
|
||||
return ret2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
#include "sf_system.h"
|
||||
#include "at_manager.h"
|
||||
#include "Log.h"
|
||||
|
||||
#include "sf_4g_lpa.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
@ -170,11 +170,11 @@ static SINT16 app_Qlog_procress(void) {
|
|||
}
|
||||
#endif
|
||||
|
||||
void sf_usb_net_init()
|
||||
void sf_usb_net_init(void)
|
||||
{
|
||||
static U16 flag = 0;
|
||||
SF_CHAR cmdStr[128] ={0};
|
||||
int ret = 0;
|
||||
//int ret = 0;
|
||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
|
||||
if(flag == 0)
|
||||
|
@ -197,7 +197,7 @@ void sf_usb_net_init()
|
|||
{
|
||||
sprintf(cmdStr, "/usr/bin/quectel-CM-EG91 -n %d&", E_PDP_INDEX);
|
||||
}
|
||||
ret = system(cmdStr);
|
||||
system(cmdStr);
|
||||
sleep(3);
|
||||
}
|
||||
|
||||
|
@ -232,31 +232,31 @@ SINT32 sf_USB_net_init(void)
|
|||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0)
|
||||
{
|
||||
{
|
||||
ret = sf_check_usb0();
|
||||
|
||||
if(ret != SUCCESS)
|
||||
{
|
||||
{
|
||||
ret = sf_check_eth0();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
|
||||
ret = sf_check_eth0();
|
||||
if(ret != SUCCESS)
|
||||
{
|
||||
{
|
||||
ret = sf_check_usb0();
|
||||
}
|
||||
}
|
||||
if (SUCCESS == ret)
|
||||
{
|
||||
{
|
||||
ret = SF_SUCCESS;
|
||||
MLOGI("usb net ip up\r\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
@ -1145,6 +1145,11 @@ static SINT32 app_file_transfer(SF_FN_PARAM_S *pfnParam) {
|
|||
if(sf_get_send_video()){
|
||||
s32ret = sf_video_ftp_send();
|
||||
}
|
||||
|
||||
if(sf_get_send_log()){
|
||||
s32ret = sf_log_send_ftp();
|
||||
}
|
||||
|
||||
break;
|
||||
case SF_MCU_STARTUP_SYN_PARAM:
|
||||
if (pCustomerParam->GpsSendFlag) {
|
||||
|
@ -1177,6 +1182,11 @@ static SINT32 app_file_transfer(SF_FN_PARAM_S *pfnParam) {
|
|||
if(sf_get_send_video()){
|
||||
s32ret = sf_video_ftp_send();
|
||||
}
|
||||
|
||||
if(sf_get_send_log()){
|
||||
s32ret = sf_log_send_ftp();
|
||||
}
|
||||
|
||||
SLOGD("GpsSendFlag:%d\n", pCustomerParam->GpsSendFlag);
|
||||
break;
|
||||
default:
|
||||
|
@ -1221,7 +1231,10 @@ SINT32 sf_cardv_file_to_app_send_thread(void) {
|
|||
ThumbSend.IsRun = 0;
|
||||
sf_file_thumb_cfg_clear();
|
||||
sf_share_mem_file_down(1, s32ret);
|
||||
|
||||
|
||||
if (sf_poweron_type_get() == SF_MCU_STARTUP_ONKEY) {
|
||||
app_led_net_reg_stop(s32ret);
|
||||
}
|
||||
if ((sf_poweron_type_get() != SF_MCU_STARTUP_ONKEY) && (!sf_sms_check_send())) {
|
||||
sf_power_off();
|
||||
}
|
||||
|
@ -1272,9 +1285,9 @@ static SINT32 app_Register_Net_Error_return_setup(SF_FN_PARAM_S *pfnParam,
|
|||
SLOGD("s32ret:%x\n", s32ret);
|
||||
// SLOGD("bind flag:%x\n", pStaticParam->bindFlag);
|
||||
if (sf_poweron_type_get() == SF_MCU_STARTUP_ONKEY) {
|
||||
if (SF_TRUE == sf_sys_rtc_time_check(&rtcTime)) {
|
||||
sf_sys_rtc_time_set(&rtcTime);
|
||||
}
|
||||
//if (SF_TRUE == sf_sys_rtc_time_check(&rtcTime)) {
|
||||
// sf_sys_rtc_time_set(&rtcTime);
|
||||
//}
|
||||
|
||||
app_led_net_reg_stop(s32ret);
|
||||
}
|
||||
|
@ -1301,10 +1314,10 @@ static SINT32 app_Register_Net_Error_return_server(SF_FN_PARAM_S *pfnParam,
|
|||
SLOGE("s32ret:%#x\n", s32ret);
|
||||
// SLOGD("bind flag:%x\n", pStaticParam->bindFlag);
|
||||
if (sf_poweron_type_get() == SF_MCU_STARTUP_ONKEY) {
|
||||
if (SF_TRUE == sf_sys_rtc_time_check(&rtcTime)) {
|
||||
sf_sys_rtc_time_set(&rtcTime);
|
||||
sf_sys_rtoscmd_set(4, NULL); // SET RTC time to rtos
|
||||
}
|
||||
//if (SF_TRUE == sf_sys_rtc_time_check(&rtcTime)) {
|
||||
// sf_sys_rtc_time_set(&rtcTime);
|
||||
// sf_sys_rtoscmd_set(4, NULL); // SET RTC time to rtos
|
||||
// }
|
||||
|
||||
app_led_net_reg_stop(s32ret);
|
||||
}
|
||||
|
@ -1384,7 +1397,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
if(sf_is_esim_card())
|
||||
{
|
||||
sf_get_eid(eid);
|
||||
sf_get_eid((UINT8*)eid);
|
||||
printf("pPara->EsimEid=%s\n", pCustomerParam->EsimEid);
|
||||
printf("pPara->eid=%s\n", eid);
|
||||
if((pCustomerParam->EsimEid[0] != '\0') && (SF_STRCMP(pCustomerParam->EsimEid, eid) != 0))
|
||||
|
@ -1427,10 +1440,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
#endif
|
||||
|
||||
s32ret = sf_get_utc();
|
||||
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
|
||||
SF_PARA_TIME_S current_time = { 0, 0, 0, 0, 0, 0};
|
||||
s32ret = sf_get_ntp(s32ret, ¤t_time);
|
||||
}
|
||||
|
||||
sf_4G_usb_net_apn_cfg(pfnParam);
|
||||
set_at_parament();
|
||||
sf_USB_net_init();
|
||||
|
@ -1485,13 +1495,22 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
s32ret = sf_read_message();
|
||||
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
|
||||
if (sf_get_pic()) {
|
||||
if (sf_get_pic())
|
||||
{
|
||||
s32ret = sf_app_to_cardv_capture();
|
||||
} else if (sf_get_send_hd()) {
|
||||
}
|
||||
else if (sf_get_send_hd())
|
||||
{
|
||||
s32ret = sf_app_to_cardv_hd_ture();
|
||||
} else if (sf_get_send_video()) {
|
||||
}
|
||||
else if (sf_get_send_video())
|
||||
{
|
||||
s32ret = sf_video_ftp_send();
|
||||
}
|
||||
else if(sf_get_send_log())
|
||||
{
|
||||
s32ret = sf_log_send_ftp();
|
||||
}
|
||||
break;
|
||||
|
||||
case SF_MCU_STARTUP_TIMELAPSE:
|
||||
|
@ -1583,11 +1602,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
sf_USB_net_init();
|
||||
|
||||
s32ret = sf_get_utc();
|
||||
if ((s32ret == SF_SIM_ERROR_UTC) &&
|
||||
(SF_ON != pCustomerParam->GpsSwitch)) {
|
||||
SF_PARA_TIME_S current_time = {0, 0, 0, 0, 0, 0};
|
||||
s32ret = sf_get_ntp(s32ret, ¤t_time);
|
||||
}
|
||||
|
||||
if ((SF_ON == pCustomerParam->GpsSwitch)) {
|
||||
s32ret = open_gps(s32ret);
|
||||
}
|
||||
|
@ -1635,7 +1650,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
|
||||
if(sf_is_esim_card())
|
||||
{
|
||||
sf_get_eid(eid);
|
||||
sf_get_eid((UINT8*)eid);
|
||||
printf("pPara->EsimEid=%s\n", pCustomerParam->EsimEid);
|
||||
printf("pPara->eid=%s\n", eid);
|
||||
if((pCustomerParam->EsimEid[0] != '\0') && (SF_STRCMP(pCustomerParam->EsimEid, eid) != 0))
|
||||
|
@ -1721,10 +1736,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
sf_USB_net_init();
|
||||
|
||||
s32ret = sf_get_utc();
|
||||
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
|
||||
SF_PARA_TIME_S current_time = { 0, 0, 0, 0, 0, 0};
|
||||
s32ret = sf_get_ntp(s32ret, ¤t_time);
|
||||
}
|
||||
|
||||
if ((SF_ON == pCustomerParam->GpsSwitch)) {
|
||||
s32ret = open_gps(s32ret);
|
||||
}
|
||||
|
@ -1779,13 +1791,22 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
|||
s32ret = sf_file_send_auto();
|
||||
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
|
||||
|
||||
if (sf_get_pic()) {
|
||||
if (sf_get_pic())
|
||||
{
|
||||
s32ret = sf_app_to_cardv_capture();
|
||||
} else if (sf_get_send_hd()) {
|
||||
}
|
||||
else if (sf_get_send_hd())
|
||||
{
|
||||
s32ret = sf_app_to_cardv_hd_ture();
|
||||
} else if (sf_get_send_video()) {
|
||||
}
|
||||
else if (sf_get_send_video())
|
||||
{
|
||||
s32ret = sf_video_ftp_send();
|
||||
}
|
||||
else if(sf_get_send_log())
|
||||
{
|
||||
s32ret = sf_log_send_ftp();
|
||||
}
|
||||
// sf_share_mem_customer_down(1);
|
||||
break;
|
||||
|
||||
|
@ -2024,10 +2045,10 @@ void set_at_parament(void)
|
|||
|
||||
SINT32 open_gps(const SINT32 utc)
|
||||
{
|
||||
UIMenuStoreInfo *pCustomerParam = sf_app_ui_para_get();
|
||||
SINT32 s32ret = 0;
|
||||
//UIMenuStoreInfo *pCustomerParam = sf_app_ui_para_get();
|
||||
//SINT32 s32ret = 0;
|
||||
SF_PARA_TIME_S current_time = { 0, 0, 0, 0, 0, 0};
|
||||
s32ret = sf_get_ntp(utc, ¤t_time);
|
||||
sf_get_ntp(utc, ¤t_time);
|
||||
#define NTP_TIME_LENGTH 32
|
||||
char ntp_time[NTP_TIME_LENGTH] = {0};
|
||||
snprintf(ntp_time, NTP_TIME_LENGTH, "%04d/%02d/%02d,%02d:%02d:%02d",
|
||||
|
|
|
@ -894,7 +894,6 @@ UINT8 *sf_versionGet(UINT8 ver[],UINT8 fea[])
|
|||
*************************************************/
|
||||
void sf_power_off(void)
|
||||
{
|
||||
SF_MESSAGE_BUF_S stMessageBuf = {0};
|
||||
UINT8 PowerOnMode = sf_poweron_type_get();
|
||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||
if(SF_FAILURE == sf_check_sd())
|
||||
|
@ -935,11 +934,7 @@ void sf_power_off(void)
|
|||
sf_power_off_check_ui_para_sava();
|
||||
sf_statistics_param_save(psfPara);
|
||||
|
||||
MLOGI(" SF_KEY_PIN_AOTU_MODE_POWOFF CMD_KEY\n");
|
||||
stMessageBuf.cmdId = CMD_KEY;
|
||||
stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK;
|
||||
stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff
|
||||
sf_com_message_send_to_cardv(&stMessageBuf);
|
||||
sf_power_off_msg_to_cardv();
|
||||
printf("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
pthread_cond_t condition;
|
||||
|
@ -1027,19 +1022,19 @@ SINT32 sf_app_para_check_start(void)
|
|||
SINT32 sf_app_para_check_stop(void)
|
||||
{
|
||||
UINT16 ret = 0;
|
||||
MLOGD("s\n");
|
||||
//MLOGD("s\n");
|
||||
|
||||
if(0 == ParaTskCfg.IsRun){
|
||||
return SF_SUCCESS;
|
||||
}
|
||||
ParaTskCfg.IsRun = 0;
|
||||
MLOGD("s1\n");
|
||||
//MLOGD("s1\n");
|
||||
|
||||
if(TRUE == sf_get_para_check_flag()){
|
||||
MLOGI("menu info is changed\n");
|
||||
sf_share_mem_customer_down(1);
|
||||
}
|
||||
MLOGD("s2\n");
|
||||
//MLOGD("s2\n");
|
||||
|
||||
ret = pthread_join(ParaTskCfg.TskId, NULL);
|
||||
if(ret != SF_SUCCESS)
|
||||
|
@ -1047,7 +1042,7 @@ SINT32 sf_app_para_check_stop(void)
|
|||
MLOGD("thread stop fail!\n");
|
||||
return ret;
|
||||
}
|
||||
MLOGD("e\n");
|
||||
//MLOGD("e\n");
|
||||
return SF_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1481,4 +1476,22 @@ SINT32 sf_app_mcu_para_stop(void)
|
|||
return ret;
|
||||
}
|
||||
return SF_SUCCESS;
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
Function: sf_power_off_msg_to_cardv
|
||||
Description: power off
|
||||
Input: N/A
|
||||
Output: N/A
|
||||
Return: N/A
|
||||
Others: N/A
|
||||
*************************************************/
|
||||
void sf_power_off_msg_to_cardv(void)
|
||||
{
|
||||
SF_MESSAGE_BUF_S stMessageBuf = {0};
|
||||
SLOGI(" SF_KEY_PIN_AOTU_MODE_POWOFF CMD_KEY\n");
|
||||
stMessageBuf.cmdId = CMD_KEY;
|
||||
stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK;
|
||||
stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff
|
||||
sf_com_message_send_to_cardv(&stMessageBuf);
|
||||
}
|
|
@ -1549,10 +1549,6 @@ BOOL sf_check_auto_thumb_file(VOID)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(0 == puiPara->SendType){
|
||||
sf_file_remove(tmp);
|
||||
}
|
||||
|
||||
printf("%s:%d e \n", __FUNCTION__, __LINE__);
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include <sf_device.h>
|
||||
#include <sf_dev_usb.h>
|
||||
#include "sf_common.h"
|
||||
#include "sf_param_common.h"
|
||||
#include "sf_sms.h"
|
||||
#include "sf_system.h"
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
|
@ -128,12 +130,15 @@ unsigned char sf_mcu_power_on_para_get (MCUParam_t attrId)
|
|||
{
|
||||
unsigned char dataTemp1 = 0, dataTemp2 = 0;
|
||||
unsigned char startMode = 0;
|
||||
unsigned char startModetmp = sf_poweron_type_get();
|
||||
int startflag = 1;
|
||||
//unsigned char mcuVer = 0;
|
||||
unsigned char mcuReg[REG_SIZE] = { 0 };
|
||||
unsigned char mcuData[REG_SIZE] = { 0 };
|
||||
unsigned char i = 0;
|
||||
SF_TIME_S time;
|
||||
|
||||
SF_CHK_STARTMODE:
|
||||
if(attrId == SF_MCU_STARTMODE)
|
||||
{
|
||||
sf_mcu_read(START_MODE, &dataTemp1);
|
||||
|
@ -163,15 +168,29 @@ unsigned char sf_mcu_power_on_para_get (MCUParam_t attrId)
|
|||
IRSHTTER = (dataTemp2 << 8) | dataTemp1;
|
||||
}
|
||||
|
||||
if((startMode != startModetmp) && (startflag))
|
||||
{
|
||||
startflag = 0;
|
||||
sf_sleep_ms(200);
|
||||
goto SF_CHK_STARTMODE;
|
||||
}
|
||||
printf(" start mode = %d IRSHTTER = %d McuVersion:%d.%d.%d\n", startMode, IRSHTTER, (McuVersion>>8)&0xFF, McuVersion & 0xFF, McuSubVersion);
|
||||
sf_mcu_rtc_get(&time);
|
||||
if(SF_TRUE == sf_sys_rtc_time_check((SF_PARA_TIME_S*)&time)){
|
||||
sf_sys_rtc_time_set((SF_PARA_TIME_S*)&time);
|
||||
}else{
|
||||
sf_sys_rtc_time_reset();
|
||||
if(startMode == startModetmp)
|
||||
{
|
||||
if(SF_TRUE == sf_sys_rtc_time_check((SF_PARA_TIME_S*)&time)){
|
||||
sf_sys_rtc_time_set((SF_PARA_TIME_S*)&time);
|
||||
}else{
|
||||
sf_sys_rtc_time_reset();
|
||||
}
|
||||
}
|
||||
sf_poweron_type_set(startMode);
|
||||
if(SF_MCU_STARTUP_ONKEY == startMode)
|
||||
else
|
||||
{
|
||||
sf_power_off_msg_to_cardv();
|
||||
}
|
||||
//sf_poweron_type_set(startMode);
|
||||
|
||||
if(SF_MCU_STARTUP_ONKEY == startModetmp)
|
||||
ConfigureModeFlag = 1;
|
||||
//McuPowerOnMode = startMode;
|
||||
return startMode;
|
||||
|
|
|
@ -125,5 +125,7 @@ int sf_cardv_para_signaling_start(void);
|
|||
BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv);
|
||||
BOOL sf_cmd_switch_esim(unsigned char argc, char **argv);
|
||||
|
||||
UINT32 sf_cardv_wifi_send(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -296,7 +296,7 @@ void sf_mode_detect(void)
|
|||
{
|
||||
AutoOfftime=0;
|
||||
}
|
||||
//AutoOfftime=0;
|
||||
|
||||
//if(((System_GetState(SYS_STATE_CURRMODE) == PRIMARY_MODE_PHOTO)&& (gPhotoData.State == PHOTO_ST_VIEW))
|
||||
// || ((System_GetState(SYS_STATE_CURRMODE) == PRIMARY_MODE_MOVIE) && (FlowMovie_GetMovDataState() == MOV_ST_VIEW)))
|
||||
if(sf_is_preview())
|
||||
|
@ -1257,15 +1257,19 @@ BOOL sf_cmd_ftp(unsigned char argc, char **argv)
|
|||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||
//printf("[%s:%d] value:%d\n", __FUNCTION__, __LINE__,value);
|
||||
if(4 == argc)
|
||||
{
|
||||
{
|
||||
memset(puiPara ->FtpIp,'\0', sizeof(puiPara ->FtpIp));
|
||||
memset(puiPara ->FtpPort, '\0', sizeof(puiPara ->FtpPort));
|
||||
memset(puiPara ->FtpUsr, '\0', sizeof(puiPara ->FtpUsr));
|
||||
memset(puiPara ->FtpPwd,'\0', sizeof(puiPara ->FtpPwd));
|
||||
strncpy((char *)puiPara->FtpIp, argv[0], ((sizeof(puiPara->FtpIp) <= strlen(argv[0])) ? (sizeof(puiPara->FtpIp)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpPort, argv[0], ((sizeof(puiPara->FtpPort) <= strlen(argv[0])) ? (sizeof(puiPara->FtpPort)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpUsr, argv[0], ((sizeof(puiPara->FtpUsr) <= strlen(argv[0])) ? (sizeof(puiPara->FtpUsr)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpPwd, argv[0], ((sizeof(puiPara->FtpPwd) <= strlen(argv[0])) ? (sizeof(puiPara->FtpPwd)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpPort, argv[1], ((sizeof(puiPara->FtpPort) <= strlen(argv[1])) ? (sizeof(puiPara->FtpPort)) : (strlen(argv[1]))));
|
||||
strncpy((char *)puiPara->FtpUsr, argv[2], ((sizeof(puiPara->FtpUsr) <= strlen(argv[2])) ? (sizeof(puiPara->FtpUsr)) : (strlen(argv[2]))));
|
||||
strncpy((char *)puiPara->FtpPwd, argv[3], ((sizeof(puiPara->FtpPwd) <= strlen(argv[3])) ? (sizeof(puiPara->FtpPwd)) : (strlen(argv[3]))));
|
||||
|
||||
Save_MenuInfo();
|
||||
}
|
||||
printf("[%s:%d] FtpIp:%s\n", __FUNCTION__, __LINE__,puiPara->FtpIp);
|
||||
printf("[%s:%d] FtpIp:%s FtpPort:%s FtpUsr:%s FtpPwd:%s\n", __FUNCTION__, __LINE__,puiPara->FtpIp,puiPara ->FtpPort,puiPara ->FtpUsr,puiPara ->FtpPwd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1275,15 +1279,19 @@ BOOL sf_cmd_ftps(unsigned char argc, char **argv)
|
|||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||
//printf("[%s:%d] value:%d\n", __FUNCTION__, __LINE__,value);
|
||||
if(4 == argc)
|
||||
{
|
||||
{
|
||||
memset(puiPara ->FtpsIp,'\0', sizeof(puiPara ->FtpsIp));
|
||||
memset(puiPara ->FtpsPort, '\0', sizeof(puiPara ->FtpsPort));
|
||||
memset(puiPara ->FtpsUsr, '\0', sizeof(puiPara ->FtpsUsr));
|
||||
memset(puiPara ->FtpsPwd,'\0', sizeof(puiPara ->FtpsPwd));
|
||||
strncpy((char *)puiPara->FtpsIp, argv[0], ((sizeof(puiPara->FtpsIp) <= strlen(argv[0])) ? (sizeof(puiPara->FtpsIp)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpsPort, argv[0], ((sizeof(puiPara->FtpsPort) <= strlen(argv[0])) ? (sizeof(puiPara->FtpsPort)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpsUsr, argv[0], ((sizeof(puiPara->FtpsUsr) <= strlen(argv[0])) ? (sizeof(puiPara->FtpsUsr)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpsPwd, argv[0], ((sizeof(puiPara->FtpsPwd) <= strlen(argv[0])) ? (sizeof(puiPara->FtpsPwd)) : (strlen(argv[0]))));
|
||||
strncpy((char *)puiPara->FtpsPort, argv[1], ((sizeof(puiPara->FtpsPort) <= strlen(argv[1])) ? (sizeof(puiPara->FtpsPort)) : (strlen(argv[1]))));
|
||||
strncpy((char *)puiPara->FtpsUsr, argv[2], ((sizeof(puiPara->FtpsUsr) <= strlen(argv[2])) ? (sizeof(puiPara->FtpsUsr)) : (strlen(argv[2]))));
|
||||
strncpy((char *)puiPara->FtpsPwd, argv[3], ((sizeof(puiPara->FtpsPwd) <= strlen(argv[3])) ? (sizeof(puiPara->FtpsPwd)) : (strlen(argv[3]))));
|
||||
|
||||
Save_MenuInfo();
|
||||
}
|
||||
printf("[%s:%d] FtpIp:%s\n", __FUNCTION__, __LINE__,puiPara->FtpIp);
|
||||
printf("[%s:%d] FtpsIp:%s FtpsPort:%s FtpsUsr:%s FtpsPwd:%s\n", __FUNCTION__, __LINE__,puiPara->FtpsIp,puiPara ->FtpsPort,puiPara ->FtpsUsr,puiPara ->FtpsPwd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -2090,6 +2098,7 @@ void* sf_sys_do_upgrade(void *arg)
|
|||
sf_set_send_statu(TRUE);
|
||||
sf_sys_status_led_set(SF_LED_SYS_STATE_UPDATE);
|
||||
vos_util_delay_ms(500);
|
||||
|
||||
//BKG_PostEvent(NVTEVT_BKW_FW_UPDATE);
|
||||
if(0 != sf_fwupdate()){
|
||||
sf_sys_status_led_set(SF_LED_SYS_STATE_ERROR);
|
||||
|
@ -2102,7 +2111,8 @@ void* sf_sys_do_upgrade(void *arg)
|
|||
}
|
||||
sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 0);
|
||||
sf_set_send_statu(FALSE);
|
||||
if(PWR_ON_SETUP == sf_cardv_convert_power_on_mode()){
|
||||
//if(PWR_ON_SETUP == sf_cardv_convert_power_on_mode())
|
||||
{
|
||||
vos_util_delay_ms(1000);
|
||||
Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0);
|
||||
}
|
||||
|
@ -2671,4 +2681,47 @@ UINT32 sf_cardv_hd_cap_start(void)
|
|||
HdCapTskCfg.IsRun = 1;
|
||||
return SF_SUCCESS;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
}
|
||||
|
||||
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;
|
||||
>>>>>>> origin/Branch_S530
|
||||
}
|
|
@ -1408,7 +1408,7 @@ UINT8 sf_mcu_reg_set(MCUParam_t attrId, UINT8 val)
|
|||
{
|
||||
#if HUNTING_CAMERA_4G == ENABLE
|
||||
SF_MESSAGE_BUF_S stMessageBuf = {0};
|
||||
stMessageBuf.arg2 = val;
|
||||
stMessageBuf.arg3 = val;
|
||||
stMessageBuf.arg2 = attrId;
|
||||
stMessageBuf.arg1 = SF_MCU_CMD_SET_MCU;
|
||||
stMessageBuf.cmdId = CMD_MCU;
|
||||
|
|
|
@ -947,7 +947,7 @@
|
|||
#define HUNTING_MCU_UART ENABLE
|
||||
#define HUNTING_IR_LED_940 ENABLE
|
||||
#define SF_EXIF_MN_BUF_SIZE 256
|
||||
#define SF_BASE_VERSION "7MD4RCwD9T1"
|
||||
#define SF_BASE_VERSION "7MD4RCwD901"
|
||||
#define HW_S530 1
|
||||
#define DCF_DIR_NAME "MEDIA" /* 100MEDIA */
|
||||
#define DCF_FILE_NAME "SYFW" /* SYFW0001.JPG */
|
||||
|
@ -971,10 +971,10 @@
|
|||
|
||||
#define SF_4G_USB_NET_DOWNLOAD 1
|
||||
|
||||
#define SF_TEST_GPRS 1
|
||||
#define SF_TEST_GPRS 0
|
||||
#define CUSTOM_TEST_FTPS 0
|
||||
|
||||
#define SF_TEST_OTA_FTP 1
|
||||
#define SF_TEST_OTA_FTP 0
|
||||
#define CUSTOM_TEST_OTA_FTP 0
|
||||
|
||||
#define FASTBOOT_WAIT_FILESYS_TIMEOUT_MS 5000
|
||||
|
|
|
@ -1222,14 +1222,14 @@ void SysResetFlag(void)
|
|||
//SF_STRCPY(puiPara ->APNGPRS, "3gnet");
|
||||
#else
|
||||
sf_base64_decode(USER_FTP_IP, (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpIp, sizeof(puiPara->FtpIp), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpPort, sizeof(puiPara->FtpPort), USER_FTP_PORT);
|
||||
snprintf((char *)puiPara->FtpsIp, sizeof(puiPara->FtpsIp), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpsPort, sizeof(puiPara->FtpsPort), USER_FTP_PORT);
|
||||
memset(tmpStr, '\0', sizeof(tmpStr));
|
||||
sf_base64_decode(USER_FTP_USERNAME, (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpUsr, sizeof(puiPara->FtpUsr), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpsUsr, sizeof(puiPara->FtpsUsr), (char *)tmpStr);
|
||||
memset(tmpStr, '\0', sizeof(tmpStr));
|
||||
sf_base64_decode(USER_FTP_PASSWORD, (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpPwd, sizeof(puiPara->FtpPwd), (char *)tmpStr);
|
||||
snprintf((char *)puiPara->FtpsPwd, sizeof(puiPara->FtpsPwd), (char *)tmpStr);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -522,12 +522,12 @@ typedef struct _UIMenuUIMenuStoreInfo {
|
|||
UINT8 FtpIp[40];
|
||||
UINT8 FtpPort[5];
|
||||
UINT8 FtpUsr[40];
|
||||
UINT8 FtpPwd[20];
|
||||
UINT8 FtpPwd[40];
|
||||
|
||||
UINT8 FtpsIp[40];
|
||||
UINT8 FtpsPort[5];
|
||||
UINT8 FtpsUsr[40];
|
||||
UINT8 FtpsPwd[20];
|
||||
UINT8 FtpsPwd[40];
|
||||
|
||||
UINT8 OtaFtpIp[40];
|
||||
UINT8 OtaFtpPort[5];
|
||||
|
|
|
@ -2168,7 +2168,7 @@ void sf_file_thumb_cfg_sava(void)
|
|||
FST_FILE fs = 0;
|
||||
//char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0};
|
||||
//int fd = 0;
|
||||
static int flag = 0;
|
||||
//static int flag = 0;
|
||||
//struct stat st;
|
||||
#if SF_IQ_TEST != ENABLE
|
||||
INT32 uiStatus = 0;
|
||||
|
@ -2184,17 +2184,11 @@ void sf_file_thumb_cfg_sava(void)
|
|||
//printf("Add %s to send.List\n", sendfname);
|
||||
if(0 == puiPara->SendType){
|
||||
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
|
||||
if((access(sendListName, F_OK) == 0) && (0 == flag))
|
||||
{
|
||||
printf("%s:%d DeleteFile:%s\r\n", __FUNCTION__, __LINE__, sendListName);
|
||||
if (FileSys_DeleteFile(sendListName) != FST_STA_OK) {
|
||||
DBG_IND("Ignore deleting file.\r\n");
|
||||
}
|
||||
}
|
||||
flag = 1;
|
||||
fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
||||
|
||||
}else {
|
||||
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);
|
||||
fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||
}
|
||||
|
||||
/*if(access(sendListName, F_OK) == 0)
|
||||
|
@ -2205,7 +2199,6 @@ void sf_file_thumb_cfg_sava(void)
|
|||
else {
|
||||
fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
|
||||
}*/
|
||||
fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||
if(/*fd*/fs)
|
||||
{
|
||||
FileSys_StatFile(fs, &FileStat);
|
||||
|
|
Loading…
Reference in New Issue
Block a user