Add some debug PRINTFs for RPL_LEAF_ONLY mode.

This commit is contained in:
Mariano Alvira 2013-02-20 18:25:32 -05:00
parent a7b3e99644
commit 03fdb53af1

View file

@ -158,6 +158,7 @@ dis_input(void)
if(instance->used == 1) {
#if RPL_LEAF_ONLY
if(!uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) {
PRINTF("RPL: LEAF ONLY Multicast DIS will NOT reset DIO timer\n");
#else /* !RPL_LEAF_ONLY */
if(uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) {
PRINTF("RPL: Multicast DIS => reset DIO timer\n");
@ -415,6 +416,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
/* In leaf mode, we send DIO message only as unicasts in response to
unicast DIS messages. */
if(uc_addr == NULL) {
PRINTF("RPL: LEAF ONLY have multicast addr: skip dio_output\n");
return;
}
#endif /* RPL_LEAF_ONLY */
@ -427,6 +429,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
buffer[pos++] = dag->version;
#if RPL_LEAF_ONLY
PRINTF("RPL: LEAF ONLY DIO rank set to INFINITE_RANK\n");
set16(buffer, pos, INFINITE_RANK);
#else /* RPL_LEAF_ONLY */
set16(buffer, pos, dag->rank);
@ -522,6 +525,11 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
}
#if RPL_LEAF_ONLY
#if (DEBUG) & DEBUG_PRINT
if(uc_addr == NULL) {
PRINTF("RPL: LEAF ONLY sending unicast-DIO from multicast-DIO\n");
}
#endif /* DEBUG_PRINT */
PRINTF("RPL: Sending unicast-DIO with rank %u to ",
(unsigned)dag->rank);
PRINT6ADDR(uc_addr);