Skip to content

Commit

Permalink
removing DIO/DAO from queue when de-synch
Browse files Browse the repository at this point in the history
  • Loading branch information
xvilajosana committed Jan 30, 2013
1 parent 337c8c1 commit 2642543
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions firmware/openos/openwsn/03b-IPv6/icmpv6rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "scheduler.h"
#include "idmanager.h"
#include "opentimers.h"
#include "IEEE802154E.h"

//=========================== variables =======================================

Expand Down Expand Up @@ -252,11 +253,25 @@ void sendDIO() {
open_addr_t* temp_prefixID;
OpenQueueEntry_t* msg;

if (ieee154e_isSynch()==FALSE) {
// I'm not sync'ed

// delete packets genereted by this module (DIO and DAO) from openqueue
openqueue_removeAllCreatedBy(COMPONENT_ICMPv6RPL);

// I'm not busy sending a DIO
icmpv6rpl_vars.busySending = FALSE;

// stop here
return;
}

// do not send DIO if I'm in in bridge mode
if (idmanager_getIsBridge()==TRUE) {
return;
}


// do not send DIO if I have the default DAG rank
if (neighbors_getMyDAGrank()==DEFAULTDAGRANK) {
return;
Expand All @@ -279,6 +294,8 @@ void sendDIO() {
(errorparameter_t)0,
(errorparameter_t)0);
icmpv6rpl_vars.busySending = FALSE;


return;
}

Expand Down Expand Up @@ -338,6 +355,20 @@ void sendDAO() {
uint8_t j;
OpenQueueEntry_t* msg;


if (ieee154e_isSynch()==FALSE) {
// I'm not sync'ed

// delete packets genereted by this module (DIO and DAO) from openqueue
openqueue_removeAllCreatedBy(COMPONENT_ICMPv6RPL);

// I'm not busy sending a DIO
icmpv6rpl_vars.busySending = FALSE;

// stop here
return;
}

// dont' send a DAO if you're in bridge mode
if (idmanager_getIsBridge()==TRUE) {
return;
Expand Down

0 comments on commit 2642543

Please sign in to comment.