Hi all,
I’m working on a project that combines a HTTP and FTP servers. The FTP server was implemented in later stage in the project because of the need to transfer large amount of data approximately 1 GB of data file. The applications both the ftp and the http are using raw PAW on top of lwIP.
Since the http server was provided by the vendor Atmel, there are no many problems with it.
My problem occurs when I want to implement both two applications to run at the same time, at the current state the ftp works if the http is enabled and other way around.
Brief Periodically retrigger timeout process.
After managing the lwIP timers. trigger corresponding ethernet process.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
void ethernet
task(void)
{
/* Run polling tasks */
ethernetifinput(&gs
netif);
/* Run periodic tasks */
timers_update();
}
~~~
Brief Create ethernet task, for ethernet management.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
void init_ethernet(void)
{
/** set a unique MAC address from falsh**/
set_MAC_addresses();
/** Initialize lwIP */
lwip_init(); //initializes the functions enabled in lwipopts.h
/** Set hw and IP parameters, initialize MAC too */
ethernet_configure_interface();
//LLMNR_init(&gs_net_if); //initializes the LLMNR responder
if defined(HTTPRAWUSED)
/** Bring up the web server */
http_init();
endif
if defined(FTPRAWUSED)
/** Bring up the FTP server */
ftpd_init();
endif
}
~~~
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
define TASKwebserverSTACKSIZE (4096/sizeof(portSTACKTYPE))
define TASKwebserverSTACKPRIORITY (tskIDLEPRIORITY + 3)
~~~
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
static void webserver
task(void *pvParameters)
{
UNUSED(pvParameters);
/** Wait for user to read instructions. */
WAITFOR_EVENT;
while (1) {
ethernet_task();
}
}
~~~
//////////////////////////////////////////////////////
MAIN.
~~~
sysclk
init();
boardinit();
init_ethernet();
if (xTaskCreate(webserver
task, “webserver”, TASKwebserver
STACKSIZE, NULL,TASK
webserverSTACK_PRIORITY, NULL) != pdPASS) {
}
~~~
My question is how I can possibly proceed to get the two servers working?
Should I create another task for the FTP server?
Thanks in advance!