Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
CommandTerminal/CmdTxChannel.cpp
- Committer:
 - Mike Fiore 
 - Date:
 - 2015-06-25
 - Revision:
 - 1:e52ae6584f1c
 - Child:
 - 9:ff62b20f7000
 
File content as of revision 1:e52ae6584f1c:
#include "CmdTxChannel.h"
CmdTxChannel::CmdTxChannel(mDot* dot, mts::MTSSerial& serial)
:
  Command(dot, "Tx Channels", "AT+TXCH", "List Tx channel frequencies for sub-band"),
  _serial(serial) {
    _help = std::string(text()) + ": " + std::string(desc());
    _usage = "TABLE";
    _queryable = true;
}
uint32_t CmdTxChannel::action(std::vector<std::string> args) {
    if (args.size() == 1) {
        std::vector<uint32_t> channels = _dot->getChannels();
        for (int i = 0; i < 8; i++) {
            _serial.writef("%d: %d 125k\r\n", i, channels[i]);
        }
        if (_dot->getFrequencyBand() == mDot::FB_868) {
            _serial.writef("D: %d 125k\r\n", channels[8]);
        } else {
            if (_dot->getVerbose())
                _serial.writef("Tx Channels: \r\n");
            _serial.writef("U: %d 500k\r\n", channels[8]);
            _serial.writef("D: %d 500k\r\n", channels[9]);
        }
    }
    return 0;
}
            
    