Skip to content

Commit caf53d1

Browse files
author
Jarkko Paso
authored
Merge pull request ARMmbed#1846 from ARMmbed/IOTTHD-2824
MAC: set new MAC channel only if RF returns success
2 parents 9b5e1c9 + 4a204bd commit caf53d1

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
@@ -1512,8 +1512,9 @@ int8_t mac_mlme_rf_channel_change(protocol_interface_rf_mac_setup_s *rf_mac_setu
15121512
return 0;
15131513
}
15141514
platform_enter_critical();
1515-
rf_mac_setup->mac_channel = new_channel;
1516-
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL, &rf_mac_setup->mac_channel);
1515+
if (rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_CHANNEL, &new_channel) == 0) {
1516+
rf_mac_setup->mac_channel = new_channel;
1517+
}
15171518
platform_exit_critical();
15181519
return 0;
15191520
}

0 commit comments

Comments
 (0)