1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

rpl_udp: Addresses must only be 8-bit with cc110x

This commit is contained in:
Martine Lenders 2014-10-25 18:34:38 +02:00
parent 0641ccbd5d
commit 38fab9dbb6
4 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,6 @@
command order:
set <node-id>
init [r|n]
server
send <node-id> <message>
@ -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.

View File

@ -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;
}

View File

@ -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);

View File

@ -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);