examples: networking support for default example

Adds basic link layer functionality to the default example application.
dev/timer
Oleg Hahm 8 years ago
parent 0e0a9d8e11
commit e156bd820e

@ -34,6 +34,16 @@ USEMODULE += shell_commands
USEMODULE += ps
USEMODULE += config
# Use modules for networking
# gnrc is a meta module including all required, basic gnrc networking modules
USEMODULE += gnrc
# use the default network interface for the board
USEMODULE += gnrc_netif_default
# automatically initialize the network interface
USEMODULE += auto_init_gnrc_netif
# the application dumps received packets to stdout
USEMODULE += gnrc_pktdump
FEATURES_OPTIONAL += config
FEATURES_OPTIONAL += periph_rtc

@ -37,6 +37,11 @@
#include "ltc4150.h"
#endif
#ifdef MODULE_NETIF
#include "net/gnrc/pktdump.h"
#include "net/gnrc.h"
#endif
int main(void)
{
#ifdef MODULE_LTC4150
@ -47,6 +52,14 @@ int main(void)
rtc_init();
#endif
#ifdef MODULE_NETIF
gnrc_netreg_entry_t dump;
dump.pid = gnrc_pktdump_getpid();
dump.demux_ctx = GNRC_NETREG_DEMUX_CTX_ALL;
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);
#endif
(void) puts("Welcome to RIOT!");
char line_buf[SHELL_DEFAULT_BUFSIZE];

Loading…
Cancel
Save