RPL BR: rework such as the main .c file defines its own process

This commit is contained in:
Simon Duquennoy 2017-12-19 08:44:40 -08:00
parent 070b493391
commit 89c4f5e509
1 changed files with 22 additions and 5 deletions

View File

@ -32,11 +32,28 @@
#include "contiki.h"
PROCESS_NAME(border_router_process);
/* Log configuration */
#include "sys/log.h"
#define LOG_MODULE "RPL BR"
#define LOG_LEVEL LOG_LEVEL_INFO
/* Declare and auto-start this file's process */
PROCESS(contiki_ng_br, "Contiki-NG Border Router");
AUTOSTART_PROCESSES(&contiki_ng_br);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(contiki_ng_br, ev, data)
{
PROCESS_BEGIN();
PROCESS_NAME(border_router_process);
process_start(&border_router_process, NULL);
#if BORDER_ROUTER_CONF_WEBSERVER
PROCESS_NAME(webserver_nogui_process);
AUTOSTART_PROCESSES(&border_router_process, &webserver_nogui_process);
#else /* BORDER_ROUTER_CONF_WEBSERVER */
AUTOSTART_PROCESSES(&border_router_process);
PROCESS_NAME(webserver_nogui_process);
process_start(&webserver_nogui_process, NULL);
#endif /* BORDER_ROUTER_CONF_WEBSERVER */
LOG_INFO("Contiki-NG Border Router started\n");
PROCESS_END();
}