Skip to content

Commit

Permalink
Fix PANID configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyClaeys committed Sep 3, 2020
1 parent 5e3e1d9 commit 0bb73aa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ for option in env['stackcfg'].split(','):
env.Append(CPPDEFINES='ADAPTIVE_MSF')
elif name == 'channel':
env.Append(CPPDEFINES='IEEE802154E_SINGLE_CHANNEL={}'.format(value))
elif name == 'panid':
env.Append(CPPDEFINES='PANID_DEFINED={}'.format(value))
else:
print c.Fore.RED + 'Unknown or invalid option for stackcfg: {}'.format(name) + c.Fore.RESET

Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ command_line_options = {
'apps': ['c6t', 'cexample', 'cinfo', 'cinfrared', 'cled', 'csensors', 'cstorm', 'cwellknown', 'rrt', 'uecho',
'uexpiration', 'uexp-monitor', 'uinject', 'userialbridge', 'cjoin', ''],
'modules': ['coap', 'udp', 'fragmentation', 'icmpv6echo', 'l2-security', ''],
'stackcfg': ['adaptive-msf', 'dagroot', 'channel', 'pktqueue', ''],
'stackcfg': ['adaptive-msf', 'dagroot', 'channel', 'pktqueue', 'panid', ''],
'boardopt' : ['hw-crypto', 'printf', 'fastsim', ''],
'fet_version': ['2', '3'],
'verbose': ['0', '1'],
Expand Down
10 changes: 10 additions & 0 deletions inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,16 @@
#define DAGROOT (0)
#endif

/**
* \def DAGROOT
*
* Set this mote as the DODAG root.
*
*/
#ifndef PANID_DEFINED
#define PANID_DEFINED (0xcafe)
#endif

// ======================== Board configuration ========================

/**
Expand Down
6 changes: 1 addition & 5 deletions openstack/cross-layers/idmanager.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ void idmanager_init(void) {

// myPANID
idmanager_vars.myPANID.type = ADDR_PANID;
#ifdef PANID_DEFINED
idmanager_vars.myPANID.panid[0] = PANID_DEFINED & 0x00ff;
idmanager_vars.myPANID.panid[1] =(PANID_DEFINED & 0xff00)>>8;
#else
idmanager_vars.myPANID.panid[0] = 0xca;
idmanager_vars.myPANID.panid[1] = 0xfe;
#endif

// myPrefix
idmanager_vars.myPrefix.type = ADDR_PREFIX;
#if DAGROOT
Expand Down

0 comments on commit 0bb73aa

Please sign in to comment.