Skip to content

Commit 4a204bd

Browse files
author
Jarkko Paso
committed
MAC: set new MAC channel only if RF returns success
1 parent d9e2ea6 commit 4a204bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/MAC/IEEE802_15_4/mac_mlme.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,8 +1510,9 @@ int8_t mac_mlme_rf_channel_change(protocol_interface_rf_mac_setup_s *rf_mac_setu
15101510
return 0;
15111511
}
15121512
platform_enter_critical();
1513-
rf_mac_setup->mac_channel = new_channel;
1514-
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL, &rf_mac_setup->mac_channel);
1513+
if (rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL, &new_channel) == 0) {
1514+
rf_mac_setup->mac_channel = new_channel;
1515+
}
15151516
platform_exit_critical();
15161517
return 0;
15171518
}

0 commit comments

Comments
 (0)