I have been attempting to use the message service to launch an FTP task within a FXT009 modem. The bearer is successfully opened during initialization of the main task which has the highest priority. The following lists the task declaration table.
const adl_InitTasks_t adl_InitTasks [] = {
{ main_task, 3072, "main", 5 },
{ uart_task, 3072, "uart", 4 },
{ timer_task, 3072, "timer", 3 },
{ FTP_task, 3072, "FTP", 2 },
{ FLASH_task, 3072, "FLASH", 1 },
{ 0, 0, 0, 0 } }
The FTP_task initializes the message service as follows:
S32 FTP_task (void)
{ s32 s32Return;
static adl_msgFilter_t msgFilter = { 0, 0, ADL_MSG_ID_COMP_EQUAL, ADL_CTX_ALL };
s32Return = adl_msgSubscribe (&msgFilter, FTP_handler);
}
Then a message is sent by another task to send a file via FTP by issuing the following:
void FTP_handler (u32 MsgIdentifier, adl_ctxID_e ctxSource, u32 Length, void * incomingData)
{
dst_ftp_cx = wip_FTPCreateOpts (FTP_Server,
FTP_Session_Handler, NULL,
WIP_COPT_USER, FTP_User,
WIP_COPT_PASSWORD,FTP_Password
WIP_COPT_PASSIVE, DST_ISPASSIVE,
WIP_COPT_PEER_PORT, (u16)atoi(FTP_Port),
WIP_COPT_END );
}
There are no messaging errors detected and the wip_FTPCreateOpts is executed. Then depending on the server address, the wip_FTPCreateOpts either returns a channel or a null (error). In the case when channel address is returned, there is no further FTP activity, i.e. no WIP_CIV events occur and the FTP seems dead.
When I rewrite the code to not use messaging and call the FTP_handler function directly, everything works fine. Any suggestion as to how to launch an FTP as a task rather than a function call would be most appreciated.