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: libmDot-Custom MTS-Serial
Fork of mDot_AT_firmware_CUSTOM by
To change channel plans replace AS923 with AU915, EU868, KR920 or US915 on line 15
#define CHANNEL_PLAN CP_AS923
Diff: CommandTerminal/CmdTxChannel.cpp
- Revision:
- 15:36db31c18231
- Parent:
- 14:e80ace5a6834
--- a/CommandTerminal/CmdTxChannel.cpp	Mon Aug 29 10:05:41 2016 -0500
+++ b/CommandTerminal/CmdTxChannel.cpp	Wed Aug 31 11:57:27 2016 -0500
@@ -14,7 +14,7 @@
 
         CommandTerminal::Serial()->writef("Index\tFrequency  DR Max Min  On\r\n");
 
-        if (CommandTerminal::Dot()->getFrequencyBand() == mDot::FB_EU868) {
+        if (CommandTerminal::Dot()->getFrequencyBand() == mDot::DYNAMIC) {
             for (int8_t i = 0; i < 16; i++) {
                 if (channels[i] != 0)
                     CommandTerminal::Serial()->writef("  %d\t%d      %X   %X    %d\r\n", i, channels[i], ranges[i] >> 4, ranges[i] & 0xF, (mask[0] & (0x1 << i)) ? 1 : 0);
@@ -80,18 +80,15 @@
         sscanf(args[2].c_str(), "%d", &frequency);
         sscanf(args[3].c_str(), "%02x", &datarateRange);
 
-        if (CommandTerminal::Dot()->getFrequencyBand() == mDot::FB_EU868) {
-            if (index < 3 || index > 15) {
-                CommandTerminal::setErrorMessage("Invalid index, expects (3-15)");
-                return false;
-            }
-
-            if (frequency != 0 && (frequency < 863000000 || frequency > 870000000)) {
-                CommandTerminal::setErrorMessage("Invalid frequency, expects (863000000-870000000)");
+        if (CommandTerminal::Dot()->getFrequencyBand() == mDot::DYNAMIC) {
+            if (frequency != 0 && (frequency < int(CommandTerminal::Dot()->getMinFrequency()) || frequency > int(CommandTerminal::Dot()->getMaxFrequency()))) {
+                char tmp[256];
+                sprintf(tmp, "Invalid frequency, expects (0,%lu-%lu)", CommandTerminal::Dot()->getMinFrequency(), CommandTerminal::Dot()->getMaxFrequency());
+                CommandTerminal::setErrorMessage(tmp);
                 return false;
             }
         } else {
-            CommandTerminal::setErrorMessage("US915|AU915 Channels cannot be changed, use AT+FSB or AT+CHM to limit");
+            CommandTerminal::setErrorMessage("Fixed channel plans cannot be changed, use AT+FSB or AT+CHM to limit");
             return false;
         }
 
    