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 5dcfd8478..e451eadc4 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -1387,7 +1387,7 @@ BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv) { //UINT32 value; UIMenuStoreInfo *puiPara = sf_ui_para_get(); - if(4 == argc) + if(4 <= argc) { memset(puiPara ->OtaFtpIp,'\0', sizeof(puiPara ->OtaFtpIp)); memset(puiPara ->OtaFtpPort, '\0', sizeof(puiPara ->OtaFtpPort)); @@ -1400,12 +1400,16 @@ BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv) Save_MenuInfo(); } - sleep(1); - SF_MESSAGE_BUF_S stMessageBuf = {0}; - stMessageBuf.arg1 = SF_DEV_CMD_OTA; - stMessageBuf.cmdId = CMD_DEV; - sf_com_message_send_to_app(&stMessageBuf); - + + if(5 == argc) + { + sleep(1); + SF_MESSAGE_BUF_S stMessageBuf = {0}; + stMessageBuf.arg1 = SF_DEV_CMD_OTA; + stMessageBuf.cmdId = CMD_DEV; + sf_com_message_send_to_app(&stMessageBuf); + } + printf("[%s:%d] OtaFtpIp:%s\n", __FUNCTION__, __LINE__, puiPara->OtaFtpIp); printf("[%s:%d] OtaFtpPort:%s\n", __FUNCTION__, __LINE__, puiPara->OtaFtpPort); printf("[%s:%d] OtaFtpUserName:%s\n", __FUNCTION__, __LINE__, puiPara->OtaFtpUserName);