Skip to content

Commit

Permalink
MAC: set new MAC channel only if RF returns success
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Oct 2, 2018
1 parent d9e2ea6 commit 4a204bd
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 @@ -1510,8 +1510,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 4a204bd

Please sign in to comment.