Skip to content

Commit 034f793

Browse files
authored
Merge pull request #426 from openwsn-berkeley/develop_FW-741
FW-741. Disable MSF add/delete cells after first cell is added.
2 parents 74bde4c + b9e099e commit 034f793

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

SConscript

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ if env['noadaptivesync']==1:
4646
env.Append(CPPDEFINES = 'NOADAPTIVESYNC')
4747
if env['l2_security']==1:
4848
env.Append(CPPDEFINES = 'L2_SECURITY_ACTIVE')
49+
if env['msf_adapting_to_traffic']==1:
50+
env.Append(CPPDEFINES = 'MSF_ADAPTING_TO_TRAFFIC')
4951
if env['printf']==1:
5052
env.Append(CPPDEFINES = 'OPENSERIAL_PRINTF')
5153
if env['deadline_option']==1:

SConstruct

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ project:
7878
openstack/02a-MAClow/topology.c file.
7979
noadaptivesync Do not use adaptive synchronization.
8080
l2_security Use hop-by-hop encryption and authentication.
81-
0 (off), 1 (on)
81+
0 (off), 1 (on)
82+
msf_adapting_to_traffic enable/disable MSF for adding/deleting cell to adapt to traffic
83+
0 (disable), 1 (enable)
8284
printf Sends the string messages to openvisualizer
8385
0 (off ), 1 (on, default)
8486
ide qtcreator
@@ -129,21 +131,22 @@ command_line_options = {
129131
'openos',
130132
'freertos',
131133
],
132-
'fet_version': ['2','3'],
133-
'verbose': ['0','1'],
134-
'fastsim': ['1','0'],
135-
'simhost': ['amd64-linux','x86-linux','amd64-windows','x86-windows'],
136-
'simhostpy': [''], # No reasonable default
137-
'panid': [''],
138-
'dagroot': ['0','1'],
139-
'forcetopology': ['0','1'],
140-
'debug': ['0','1'],
141-
'noadaptivesync': ['0','1'],
142-
'l2_security': ['0','1'],
143-
'printf': ['1','0'], # 1=on (default), 0=off
144-
'deadline_option': ['0','1'],
145-
'ide': ['none','qtcreator'],
146-
'revision': ['']
134+
'fet_version': ['2','3'],
135+
'verbose': ['0','1'],
136+
'fastsim': ['1','0'],
137+
'simhost': ['amd64-linux','x86-linux','amd64-windows','x86-windows'],
138+
'simhostpy': [''], # No reasonable default
139+
'panid': [''],
140+
'dagroot': ['0','1'],
141+
'forcetopology': ['0','1'],
142+
'debug': ['0','1'],
143+
'noadaptivesync': ['0','1'],
144+
'l2_security': ['0','1'],
145+
'msf_adapting_to_traffic': ['0','1'],
146+
'printf': ['1','0'], # 1=on (default), 0=off
147+
'deadline_option': ['0','1'],
148+
'ide': ['none','qtcreator'],
149+
'revision': ['']
147150
}
148151

149152
def validate_option(key, value, env):
@@ -287,6 +290,13 @@ command_line_vars.AddVariables(
287290
command_line_options['l2_security'][0], # default
288291
validate_option, # validator
289292
int, # converter
293+
),
294+
(
295+
'msf_adapting_to_traffic', # key
296+
'', # help
297+
command_line_options['msf_adapting_to_traffic'][1],# default
298+
validate_option, # validator
299+
int, # converter
290300
),
291301
(
292302
'printf', # key

openstack/02b-MAChigh/msf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void msf_init(void) {
5959

6060
// called by schedule
6161
void msf_updateCellsPassed(open_addr_t* neighbor){
62-
62+
#ifdef MSF_ADAPTING_TO_TRAFFIC
6363
if (icmpv6rpl_isPreferredParent(neighbor)==FALSE){
6464
return;
6565
}
@@ -75,6 +75,7 @@ void msf_updateCellsPassed(open_addr_t* neighbor){
7575
msf_vars.numCellsPassed = 0;
7676
msf_vars.numCellsUsed = 0;
7777
}
78+
#endif
7879
}
7980

8081
void msf_updateCellsUsed(open_addr_t* neighbor){

0 commit comments

Comments
 (0)