mDot AT-Firmware for testing

Dependencies:   MTS-Serial libmDot-mbed5

Fork of Dot-AT-Firmware by MultiTech

Revision:
14:f9a77400b622
Parent:
1:e52ae6584f1c
diff -r b0f5ae12dc05 -r f9a77400b622 CommandTerminal/CmdIdentification.cpp
--- a/CommandTerminal/CmdIdentification.cpp	Fri Nov 04 19:10:24 2016 +0000
+++ b/CommandTerminal/CmdIdentification.cpp	Fri Nov 04 14:25:43 2016 -0500
@@ -1,18 +1,30 @@
 #include "CmdIdentification.h"
-#include "version.h"
+#include "mts_at_version.h"
 
-CmdIdentification::CmdIdentification(mDot* dot, mts::MTSSerial& serial) : Command(dot, "Request Id", "ATI", "Request Identification"), _serial(serial)
+CmdIdentification::CmdIdentification() : Command("Request Id", "ATI", "Request Identification", "NONE")
 {
-    _help = std::string(text()) + ": " + std::string(desc());
 }
 
 uint32_t CmdIdentification::action(std::vector<std::string> args)
 {
     std::string version = AT_APPLICATION_VERSION;
+#ifdef DEBUG_MAC
+    version += "-debug";
+#endif
 
-    _serial.writef("MultiTech mDot\r\n");
-    _serial.writef("Firmware: %s\r\n", version.c_str());
-    _serial.writef("Library : %s\r\n", _dot->getId().c_str());
+    char buf[16];
+    size_t size = snprintf(buf, sizeof(buf), "-mbed%d", MBED_LIBRARY_VERSION);
+    if (size > 0) {
+        version.append(buf, size);
+    }
+
+#if defined(TARGET_MTS_MDOT_F411RE)
+    CommandTerminal::Serial()->writef("MultiTech mDot\r\n");
+#else
+    CommandTerminal::Serial()->writef("MultiTech xDot\r\n");
+#endif /* TARGET_MTS_MDOT_F411RE */
+    CommandTerminal::Serial()->writef("Firmware: %s\r\n", version.c_str());
+    CommandTerminal::Serial()->writef("Library : %s\r\n", CommandTerminal::Dot()->getId().c_str());
 
     return 0;
 }