Skip to content

Commit

Permalink
Merge pull request ARMmbed#1846 from ARMmbed/IOTTHD-2824
Browse files Browse the repository at this point in the history
MAC: set new MAC channel only if RF returns success
  • Loading branch information
Jarkko Paso authored Oct 9, 2018
2 parents 9b5e1c9 + 4a204bd commit caf53d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/MAC/IEEE802_15_4/mac_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,8 +1512,9 @@ int8_t mac_mlme_rf_channel_change(protocol_interface_rf_mac_setup_s *rf_mac_setu
return 0;
}
platform_enter_critical();
rf_mac_setup->mac_channel = new_channel;
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL, &rf_mac_setup->mac_channel);
if (rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL, &new_channel) == 0) {
rf_mac_setup->mac_channel = new_channel;
}
platform_exit_critical();
return 0;
}
Expand Down

0 comments on commit caf53d1

Please sign in to comment.