fixed codestyle, improved APIs, and cleaned up comments

This commit is contained in:
Joakim Eriksson 2016-03-26 20:12:52 +01:00
parent 12ac02650b
commit 12a75c3e43
12 changed files with 91 additions and 51 deletions

View file

@ -54,7 +54,9 @@
static void reset(rpl_dag_t *);
static void neighbor_link_callback(rpl_parent_t *, int, int);
#if RPL_WITH_DAO_ACK
static void dao_ack_callback(rpl_parent_t *, int);
#endif
static rpl_parent_t *best_parent(rpl_parent_t *, rpl_parent_t *);
static rpl_dag_t *best_dag(rpl_dag_t *, rpl_dag_t *);
static rpl_rank_t calculate_rank(rpl_parent_t *, rpl_rank_t);
@ -63,7 +65,9 @@ static void update_metric_container(rpl_instance_t *);
rpl_of_t rpl_mrhof = {
reset,
neighbor_link_callback,
#if RPL_WITH_DAO_ACK
dao_ack_callback,
#endif
best_parent,
best_dag,
calculate_rank,
@ -119,10 +123,11 @@ reset(rpl_dag_t *dag)
PRINTF("RPL: Reset MRHOF\n");
}
#if RPL_WITH_DAO_ACK
static void
dao_ack_callback(rpl_parent_t *p, int status)
{
if(status == RPL_DAO_ACK_UNABLE_TO_ACCEPT_ROOT) {
if(status == RPL_DAO_ACK_UNABLE_TO_ADD_ROUTE_AT_ROOT) {
return;
}
/* here we need to handle failed DAO's and other stuff */
@ -135,6 +140,7 @@ dao_ack_callback(rpl_parent_t *p, int status)
neighbor_link_callback(p, MAC_TX_OK, 10);
}
}
#endif /* RPL_WITH_DAO_ACK */
static void
neighbor_link_callback(rpl_parent_t *p, int status, int numtx)