Skip to content

Commit

Permalink
Merge pull request ARMmbed#1801 from ARMmbed/rf_driver_start_fix
Browse files Browse the repository at this point in the history
Add MAC TX active FLAG to active before write function return value.
  • Loading branch information
Juha Heiskanen authored Aug 29, 2018
2 parents 08d3e12 + c2bc561 commit f27a29c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/MAC/IEEE802_15_4/mac_pd_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,21 @@ int8_t mac_plme_cca_req(protocol_interface_rf_mac_setup_s *rf_mac_setup) {
dev_driver_tx_buffer_s *tx_buf = &rf_mac_setup->dev_driver_tx_buffer;
phy_device_driver_s *dev_driver = rf_mac_setup->dev_driver->phy_driver;


rf_mac_setup->macRfRadioTxActive = true;
if (dev_driver->arm_net_virtual_tx_cb) {
if (dev_driver->tx(tx_buf->buf, tx_buf->len, 1, PHY_LAYER_PAYLOAD) == 0) {
rf_mac_setup->macRfRadioTxActive = true;
timer_mac_start(rf_mac_setup, MAC_TX_TIMEOUT, NWKTX_TIMEOUT_PERIOD); /*Start Timeout timer for virtual packet loss*/
} else {
rf_mac_setup->macRfRadioTxActive = false;
mac_data_interface_tx_to_cb(rf_mac_setup);
}
return 0;
}

if (dev_driver->tx(tx_buf->buf, tx_buf->len, 1, PHY_LAYER_PAYLOAD) == 0) {
rf_mac_setup->macRfRadioTxActive = true;
return 0;
}
rf_mac_setup->macRfRadioTxActive = false;
return -1;
}

Expand Down

0 comments on commit f27a29c

Please sign in to comment.