Skip to content

Commit 6160a07

Browse files
committedAug 28, 2017
act as leaf node by stopping send DIO if neighbor's control slot is conflict with parent's.
1 parent 48dafd8 commit 6160a07

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed
 

‎openstack/02a-MAClow/IEEE802154E.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,8 @@ port_INLINE void activity_ti1ORri1() {
927927
// sfcontrol
928928
/**
929929
minimal slot 0:
930-
only send DIO with possibility of 10 %
930+
only send DIO with possibility of 10% or
931+
stop sending DIO if control slot conflict detected
931932
my control slot:
932933
when traffic controlled by sf0:
933934
only allow sixtopres packet to send
@@ -940,7 +941,10 @@ port_INLINE void activity_ti1ORri1() {
940941
*/
941942
if (ieee154e_vars.slotOffset==SCHEDULE_MINIMAL_6TISCH_SLOTOFFSET){
942943
ieee154e_vars.dataToSend = openqueue_macGetDIOPacket();
943-
if (ieee154e_vars.dataToSend != NULL && openrandom_get16b()>0xffff/10){
944+
if (
945+
(ieee154e_vars.dataToSend != NULL && openrandom_get16b()>0xffff/10) ||
946+
sf0_getControlslotConflictWithParent()
947+
){
944948
ieee154e_vars.dataToSend = NULL;
945949
}
946950
} else {
@@ -960,7 +964,8 @@ port_INLINE void activity_ti1ORri1() {
960964
} else {
961965
if (cellType==CELLTYPE_TXRX && neighbor.type == ADDR_64B){
962966
// this is parent control slot
963-
ieee154e_vars.dataToSend = openqueue_macGetPacketCreatedBy(COMPONENT_SIXTOP_RES,&neighbor);
967+
// ieee154e_vars.dataToSend = openqueue_macGetPacketCreatedBy(COMPONENT_SIXTOP_RES,&neighbor);
968+
ieee154e_vars.dataToSend = openqueue_macGetDataPacket(&neighbor);
964969
} else {
965970
// all other slots send data packet
966971
ieee154e_vars.dataToSend = openqueue_macGetDataPacket(&neighbor);
@@ -2498,6 +2503,7 @@ bool isValidEbFormat(OpenQueueEntry_t* pkt, uint16_t* lenIE){
24982503
// there is a conflict when using this hashFunction, replace my control slot by neighbor's control slot.
24992504
// (same slotoffset and type but with neighbor's ADDR_64B address associated)
25002505
schedule_removeActiveSlot(tempSlotoffset,&temp_neighbor);
2506+
sf0_setControlslotConflictWithParent(TRUE);
25012507
}
25022508

25032509
schedule_addActiveSlot(

‎openstack/02b-MAChigh/sf0.c

+8
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ void sf0_6pQuery_notifyReceived(uint16_t queryOffset, open_addr_t* neighbor){
171171
}
172172
}
173173

174+
bool sf0_getControlslotConflictWithParent(){
175+
return sf0_vars.controlCellConflictWithParent;
176+
}
177+
178+
void sf0_setControlslotConflictWithParent(bool isConflicted){
179+
sf0_vars.controlCellConflictWithParent = isConflicted;
180+
}
181+
174182
void sf0_6pQuery_timer_cb(opentimers_id_t id){
175183
open_addr_t temp_neighbor;
176184
owerror_t outcome;

‎openstack/02b-MAChigh/sf0.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef struct {
2525
bool sf_controlSlot_reserved;
2626
bool sf_isBusySendingQuery;
2727
uint8_t sf_query_offset;
28-
28+
bool controlCellConflictWithParent;
2929
bool busySendingKA;
3030
// sfcontrol
3131
} sf0_vars_t;
@@ -48,6 +48,8 @@ uint16_t sf0_getControlslotoffset(void);
4848
uint16_t sf0_hashFunction(uint16_t functionInput);
4949
bool sf0_isTrafficControlled(void);
5050
void sf0_6pQuery_notifyReceived(uint16_t queryOffset, open_addr_t* neighbor);
51+
bool sf0_getControlslotConflictWithParent();
52+
void sf0_setControlslotConflictWithParent(bool isConflicted);
5153

5254
void sf0_6pQuery_sendDone(void);
5355
// sf control

‎projects/python/SConscript.env

+2
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ functionsToChange = [
637637
'sf0_getMetadata',
638638
'sf0_translateMetadata',
639639
'sf0_handleRCError',
640+
'sf0_getControlslotConflictWithParent',
641+
'sf0_setControlslotConflictWithParent',
640642
# sixtop
641643
'sixtop_init',
642644
'sixtop_setKaPeriod',

0 commit comments

Comments
 (0)