diff --git a/examples/rpl_udp/README.md b/examples/rpl_udp/README.md index f509a9f5b7..a56668666a 100644 --- a/examples/rpl_udp/README.md +++ b/examples/rpl_udp/README.md @@ -2,7 +2,6 @@ command order: - set init [r|n] server send @@ -24,11 +23,6 @@ Run the first node make term Type ``help`` to see the commands available. -Now you need set the node ID. This ID will be used by other nodes to address this node. - - > set 1 - set 1 - Set node ID to 1 Init your rpl node as either a root or a node router. diff --git a/examples/rpl_udp/helper.c b/examples/rpl_udp/helper.c index 87d867b002..2b2b567c5f 100644 --- a/examples/rpl_udp/helper.c +++ b/examples/rpl_udp/helper.c @@ -43,7 +43,11 @@ void rpl_udp_set_id(int argc, char **argv) { if (argc != 2) { printf("Usage: %s address\n", argv[0]); +#if defined(MODULE_CC110X_LEGACY_CSMA) || defined(MODULE_CC110X_LEGACY) printf("\taddress must be an 8 bit integer\n"); +#else + printf("\taddress must be an 16 bit integer\n"); +#endif printf("\n\t(Current address is %u)\n", id); return; } diff --git a/examples/rpl_udp/main.c b/examples/rpl_udp/main.c index 38f93d9048..f5cbe0cecd 100644 --- a/examples/rpl_udp/main.c +++ b/examples/rpl_udp/main.c @@ -46,6 +46,7 @@ int main(void) /* start shell */ posix_open(uart0_handler_pid, 0); net_if_set_src_address_mode(0, NET_IF_TRANS_ADDR_M_SHORT); + id = net_if_get_hardware_address(0); shell_t shell; shell_init(&shell, shell_commands, UART0_BUFSIZE, uart0_readc, uart0_putc); diff --git a/examples/rpl_udp/rpl.c b/examples/rpl_udp/rpl.c index 02338b2a32..2ac642ea82 100644 --- a/examples/rpl_udp/rpl.c +++ b/examples/rpl_udp/rpl.c @@ -60,10 +60,12 @@ void rpl_udp_init(int argc, char **argv) ((command == 'h') ? "non-" : ""), (((command == 'n') || (command == 'h')) ? "node" : "root"), id); +#if defined(MODULE_CC110X_LEGACY_CSMA) || defined(MODULE_CC110X_LEGACY) if (!id || (id > 255)) { printf("ERROR: address not a valid 8 bit integer\n"); return; } +#endif DEBUGF("Setting HW address to %u\n", id); net_if_set_hardware_address(0, id);