@@ -208,24 +208,25 @@ bool test_fhss_ws_tx_handle_callback()
208208 return false;
209209 }
210210 // Test when no neighbor info found
211- fhss_common_stub .fhss_struct .ws -> fhss_configuration .ws_channel_function = WS_TR51CF ;
211+ neighbor_info .uc_timing_info .unicast_channel_function = WS_TR51CF ;
212+ neighbor_info .uc_timing_info .unicast_number_of_channels = fhss_common_stub .fhss_struct .number_of_channels ;
212213 fhss_common_stub .fhss_struct .fhss_state = DEFAULT_FHSS_STATE ;
213214 fhss_common_stub .fhss_struct .ws -> fhss_configuration .get_neighbor_info = & app_no_neighbor_info ;
214- 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 ) != -1 ) {
215+ 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 ) != -2 ) {
215216 return false;
216217 }
217218 // Test fixed channel
218219 fhss_common_stub .fhss_struct .ws -> fhss_configuration .get_neighbor_info = & app_get_neighbor_info ;
219- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_FIXED_CHANNEL ;
220- 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 ) != -2 ) {
220+ neighbor_info . uc_timing_info . unicast_channel_function = WS_FIXED_CHANNEL ;
221+ 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 ) != 0 ) {
221222 return false;
222223 }
223224 /* Test TR51 channel function
224225 * Dest. slot: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
225226 * |dest. ufsi| 900ms |
226227 * timestamps: 100000us| 1000000us|
227228 */
228- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_TR51CF ;
229+ neighbor_info . uc_timing_info . unicast_channel_function = WS_TR51CF ;
229230 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 ) != 0 )
230231 || (channel_functions_stub .uint8_value != 7 )) {
231232 return false;
@@ -236,7 +237,7 @@ bool test_fhss_ws_tx_handle_callback()
236237 * timestamps: 4294867000us| 900000us|
237238 */
238239 neighbor_info .uc_timing_info .utt_rx_timestamp = 4294867000 ;
239- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_TR51CF ;
240+ neighbor_info . uc_timing_info . unicast_channel_function = WS_TR51CF ;
240241 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 , 900000 ) != 0 )
241242 || (channel_functions_stub .uint8_value != 7 )) {
242243 return false;
@@ -248,20 +249,20 @@ bool test_fhss_ws_tx_handle_callback()
248249 */
249250 neighbor_info .uc_timing_info .utt_rx_timestamp = 100000 ;
250251 uint32_t tx_time = neighbor_info .uc_timing_info .utt_rx_timestamp + (fhss_common_stub .fhss_struct .number_of_channels * neighbor_info .uc_timing_info .unicast_dwell_interval * 1000 );
251- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_TR51CF ;
252+ neighbor_info . uc_timing_info . unicast_channel_function = WS_TR51CF ;
252253 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 , tx_time ) != 0 )
253254 || (channel_functions_stub .uint8_value != 2 )) {
254255 return false;
255256 }
256257 // For more coverage, set neighbor info NULL
257258 memset (& neighbor_info , 0 , sizeof (fhss_ws_neighbor_timing_info_t ));
258259 // Test direct hash channel function
259- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_DH1CF ;
260+ neighbor_info . uc_timing_info . unicast_channel_function = WS_DH1CF ;
260261 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 ) != 0 ) {
261262 return false;
262263 }
263264 // Test vendor defined channel function without application callback
264- fhss_common_stub . fhss_struct . ws -> fhss_configuration . ws_channel_function = WS_VENDOR_DEF_CF ;
265+ neighbor_info . uc_timing_info . unicast_channel_function = WS_VENDOR_DEF_CF ;
265266 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 ) != -1 ) {
266267 return false;
267268 }
0 commit comments