Skip to content

Commit 5752eae

Browse files
author
Jarkko Paso
authored
Created validate TX time handler (ARMmbed#2423)
1 parent 022d61f commit 5752eae

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

source/MAC/IEEE802_15_4/mac_pd_sap.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,7 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r
456456
if (rf_ptr->mac_ack_tx_active) {
457457
//Accept direct non crypted acks and crypted only if neighbor is at list
458458
if (rf_ptr->ack_tx_possible) {
459-
#ifdef TIMING_TOOL_TRACES
460-
tr_info("%u TX_start %u", mac_mcps_sap_get_phy_timestamp(rf_ptr), rf_ptr->mac_channel);
461-
#endif
462-
return PHY_TX_ALLOWED;
459+
goto VALIDATE_TX_TIME;
463460
}
464461

465462
//Compare time to started time
@@ -471,19 +468,16 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r
471468
}
472469

473470
if (rf_ptr->mac_edfe_tx_active) {
474-
return PHY_TX_ALLOWED;
471+
goto VALIDATE_TX_TIME;
475472
}
476473

477474
if (mac_data_asynch_channel_switch(rf_ptr, rf_ptr->active_pd_data_request)) {
478-
#ifdef TIMING_TOOL_TRACES
479-
tr_info("%u TX_start %u", mac_mcps_sap_get_phy_timestamp(rf_ptr), rf_ptr->mac_channel);
480-
#endif
481475
rf_ptr->active_pd_data_request->initial_tx_channel = rf_ptr->mac_channel;
482476
int8_t channel_cca_threshold = mac_cca_thr_get_dbm(rf_ptr, rf_ptr->mac_channel);
483477
if (CCA_FAILED_DBM != channel_cca_threshold) {
484478
rf_ptr->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL_CCA_THRESHOLD, (uint8_t *)&channel_cca_threshold);
485479
}
486-
return PHY_TX_ALLOWED;
480+
goto VALIDATE_TX_TIME;
487481
}
488482

489483
if (rf_ptr->fhss_api) {
@@ -525,10 +519,12 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r
525519
return PHY_RESTART_CSMA;
526520
}
527521
}
522+
VALIDATE_TX_TIME:
523+
// TODO: Validate TX time here
528524
#ifdef TIMING_TOOL_TRACES
529525
tr_info("%u TX_start %u", mac_mcps_sap_get_phy_timestamp(rf_ptr), rf_ptr->mac_channel);
530526
#endif
531-
return 0;
527+
return PHY_TX_ALLOWED;
532528
}
533529

534530
if (rf_ptr->mac_ack_tx_active) {

0 commit comments

Comments
 (0)