few changes for RTS/CTS control
Dependencies: MTS-Serial libmDot mbed-rtos mbed
Fork of mDot_AT_firmware by
CommandTerminal/CmdTxChannel.cpp@1:e52ae6584f1c, 2015-06-25 (annotated)
- Committer:
- Mike Fiore
- Date:
- Thu Jun 25 10:23:41 2015 -0500
- Revision:
- 1:e52ae6584f1c
- Child:
- 9:ff62b20f7000
update debug, add command source files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mike Fiore |
1:e52ae6584f1c | 1 | #include "CmdTxChannel.h" |
Mike Fiore |
1:e52ae6584f1c | 2 | |
Mike Fiore |
1:e52ae6584f1c | 3 | CmdTxChannel::CmdTxChannel(mDot* dot, mts::MTSSerial& serial) |
Mike Fiore |
1:e52ae6584f1c | 4 | : |
Mike Fiore |
1:e52ae6584f1c | 5 | Command(dot, "Tx Channels", "AT+TXCH", "List Tx channel frequencies for sub-band"), |
Mike Fiore |
1:e52ae6584f1c | 6 | _serial(serial) { |
Mike Fiore |
1:e52ae6584f1c | 7 | _help = std::string(text()) + ": " + std::string(desc()); |
Mike Fiore |
1:e52ae6584f1c | 8 | _usage = "TABLE"; |
Mike Fiore |
1:e52ae6584f1c | 9 | _queryable = true; |
Mike Fiore |
1:e52ae6584f1c | 10 | } |
Mike Fiore |
1:e52ae6584f1c | 11 | |
Mike Fiore |
1:e52ae6584f1c | 12 | uint32_t CmdTxChannel::action(std::vector<std::string> args) { |
Mike Fiore |
1:e52ae6584f1c | 13 | if (args.size() == 1) { |
Mike Fiore |
1:e52ae6584f1c | 14 | std::vector<uint32_t> channels = _dot->getChannels(); |
Mike Fiore |
1:e52ae6584f1c | 15 | |
Mike Fiore |
1:e52ae6584f1c | 16 | for (int i = 0; i < 8; i++) { |
Mike Fiore |
1:e52ae6584f1c | 17 | _serial.writef("%d: %d 125k\r\n", i, channels[i]); |
Mike Fiore |
1:e52ae6584f1c | 18 | } |
Mike Fiore |
1:e52ae6584f1c | 19 | |
Mike Fiore |
1:e52ae6584f1c | 20 | if (_dot->getFrequencyBand() == mDot::FB_868) { |
Mike Fiore |
1:e52ae6584f1c | 21 | _serial.writef("D: %d 125k\r\n", channels[8]); |
Mike Fiore |
1:e52ae6584f1c | 22 | } else { |
Mike Fiore |
1:e52ae6584f1c | 23 | if (_dot->getVerbose()) |
Mike Fiore |
1:e52ae6584f1c | 24 | _serial.writef("Tx Channels: \r\n"); |
Mike Fiore |
1:e52ae6584f1c | 25 | |
Mike Fiore |
1:e52ae6584f1c | 26 | _serial.writef("U: %d 500k\r\n", channels[8]); |
Mike Fiore |
1:e52ae6584f1c | 27 | _serial.writef("D: %d 500k\r\n", channels[9]); |
Mike Fiore |
1:e52ae6584f1c | 28 | } |
Mike Fiore |
1:e52ae6584f1c | 29 | } |
Mike Fiore |
1:e52ae6584f1c | 30 | |
Mike Fiore |
1:e52ae6584f1c | 31 | return 0; |
Mike Fiore |
1:e52ae6584f1c | 32 | } |
Mike Fiore |
1:e52ae6584f1c | 33 |