Changing lorawan region while running

Currently I can change the LoRaWAN region by setting lora.phy here
I am planning to use mbedOS with the Seeed LoRa E5 module for a high altitude balloon project. The nature of the project means that it will travel through different regions and will therefore need to transmit on different frequencies depending on the location.
Is it possible to change the phy while the program is running?
I was planning to request an acknowledgement and, if no response it received, change to a different frequency and try again until all frequencies have been tried.

Thanks in advance,
Adam