Add WITH_WEBSERVER=<webserver> options

This commit is contained in:
David Kopf 2011-07-24 11:59:28 -04:00
parent 05c11d362b
commit 031c45994b
4 changed files with 55 additions and 16 deletions

View file

@ -69,11 +69,17 @@ static uip_ipaddr_t prefix;
static uint8_t prefix_set;
PROCESS(border_router_process, "Border router process");
AUTOSTART_PROCESSES(&border_router_process);
#if WEBSERVER
/*---------------------------------------------------------------------------*/
/* Only one single web request at time */
#if WEBSERVER==0
/* No webserver */
AUTOSTART_PROCESSES(&border_router_process);
#elif WEBSERVER>1
/* Use an external webserver process */
//PROCESS_NAME(webserver_nogui_process);
AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process);
#else
AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process);
/* Use simple webserver with only one page */
static const char *TOP = "<html><head><title>ContikiRPL</title></head><body>\n";
static const char *BOTTOM = "</body></html>\n";
static char buf[128];
@ -212,10 +218,6 @@ PROCESS_THREAD(border_router_process, ev, data)
PROCESS_PAUSE();
#if WEBSERVER
process_start(&webserver_nogui_process, NULL);
#endif
SENSORS_ACTIVATE(button_sensor);
PRINTF("RPL-Border router started\n");