Hi,
I have problem with FTP protocol. I have follow steps:
- Connect to the service provider by calling ed_DialupConnectionStart () API.
- Set FTP parameters (i.e. FTP server name, FTP port, type etc) by calling ed_FTPSetConfig () API.
I can’t set FTP parameters, ed_FTPSetConfig() returned error.
My code is posted bellow:
void dialupHandler(s32 responseCode, TeDHandle id){
adl_atSendResponse(ADL_AT_RSP, "\r\n ---> Inside dialupHandler\r\n");
switch(responseCode){
case ED_OK_GPRS_SESSION_SET: //GPRS session is set.
adl_atSendResponse(ADL_AT_RSP, "\r\nED_OK_GPRS_SESSION_SET");
adl_tmrSubscribe(FALSE, 10, ADL_TMR_TYPE_100MS, ftpSetup);
break;
case ED_INFO_CONNECT:
adl_atSendResponse(ADL_AT_RSP, "\r\nInside ED_INFO_CONNECT");
break;
case ED_OK_PPP:
adl_atSendResponse(ADL_AT_RSP, "\r\nED_OK_PPP");
break;
case ED_OK_ON_HOOK:
adl_atSendResponse(ADL_AT_RSP, "\r\nDial up connection closed");
adl_atCmdCreate("AT+CGATT=0", FALSE, AttRspHandler, "*", NULL);
break;
case ED_ERR_GPRS_ABORTED:
adl_atSendResponse(ADL_AT_RSP, "\r\nInternal GPRS error.Please check your APN parameters");
break;
default:
adl_atSendResponse(ADL_AT_RSP, "\r\nERROR received in dial up connection start");
break;
}
}
void ftpSetup(void){
adl_atSendResponse(ADL_AT_RSP, "\r\n ---> ftpSetup()\r\n");
FTPParams.FtpPort = 21;
wm_strcpy(FTPParams.FtpType, "I");
wm_strcpy(FTPParams.FtpServ, ".........");
wm_strcpy(FTPParams.FtpUn, ".........");
wm_strcpy(FTPParams.FtpPw, ".........");
returnCode = ed_FTPSetConfig(&FTPParams);
wm_sprintf(buffer, "\r\n ed_FTPSetConfig: %d", returnCode);
adl_atSendResponse(ADL_AT_RSP, buffer);
}
Can anybody help me to connect on FTP server?
Thank in advanced,
belikg