Skip to content

Commit 7a8b2bf

Browse files
author
Mika
committed
Wi-SUN fhss API default value setting fixes
documented the default parameter functionality
1 parent 164a370 commit 7a8b2bf

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

nanostack/ws_management_api.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ int ws_management_channel_plan_set(
382382
*
383383
* Change the default configuration for Wi-SUN FHSS operation.
384384
*
385+
* Calling with fhss_uc_dwell_interval = 0, fhss_broadcast_interval = 0xffffffff,
386+
* fhss_bc_dwell_interval = 0 restores stack defaults
385387
*
386388
* \param interface_id Network interface ID.
387389
* \param fhss_uc_dwell_interval default to 250 ms.
@@ -403,6 +405,7 @@ int ws_management_fhss_timing_configure(
403405
* Change the default configuration for Wi-SUN FHSS operation.
404406
* if application defined is used the behaviour is undefined
405407
*
408+
* Calling with dwell_interval = 0, channel_function = 0xff, fixed_channel = 0xffff restores stack defaults
406409
*
407410
* \param interface_id Network interface ID.
408411
* \param channel_function Unicast channel function.
@@ -458,6 +461,8 @@ int ws_management_fhss_unicast_channel_function_validate(
458461
* Change the default configuration for Wi-SUN FHSS operation.
459462
* if application defined is used the behaviour is undefined
460463
*
464+
* Calling with dwell_interval = 0, channel_function = 0xff,
465+
* broadcast_interval = 0xffffffff, fixed_channel = 0xffff restores stack defaults
461466
*
462467
* \param interface_id Network interface ID.
463468
* \param channel_function Broadcast channel function.

source/6LoWPAN/ws/ws_cfg_settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ int8_t ws_cfg_fhss_validate(ws_fhss_cfg_t *cfg, ws_fhss_cfg_t *new_cfg)
942942
return CFG_SETTINGS_ERROR_FHSS_CONF;
943943
}
944944

945-
if (new_cfg->fhss_bc_dwell_interval < 15) {
945+
if (new_cfg->fhss_bc_dwell_interval < 100) {
946946
return CFG_SETTINGS_ERROR_FHSS_CONF;
947947
}
948948

source/6LoWPAN/ws/ws_management_api.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ int ws_management_fhss_timing_configure(
461461
return -2;
462462
}
463463

464-
if (fhss_uc_dwell_interval == 0xff) {
464+
if (fhss_uc_dwell_interval == 0) {
465465
cfg.fhss_uc_dwell_interval = cfg_default.fhss_uc_dwell_interval;
466-
} else if (fhss_uc_dwell_interval > 0) {
466+
} else {
467467
cfg.fhss_uc_dwell_interval = fhss_uc_dwell_interval;
468468
}
469469

@@ -473,9 +473,9 @@ int ws_management_fhss_timing_configure(
473473
cfg.fhss_bc_interval = fhss_broadcast_interval;
474474
}
475475

476-
if (fhss_bc_dwell_interval == 0xff) {
476+
if (fhss_bc_dwell_interval == 0) {
477477
cfg.fhss_bc_dwell_interval = cfg_default.fhss_bc_dwell_interval;
478-
} else if (fhss_bc_dwell_interval > 0) {
478+
} else {
479479
cfg.fhss_bc_dwell_interval = fhss_bc_dwell_interval;
480480
}
481481

@@ -509,9 +509,9 @@ int ws_management_fhss_unicast_channel_function_configure(
509509
return -2;
510510
}
511511

512-
if (dwell_interval == 0xff) {
512+
if (dwell_interval == 0) {
513513
cfg.fhss_uc_dwell_interval = cfg_default.fhss_uc_dwell_interval;
514-
} else if (dwell_interval > 0) {
514+
} else {
515515
cfg.fhss_uc_dwell_interval = dwell_interval;
516516
}
517517
if (channel_function < 0xff) {
@@ -611,9 +611,9 @@ int ws_management_fhss_broadcast_channel_function_configure(
611611
return -2;
612612
}
613613

614-
if (dwell_interval == 0xff) {
614+
if (dwell_interval == 0) {
615615
cfg.fhss_bc_dwell_interval = cfg_default.fhss_bc_dwell_interval;
616-
} else if (dwell_interval > 0) {
616+
} else {
617617
cfg.fhss_bc_dwell_interval = dwell_interval;
618618
}
619619

0 commit comments

Comments
 (0)