@@ -150,6 +150,16 @@ int8_t mac_plme_cca_req(protocol_interface_rf_mac_setup_s *rf_mac_setup)
150
150
phy_device_driver_s * dev_driver = rf_mac_setup -> dev_driver -> phy_driver ;
151
151
152
152
rf_mac_setup -> macRfRadioTxActive = true;
153
+
154
+ if (rf_mac_setup -> fhss_api ) {
155
+ mac_pre_build_frame_t * active_buf = rf_mac_setup -> active_pd_data_request ;
156
+ if (active_buf && (active_buf -> fcf_dsn .frametype == FC_BEACON_FRAME )) {
157
+ // FHSS synchronization info is written in the end of transmitted (Beacon) buffer
158
+ dev_driver_tx_buffer_s * tx_buf = & rf_mac_setup -> dev_driver_tx_buffer ;
159
+ uint8_t * synch_info = tx_buf -> buf + rf_mac_setup -> dev_driver -> phy_driver -> phy_header_length + tx_buf -> len - FHSS_SYNCH_INFO_LENGTH ;
160
+ rf_mac_setup -> fhss_api -> write_synch_info (rf_mac_setup -> fhss_api , synch_info , 0 , FHSS_SYNCH_FRAME , 0 );
161
+ }
162
+ }
153
163
if (dev_driver -> arm_net_virtual_tx_cb ) {
154
164
if (dev_driver -> tx (tx_buf -> buf , tx_buf -> len , 1 , PHY_LAYER_PAYLOAD ) == 0 ) {
155
165
timer_mac_start (rf_mac_setup , MAC_TX_TIMEOUT , NWKTX_TIMEOUT_PERIOD ); /*Start Timeout timer for virtual packet loss*/
@@ -400,13 +410,6 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r
400
410
return -1 ;
401
411
}
402
412
403
- if (active_buf -> fcf_dsn .frametype == FC_BEACON_FRAME ) {
404
- // FHSS synchronization info is written in the end of transmitted (Beacon) buffer
405
- dev_driver_tx_buffer_s * tx_buf = & rf_ptr -> dev_driver_tx_buffer ;
406
- uint8_t * synch_info = tx_buf -> buf + rf_ptr -> dev_driver -> phy_driver -> phy_header_length + tx_buf -> len - FHSS_SYNCH_INFO_LENGTH ;
407
- rf_ptr -> fhss_api -> write_synch_info (rf_ptr -> fhss_api , synch_info , 0 , FHSS_SYNCH_FRAME , 0 );
408
- }
409
-
410
413
// Change to destination channel and write synchronization info to Beacon frames here
411
414
int tx_handle_retval = rf_ptr -> fhss_api -> tx_handle (rf_ptr -> fhss_api , !mac_is_ack_request_set (active_buf ),
412
415
active_buf -> DstAddr , mac_convert_frame_type_to_fhss (active_buf -> fcf_dsn .frametype ),
0 commit comments