File tree Expand file tree Collapse file tree 3 files changed +30
-4
lines changed
test/nanostack/unittest/6LoWPAN/ws_management_api Expand file tree Collapse file tree 3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -246,9 +246,10 @@ int ws_management_fhss_timing_configure(
246
246
* Change the default configuration for Wi-SUN FHSS operation.
247
247
* if application defined is used the behaviour is undefined
248
248
*
249
+ *
249
250
* \param interface_id Network interface ID.
250
251
* \param channel_function Unicast channel function.
251
- * \param fixed_channel Used channel when channel function is fixed channel. If 0xFFFF, randomly chosen channel is used.
252
+ * \param fixed_channel Used channel when channel function is fixed channel.
252
253
* \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
253
254
*
254
255
* \return 0, Init OK.
@@ -266,9 +267,10 @@ int ws_management_fhss_unicast_channel_function_configure(
266
267
* Change the default configuration for Wi-SUN FHSS operation.
267
268
* if application defined is used the behaviour is undefined
268
269
*
270
+ *
269
271
* \param interface_id Network interface ID.
270
272
* \param channel_function Broadcast channel function.
271
- * \param fixed_channel Used channel when channel function is fixed channel. If 0xFFFF, randomly chosen channel is used.
273
+ * \param fixed_channel Used channel when channel function is fixed channel.
272
274
* \param dwell_interval Broadcast channel dwell interval.
273
275
* \param broadcast_interval Broadcast interval.
274
276
*
Original file line number Diff line number Diff line change @@ -241,8 +241,20 @@ int ws_management_fhss_unicast_channel_function_configure(
241
241
channel_function != WS_TR51CF ) {
242
242
return -2 ;
243
243
}
244
+
245
+ if (channel_function == WS_FIXED_CHANNEL && fixed_channel == 0xffff ) {
246
+ fixed_channel = 0 ;
247
+ tr_warn ("Fixed channel not configured. Set to 0" );
248
+ }
249
+
250
+
244
251
cur -> ws_info -> fhss_uc_channel_function = channel_function ;
245
- cur -> ws_info -> fhss_uc_fixed_channel = fixed_channel ;
252
+ if (cur -> ws_info -> fhss_uc_channel_function == WS_FIXED_CHANNEL ) {
253
+ cur -> ws_info -> fhss_uc_fixed_channel = fixed_channel ;
254
+ } else {
255
+ cur -> ws_info -> fhss_uc_fixed_channel = 0xffff ;
256
+ }
257
+
246
258
cur -> ws_info -> fhss_uc_dwell_interval = dwell_interval ;
247
259
248
260
// if settings change reset_restart for the settings needed
@@ -273,8 +285,19 @@ int ws_management_fhss_broadcast_channel_function_configure(
273
285
channel_function != WS_TR51CF ) {
274
286
return -2 ;
275
287
}
288
+
289
+ if (channel_function == WS_FIXED_CHANNEL && fixed_channel == 0xffff ) {
290
+ fixed_channel = 0 ;
291
+ tr_warn ("Fixed channel not configured. Set to 0" );
292
+ }
293
+
276
294
cur -> ws_info -> fhss_bc_channel_function = channel_function ;
277
- cur -> ws_info -> fhss_bc_fixed_channel = fixed_channel ;
295
+ if (cur -> ws_info -> fhss_bc_channel_function == WS_FIXED_CHANNEL ) {
296
+ cur -> ws_info -> fhss_bc_fixed_channel = fixed_channel ;
297
+ } else {
298
+ cur -> ws_info -> fhss_bc_fixed_channel = 0xffff ;
299
+ }
300
+
278
301
cur -> ws_info -> fhss_bc_dwell_interval = dwell_interval ;
279
302
cur -> ws_info -> fhss_bc_interval = broadcast_interval ;
280
303
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ TEST_SRC_FILES = \
11
11
ws_management_api_test.cpp \
12
12
test_ws_management_api.c \
13
13
../../stub/protocol_core_stub.c \
14
+ ../../stub/mbed_trace_stub.c \
14
15
../../stub/ws_common_stub.c \
15
16
../../stub/ws_bootstrap_stub.c \
16
17
You can’t perform that action at this time.
0 commit comments