@@ -159,6 +159,8 @@ static fhss_api_t *test_generate_fhss_api(void)
159159 fhss_common_stub .fhss_struct .fhss_state = FHSS_UNSYNCHRONIZED ;
160160 fhss_common_stub .fhss_struct .own_hop = 0xff ;
161161 fhss_common_stub .fhss_struct .ws -> is_on_bc_channel = false;
162+ fhss_common_stub .fhss_struct .ws -> tx_level = WS_TX_SLOT ;
163+ fhss_common_stub .fhss_struct .ws -> ef_tx_level = WS_TX_ALWAYS ;
162164 fhss_common_stub .fhss_struct .callbacks .change_channel = & mac_set_channel ;
163165 fhss_common_stub .fhss_struct .callbacks .read_mac_address = & mac_read_64bit_mac_address ;
164166 fhss_common_stub .fhss_struct .callbacks .read_tx_queue_size = & mac_read_tx_queue_sizes ;
@@ -354,6 +356,7 @@ bool test_fhss_ws_tx_handle_callback()
354356 }
355357 // Test TX allowed on RX slot for 1st hop in expedited forwarding mode
356358 fhss_common_stub .fhss_struct .ws -> is_on_bc_channel = false;
359+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_AND_RX_SLOT );
357360 fhss_common_stub .fhss_struct .own_hop = 1 ;
358361 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
359362 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_broadcast_interval = 1020 ;
@@ -378,6 +381,7 @@ bool test_fhss_ws_tx_handle_callback()
378381 }
379382 // Test TX allowed on broadcast channel for 1st hop in expedited forwarding mode
380383 fhss_common_stub .fhss_struct .ws -> is_on_bc_channel = true;
384+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_ALWAYS );
381385 fhss_common_stub .fhss_struct .own_hop = 1 ;
382386 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
383387 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_broadcast_interval = 1020 ;
@@ -390,6 +394,7 @@ bool test_fhss_ws_tx_handle_callback()
390394 }
391395 // Test TX not allowed on broadcast channel for 2nd hop in expedited forwarding mode
392396 fhss_common_stub .fhss_struct .ws -> is_on_bc_channel = true;
397+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_SLOT );
393398 fhss_common_stub .fhss_struct .own_hop = 2 ;
394399 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
395400 if (fhss_common_stub .fhss_struct .fhss_api -> tx_handle (api , DEFAULT_IS_BC_DEST , dest_address , DEFAULT_FRAME_TYPE , DEFAULT_FRAME_LENGTH , DEFAULT_PHY_HEAD_LENGTH , DEFAULT_PHY_TAIL_LENGTH , DEFAULT_TX_TIME ) != -3 ) {
@@ -487,6 +492,7 @@ bool test_fhss_ws_check_tx_conditions_callback()
487492 }
488493 // Test TX allowed on RX slot for 1st hop in expedited forwarding mode
489494 fhss_common_stub .fhss_struct .own_hop = 1 ;
495+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_AND_RX_SLOT );
490496 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
491497 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_broadcast_interval = 1020 ;
492498 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_bc_dwell_interval = 255 ;
@@ -504,6 +510,7 @@ bool test_fhss_ws_check_tx_conditions_callback()
504510 }
505511 // Test TX not allowed on RX slot for 2nd hop in expedited forwarding mode
506512 fhss_common_stub .fhss_struct .own_hop = 2 ;
513+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_SLOT );
507514 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
508515 fhss_platform_stub .remaining_slots_value = 700000 ;
509516 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 ) != false) {
@@ -526,6 +533,7 @@ bool test_fhss_ws_check_tx_conditions_callback()
526533 }
527534 // Test TX allowed on broadcast channel for 1st hop in expedited forwarding mode
528535 fhss_common_stub .fhss_struct .own_hop = 1 ;
536+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_ALWAYS );
529537 fhss_common_stub .fhss_struct .ws -> is_on_bc_channel = true;
530538 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
531539 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_broadcast_interval = 1020 ;
@@ -538,12 +546,14 @@ bool test_fhss_ws_check_tx_conditions_callback()
538546 }
539547 // Test TX not allowed on broadcast channel for 2nd hop in expedited forwarding mode
540548 fhss_common_stub .fhss_struct .own_hop = 2 ;
549+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_SLOT );
541550 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 ) != false) {
542551 printf ("Fail: TX conditions, 2nd hop, EF enabled on BC\r\n" );
543552 return false;
544553 }
545554 // Test TX not allowed on broadcast channel for 1st hop when expedited forwarding mode disabled
546555 fhss_common_stub .fhss_struct .own_hop = 1 ;
556+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_ALWAYS );
547557 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 0 ;
548558 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 ) != false) {
549559 printf ("Fail: TX conditions, 1st hop, EF disabled on BC\r\n" );
@@ -940,6 +950,7 @@ bool test_fhss_ws_get_retry_period_callback()
940950 }
941951 // Test retrying allowed on RX slot for 1st hop in expedited forwarding mode
942952 fhss_common_stub .fhss_struct .own_hop = 1 ;
953+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_ALWAYS );
943954 fhss_common_stub .fhss_struct .ws -> expedited_forwarding_enabled_us = 1000000 ;
944955 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_broadcast_interval = 1020 ;
945956 fhss_common_stub .fhss_struct .ws -> fhss_configuration .fhss_bc_dwell_interval = 255 ;
@@ -955,6 +966,7 @@ bool test_fhss_ws_get_retry_period_callback()
955966 }
956967 // Test retrying not allowed on RX slot for 2nd hop in expedited forwarding mode
957968 fhss_common_stub .fhss_struct .own_hop = 2 ;
969+ fhss_ws_set_tx_allowance_level (& fhss_common_stub .fhss_struct , WS_TX_SLOT , WS_TX_SLOT );
958970 fhss_platform_stub .remaining_slots_value = 700000 ;
959971 retry_period = fhss_common_stub .fhss_struct .fhss_api -> get_retry_period (api , NULL , 0 );
960972 if (retry_period != 70000 ) {
0 commit comments