Skip to content

Commit dcf26e9

Browse files
authored
Merge pull request #395 from openwsn-berkeley/develop_FW-548
FW-548. implementing MSF algorithm for adapting to traffic.
2 parents 81d7388 + 66e6cd4 commit dcf26e9

File tree

42 files changed

+1957
-1648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1957
-1648
lines changed

bsp/boards/python/openwsnmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static PyObject* OpenMote_getState(OpenMote* self) {
5656
PyObject* monitor_expiration_vars;
5757
PyObject* neighbors_vars;
5858
PyObject* sixtop_vars;
59-
PyObject* sf0_vars;
59+
PyObject* msf_vars;
6060
PyObject* schedule_vars;
6161
PyObject* schedule_dbg;
6262
PyObject* ieee154e_vars;
@@ -114,10 +114,10 @@ static PyObject* OpenMote_getState(OpenMote* self) {
114114
// TODO
115115
PyDict_SetItemString(returnVal, "sixtop_vars", sixtop_vars);
116116

117-
// sf0_vars
118-
sf0_vars = PyDict_New();
117+
// msf_vars
118+
msf_vars = PyDict_New();
119119
// TODO
120-
PyDict_SetItemString(returnVal, "sf0_vars", sf0_vars);
120+
PyDict_SetItemString(returnVal, "msf_vars", msf_vars);
121121

122122
// schedule_vars
123123
schedule_vars = PyDict_New();

bsp/boards/python/openwsnmodule_obj.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "iphc_obj.h"
2121
#include "neighbors_obj.h"
2222
#include "sixtop_obj.h"
23-
#include "sf0_obj.h"
23+
#include "msf_obj.h"
2424
#include "schedule_obj.h"
2525
#include "icmpv6echo_obj.h"
2626
#include "icmpv6rpl_obj.h"
@@ -204,7 +204,7 @@ struct OpenMote {
204204
sixtop_vars_t sixtop_vars;
205205
neighbors_vars_t neighbors_vars;
206206
schedule_vars_t schedule_vars;
207-
sf0_vars_t sf0_vars;
207+
msf_vars_t msf_vars;
208208
// l2a
209209
adaptive_sync_vars_t adaptive_sync_vars;
210210
ieee802154_security_vars_t ieee802154_security_vars;

drivers/common/openserial.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "schedule.h"
2626
#include "icmpv6rpl.h"
2727
#include "icmpv6echo.h"
28-
#include "sf0.h"
28+
#include "msf.h"
2929

3030

3131

@@ -182,6 +182,7 @@ owerror_t openserial_printCritical(
182182
) {
183183
opentimers_id_t id;
184184
uint32_t reference;
185+
185186
// blink error LED, this is serious
186187
leds_error_blink();
187188

@@ -795,7 +796,7 @@ void openserial_handleCommands(void){
795796
cellOptions, // cellOptions
796797
celllist_add, // celllist to add
797798
celllist_delete, // celllist to delete (not used)
798-
sf0_getsfid(), // sfid
799+
msf_getsfid(), // sfid
799800
listOffset, // list command offset (not used)
800801
maxListLen // list command maximum celllist (not used)
801802
);
@@ -820,7 +821,7 @@ void openserial_handleCommands(void){
820821
break;
821822
case COMMAND_SET_UINJECTPERIOD:
822823
comandParam_8 = openserial_vars.inputBuf[ptr];
823-
sf0_appPktPeriod(comandParam_8);
824+
msf_appPktPeriod(comandParam_8);
824825
break;
825826
case COMMAND_SET_ECHO_REPLY_STATUS:
826827
comandParam_8 = openserial_vars.inputBuf[ptr];

inc/opendefs.h

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ static const uint8_t infoStackName[] = "OpenWSN ";
3636
#define LENGTH_ADDR64b 8
3737
#define LENGTH_ADDR128b 16
3838

39-
#define MAXNUMNEIGHBORS 10
39+
#define MAXNUMNEIGHBORS 30
4040

4141
// maximum celllist length
42-
#define CELLLIST_MAX_LEN 3
42+
#define CELLLIST_MAX_LEN 5
4343

4444
enum {
4545
E_SUCCESS = 0,
@@ -144,40 +144,36 @@ enum {
144144
COMPONENT_NEIGHBORS = 0x0d,
145145
COMPONENT_SCHEDULE = 0x0e,
146146
COMPONENT_SIXTOP_RES = 0x0f,
147-
COMPONENT_SF = 0x10,
148147
//IPHC
149-
COMPONENT_OPENBRIDGE = 0x11,
150-
COMPONENT_IPHC = 0x12,
148+
COMPONENT_OPENBRIDGE = 0x10,
149+
COMPONENT_IPHC = 0x11,
151150
//IPv6
152-
COMPONENT_FORWARDING = 0x13,
153-
COMPONENT_ICMPv6 = 0x14,
154-
COMPONENT_ICMPv6ECHO = 0x15,
155-
COMPONENT_ICMPv6ROUTER = 0x16,
156-
COMPONENT_ICMPv6RPL = 0x17,
151+
COMPONENT_FORWARDING = 0x12,
152+
COMPONENT_ICMPv6 = 0x13,
153+
COMPONENT_ICMPv6ECHO = 0x14,
154+
COMPONENT_ICMPv6ROUTER = 0x15,
155+
COMPONENT_ICMPv6RPL = 0x16,
157156
//TRAN
158-
COMPONENT_OPENTCP = 0x18,
159-
COMPONENT_OPENUDP = 0x19,
160-
COMPONENT_OPENCOAP = 0x1a,
157+
COMPONENT_OPENUDP = 0x17,
158+
COMPONENT_OPENCOAP = 0x18,
161159
// applications
162-
COMPONENT_C6T = 0x1b,
163-
COMPONENT_CEXAMPLE = 0x1c,
164-
COMPONENT_CINFO = 0x1d,
165-
COMPONENT_CLEDS = 0x1e,
166-
COMPONENT_CSENSORS = 0x1f,
167-
COMPONENT_CSTORM = 0x20,
168-
COMPONENT_CWELLKNOWN = 0x21,
169-
COMPONENT_TECHO = 0x22,
170-
COMPONENT_TOHLONE = 0x23,
171-
COMPONENT_UECHO = 0x24,
172-
COMPONENT_UINJECT = 0x25,
173-
COMPONENT_RRT = 0x26,
174-
COMPONENT_SECURITY = 0x27,
175-
COMPONENT_USERIALBRIDGE = 0x28,
176-
COMPONENT_UEXPIRATION = 0x29,
177-
COMPONENT_UMONITOR = 0x2a,
178-
COMPONENT_CJOIN = 0x2b,
179-
COMPONENT_OPENOSCOAP = 0x2c,
180-
COMPONENT_CINFRARED = 0x2d,
160+
COMPONENT_C6T = 0x19,
161+
COMPONENT_CEXAMPLE = 0x1a,
162+
COMPONENT_CINFO = 0x1b,
163+
COMPONENT_CLEDS = 0x1c,
164+
COMPONENT_CSENSORS = 0x1d,
165+
COMPONENT_CSTORM = 0x1e,
166+
COMPONENT_CWELLKNOWN = 0x1f,
167+
COMPONENT_UECHO = 0x20,
168+
COMPONENT_UINJECT = 0x21,
169+
COMPONENT_RRT = 0x22,
170+
COMPONENT_SECURITY = 0x23,
171+
COMPONENT_USERIALBRIDGE = 0x24,
172+
COMPONENT_UEXPIRATION = 0x25,
173+
COMPONENT_UMONITOR = 0x26,
174+
COMPONENT_CJOIN = 0x27,
175+
COMPONENT_OPENOSCOAP = 0x28,
176+
COMPONENT_CINFRARED = 0x29,
181177
};
182178

183179
/**
@@ -386,7 +382,7 @@ typedef struct {
386382
asn_t asn;
387383
uint8_t joinPrio;
388384
bool f6PNORES;
389-
uint8_t generation;
385+
bool inBlacklist;
390386
uint8_t sequenceNumber;
391387
uint8_t backoffExponenton;
392388
uint8_t backoff;

kernel/scheduler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ typedef enum {
2222
TASKPRIO_RPL = 0x04,
2323
TASKPRIO_TCP_TIMEOUT = 0x05,
2424
TASKPRIO_COAP = 0x06,
25-
TASKPRIO_ADAPTIVE_SYNC = 0x07,
26-
TASKPRIO_SF0 = 0x08,
25+
TASKPRIO_ADAPTIVE_SYNC = 0x07,
26+
TASKPRIO_MSF = 0x08,
2727
// tasks trigger by other interrupts
2828
TASKPRIO_BUTTON = 0x09,
2929
TASKPRIO_SIXTOP_TIMEOUT = 0x0a,

openapps/c6t/c6t.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "idmanager.h"
1212
#include "openqueue.h"
1313
#include "neighbors.h"
14-
#include "sf0.h"
14+
#include "msf.h"
1515

1616
//=========================== defines =========================================
1717

@@ -94,7 +94,7 @@ owerror_t c6t_receive(OpenQueueEntry_t* msg,
9494
break;
9595
}
9696

97-
if (sf0_candidateAddCellList(celllist_add,1)==FALSE){
97+
if (msf_candidateAddCellList(celllist_add,1)==FALSE){
9898
// set the CoAP header
9999
outcome = E_FAIL;
100100
coap_header->Code = COAP_CODE_RESP_CHANGED;
@@ -105,10 +105,10 @@ owerror_t c6t_receive(OpenQueueEntry_t* msg,
105105
IANA_6TOP_CMD_ADD, // code
106106
&neighbor, // neighbor
107107
1, // number cells
108-
LINKOPTIONS_TX, // cellOptions
108+
CELLOPTIONS_TX, // cellOptions
109109
celllist_add, // celllist to add
110110
NULL, // celllist to delete (not used)
111-
sf0_getsfid(), // sfid
111+
msf_getsfid(), // sfid
112112
0, // list command offset (not used)
113113
0 // list command maximum celllist (not used)
114114
);
@@ -134,7 +134,7 @@ owerror_t c6t_receive(OpenQueueEntry_t* msg,
134134
}
135135

136136
// call sixtop
137-
if (sf0_candidateRemoveCellList(celllist_delete,&neighbor,1)==FALSE){
137+
if (msf_candidateRemoveCellList(celllist_delete,&neighbor,1)==FALSE){
138138
// set the CoAP header
139139
outcome = E_FAIL;
140140
coap_header->Code = COAP_CODE_RESP_CHANGED;
@@ -145,10 +145,10 @@ owerror_t c6t_receive(OpenQueueEntry_t* msg,
145145
IANA_6TOP_CMD_ADD, // code
146146
&neighbor, // neighbor
147147
1, // number cells
148-
LINKOPTIONS_TX, // cellOptions
148+
CELLOPTIONS_TX, // cellOptions
149149
celllist_add, // celllist to add
150150
NULL, // celllist to delete (not used)
151-
sf0_getsfid(), // sfid
151+
msf_getsfid(), // sfid
152152
0, // list command offset (not used)
153153
0 // list command maximum celllist (not used)
154154
);

0 commit comments

Comments
 (0)