@@ -291,6 +291,21 @@ bool test_fhss_ws_check_tx_conditions_callback()
291
291
if (fhss_common_stub .fhss_struct .fhss_api -> check_tx_conditions (api , DEFAULT_IS_BC_DEST , DEFAULT_HANDLE , DEFAULT_FRAME_TYPE , DEFAULT_FRAME_LENGTH , DEFAULT_PHY_HEAD_LENGTH , DEFAULT_PHY_TAIL_LENGTH ) != true) {
292
292
return false;
293
293
}
294
+ // Test on fixed channel
295
+ enable_fhss_struct ();
296
+ if (fhss_common_stub .fhss_struct .fhss_api -> check_tx_conditions (api , DEFAULT_IS_BC_DEST , DEFAULT_HANDLE , DEFAULT_FRAME_TYPE , DEFAULT_FRAME_LENGTH , DEFAULT_PHY_HEAD_LENGTH , DEFAULT_PHY_TAIL_LENGTH ) != true) {
297
+ return false;
298
+ }
299
+ // Test broadcast destination on unicast channel
300
+ fhss_common_stub .fhss_struct .ws -> fhss_configuration .ws_channel_function = WS_TR51CF ;
301
+ if (fhss_common_stub .fhss_struct .fhss_api -> check_tx_conditions (api , true, DEFAULT_HANDLE , DEFAULT_FRAME_TYPE , DEFAULT_FRAME_LENGTH , DEFAULT_PHY_HEAD_LENGTH , DEFAULT_PHY_TAIL_LENGTH ) != false) {
302
+ return false;
303
+ }
304
+ // Test broadcast destination on broadcast channel
305
+ fhss_common_stub .fhss_struct .ws -> is_on_bc_channel = true;
306
+ if (fhss_common_stub .fhss_struct .fhss_api -> check_tx_conditions (api , true, DEFAULT_HANDLE , DEFAULT_FRAME_TYPE , DEFAULT_FRAME_LENGTH , DEFAULT_PHY_HEAD_LENGTH , DEFAULT_PHY_TAIL_LENGTH ) != true) {
307
+ return false;
308
+ }
294
309
295
310
return true;
296
311
}
@@ -315,6 +330,8 @@ bool test_fhss_ws_data_tx_done_callback()
315
330
fhss_common_stub .fhss_struct .fhss_api -> data_tx_done (api , DEFAULT_WAITING_ACK , DEFAULT_TX_COMPLETED , DEFAULT_HANDLE );
316
331
// Test when FHSS struct can be found
317
332
enable_fhss_struct ();
333
+ fhss_common_stub .fhss_struct .fhss_state = FHSS_SYNCHRONIZED ;
334
+ fhss_common_stub .fhss_struct .ws -> fhss_configuration .ws_channel_function = WS_TR51CF ;
318
335
fhss_common_stub .fhss_struct .fhss_api -> data_tx_done (api , DEFAULT_WAITING_ACK , DEFAULT_TX_COMPLETED , DEFAULT_HANDLE );
319
336
320
337
return true;
@@ -525,15 +542,20 @@ bool test_fhss_ws_set_parent()
525
542
broadcast_timing_info_t bc_timing_info ;
526
543
memset (& bc_timing_info , 0 , sizeof (broadcast_timing_info_t ));
527
544
fhss_api_t * api = test_generate_fhss_api ();
528
- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_TR51CF ;
545
+
529
546
530
547
// Test without WS enabled FHSS
531
548
fhss_structure_t fake_fhss_structure ;
532
549
memset (& fake_fhss_structure , 0 , sizeof (fhss_structure_t ));
533
550
if (-1 != fhss_ws_set_parent (& fake_fhss_structure , dest_address , & bc_timing_info )) {
534
551
return false;
535
552
}
553
+ // Test on fixed channel
554
+ if (0 != fhss_ws_set_parent (& fhss_common_stub .fhss_struct , dest_address , & bc_timing_info )) {
555
+ return false;
556
+ }
536
557
// Test success
558
+ fhss_common_stub .fhss_struct .ws -> fhss_configuration .ws_channel_function = WS_TR51CF ;
537
559
bc_timing_info .broadcast_channel_function = WS_TR51CF ;
538
560
bc_timing_info .broadcast_dwell_interval = 250 ;
539
561
bc_timing_info .broadcast_interval = 1000 ;
0 commit comments