Skip to content

Commit

Permalink
Removed automatic network size configuration (ARMmbed#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Leppänen authored Aug 31, 2021
1 parent 35d3132 commit cad5122
Show file tree
Hide file tree
Showing 8 changed files with 353 additions and 1,067 deletions.
20 changes: 10 additions & 10 deletions source/6LoWPAN/ws/ws_bbr_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ int ws_bbr_rpl_parameters_set(int8_t interface_id, uint8_t dio_interval_min, uin
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);

ws_bbr_cfg_t cfg;
if (ws_cfg_bbr_get(&cfg, NULL) < 0) {
if (ws_cfg_bbr_get(&cfg) < 0) {
return -1;
}

Expand All @@ -1213,7 +1213,7 @@ int ws_bbr_rpl_parameters_set(int8_t interface_id, uint8_t dio_interval_min, uin
cfg.dio_redundancy_constant = dio_redundancy_constant;
}

if (ws_cfg_bbr_set(cur, NULL, &cfg, 0) < 0) {
if (ws_cfg_bbr_set(cur, &cfg, 0) < 0) {
return -2;
}

Expand All @@ -1235,7 +1235,7 @@ int ws_bbr_rpl_parameters_get(int8_t interface_id, uint8_t *dio_interval_min, ui
}

ws_bbr_cfg_t cfg;
if (ws_cfg_bbr_get(&cfg, NULL) < 0) {
if (ws_cfg_bbr_get(&cfg) < 0) {
return -2;
}

Expand All @@ -1257,7 +1257,7 @@ int ws_bbr_rpl_parameters_validate(int8_t interface_id, uint8_t dio_interval_min
(void) interface_id;
#ifdef HAVE_WS_BORDER_ROUTER
ws_bbr_cfg_t cfg;
if (ws_cfg_bbr_get(&cfg, NULL) < 0) {
if (ws_cfg_bbr_get(&cfg) < 0) {
return -2;
}

Expand All @@ -1271,7 +1271,7 @@ int ws_bbr_rpl_parameters_validate(int8_t interface_id, uint8_t dio_interval_min
cfg.dio_redundancy_constant = dio_redundancy_constant;
}

if (ws_cfg_bbr_validate(NULL, &cfg) < 0) {
if (ws_cfg_bbr_validate(&cfg) < 0) {
return -3;
}

Expand Down Expand Up @@ -1318,13 +1318,13 @@ int ws_bbr_pan_configuration_set(int8_t interface_id, uint16_t pan_id)
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);

ws_gen_cfg_t cfg;
if (ws_cfg_gen_get(&cfg, NULL) < 0) {
if (ws_cfg_gen_get(&cfg) < 0) {
return -1;
}

cfg.network_pan_id = pan_id;

if (ws_cfg_gen_set(cur, NULL, &cfg, 0) < 0) {
if (ws_cfg_gen_set(cur, &cfg, 0) < 0) {
return -2;
}

Expand All @@ -1344,7 +1344,7 @@ int ws_bbr_pan_configuration_get(int8_t interface_id, uint16_t *pan_id)
}

ws_gen_cfg_t cfg;
if (ws_cfg_gen_get(&cfg, NULL) < 0) {
if (ws_cfg_gen_get(&cfg) < 0) {
return -2;
}

Expand All @@ -1362,13 +1362,13 @@ int ws_bbr_pan_configuration_validate(int8_t interface_id, uint16_t pan_id)
(void) interface_id;
#ifdef HAVE_WS_BORDER_ROUTER
ws_gen_cfg_t cfg;
if (ws_cfg_gen_get(&cfg, NULL) < 0) {
if (ws_cfg_gen_get(&cfg) < 0) {
return -1;
}

cfg.network_pan_id = pan_id;

if (ws_cfg_gen_validate(NULL, &cfg) < 0) {
if (ws_cfg_gen_validate(&cfg) < 0) {
return -2;
}

Expand Down
4 changes: 2 additions & 2 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@ static void ws_bootstrap_nw_info_updated(protocol_interface_info_entry_t *cur, u
if (cur->bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) {
// Get PAN ID and network name
ws_gen_cfg_t gen_cfg;
if (ws_cfg_gen_get(&gen_cfg, NULL) < 0) {
if (ws_cfg_gen_get(&gen_cfg) < 0) {
return;
}

Expand All @@ -3364,7 +3364,7 @@ static void ws_bootstrap_nw_info_updated(protocol_interface_info_entry_t *cur, u
}

// Stores the settings
ws_cfg_gen_set(cur, NULL, &gen_cfg, 0);
ws_cfg_gen_set(cur, &gen_cfg, 0);
}
}

Expand Down
Loading

0 comments on commit cad5122

Please sign in to comment.