diff options
author | Mike Fiore <mfiore@multitech.com> | 2016-01-08 11:06:23 -0600 |
---|---|---|
committer | Mike Fiore <mfiore@multitech.com> | 2016-01-08 11:06:23 -0600 |
commit | 53c06d0e002016e3a8dd72e325ba902f2eecaf2a (patch) | |
tree | d827df98f3961c71f66b857119dc4c948de1cfe3 | |
parent | 52bc86ff4e20e155cfa2411225b3f8c81c769cd1 (diff) | |
download | mtdot-box-evb-factory-firmware-53c06d0e002016e3a8dd72e325ba902f2eecaf2a.tar.gz mtdot-box-evb-factory-firmware-53c06d0e002016e3a8dd72e325ba902f2eecaf2a.tar.bz2 mtdot-box-evb-factory-firmware-53c06d0e002016e3a8dd72e325ba902f2eecaf2a.zip |
display frequency band and sub band correctly even if they change in configuration
-rw-r--r-- | Mode/ModeJoin.cpp | 4 | ||||
-rw-r--r-- | main.cpp | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/Mode/ModeJoin.cpp b/Mode/ModeJoin.cpp index 681147b..3dc3c07 100644 --- a/Mode/ModeJoin.cpp +++ b/Mode/ModeJoin.cpp @@ -96,8 +96,10 @@ void ModeJoin::display() { _join.updateId(_dot->getNetworkName()); _join.updateKey(_dot->getNetworkPassphrase()); } - if (_band == mDot::FB_915) + if (_band == mDot::FB_915) { + _sub_band = _dot->getFrequencySubBand(); _join.updateFsb(_sub_band); + } // mDot::DataRateStr returns format SF_XX - we only want to display the XX part _join.updateRate(_dot->DataRateStr(_data_rate).substr(3)); _join.updatePower(_power); @@ -112,19 +112,16 @@ int main() { void mainMenu() { bool mode_selected = false; std::string selected; - std::string product = "MTDOT-BOX/EVB "; + std::string product; - product += mDot::FrequencyBandStr(dot->getFrequencyBand()).substr(3); - typedef enum { - demo = 2, + demo = 1, config, single, sweep } menu_items; std::string menu_strings[] = { - product, "Select Mode", "LoRa Demo", "Configuration", @@ -139,10 +136,13 @@ void mainMenu() { items.push_back(menu_strings[sweep]); while (true) { + product = "MTDOT-BOX/EVB "; + product += mDot::FrequencyBandStr(dot->getFrequencyBand()).substr(3); + // reset session between modes dot->resetNetworkSession(); lora->resetActivityLed(); - LayoutScrollSelect menu(lcd, items, menu_strings[0], menu_strings[1]); + LayoutScrollSelect menu(lcd, items, product, menu_strings[0]); menu.display(); while (! mode_selected) { |