Browse Source

rpl: adjust to trickle enhancements

master
Cenk Gündoğan 6 years ago
parent
commit
04d89d3381
  1. 9
      sys/include/net/gnrc/rpl.h
  2. 17
      sys/net/gnrc/routing/rpl/gnrc_rpl.c
  3. 6
      sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c

9
sys/include/net/gnrc/rpl.h

@ -156,14 +156,9 @@ extern "C" {
#define GNRC_RPL_MSG_TYPE_LIFETIME_UPDATE (0x0900)
/**
* @brief Message type for trickle intervals
* @brief Message type for trickle
*/
#define GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL (0x0901)
/**
* @brief Message type for trickle callbacks
*/
#define GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK (0x0902)
#define GNRC_RPL_MSG_TYPE_TRICKLE_MSG (0x0901)
/**
* @brief Message type for handling DAO sending

17
sys/net/gnrc/routing/rpl/gnrc_rpl.c

@ -120,9 +120,9 @@ gnrc_rpl_instance_t *gnrc_rpl_root_init(uint8_t instance_id, ipv6_addr_t *dodag_
dodag->dio_opts |= GNRC_RPL_REQ_DIO_OPT_PREFIX_INFO;
#endif
trickle_start(gnrc_rpl_pid, &dodag->trickle, GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL,
GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK, (1 << dodag->dio_min),
dodag->dio_interval_doubl, dodag->dio_redun);
trickle_start(gnrc_rpl_pid, &dodag->trickle, GNRC_RPL_MSG_TYPE_TRICKLE_MSG,
(1 << dodag->dio_min), dodag->dio_interval_doubl,
dodag->dio_redun);
return inst;
}
@ -216,15 +216,8 @@ static void *_event_loop(void *args)
DEBUG("RPL: GNRC_RPL_MSG_TYPE_LIFETIME_UPDATE received\n");
_update_lifetime();
break;
case GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL:
DEBUG("RPL: GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL received\n");
trickle = msg.content.ptr;
if (trickle && (trickle->callback.func != NULL)) {
trickle_interval(trickle);
}
break;
case GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK:
DEBUG("RPL: GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK received\n");
case GNRC_RPL_MSG_TYPE_TRICKLE_MSG:
DEBUG("RPL: GNRC_RPL_MSG_TYPE_TRICKLE_MSG received\n");
trickle = msg.content.ptr;
if (trickle && (trickle->callback.func != NULL)) {
trickle_callback(trickle);

6
sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c

@ -551,9 +551,9 @@ void gnrc_rpl_recv_DIO(gnrc_rpl_dio_t *dio, kernel_pid_t iface, ipv6_addr_t *src
}
gnrc_rpl_delay_dao(dodag);
trickle_start(gnrc_rpl_pid, &dodag->trickle, GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL,
GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK, (1 << dodag->dio_min),
dodag->dio_interval_doubl, dodag->dio_redun);
trickle_start(gnrc_rpl_pid, &dodag->trickle, GNRC_RPL_MSG_TYPE_TRICKLE_MSG,
(1 << dodag->dio_min), dodag->dio_interval_doubl,
dodag->dio_redun);
gnrc_rpl_parent_update(dodag, parent);
return;

Loading…
Cancel
Save