firm newest
Dependencies: MTS-Serial libmDot-dev-mbed5-deprecated
CommandTerminal/CmdIdentification.cpp@1:c1c6549b9333, 2018-10-22 (annotated)
- Committer:
- nguyenhoang9x5555
- Date:
- Mon Oct 22 01:56:09 2018 +0000
- Revision:
- 1:c1c6549b9333
- Parent:
- 0:3c869a8cb8f8
hey
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 1 | #include "CmdIdentification.h" |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 2 | #include "mts_at_version.h" |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 3 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 4 | CmdIdentification::CmdIdentification() : Command("Request Id", "ATI", "Request Identification", "NONE") |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 5 | { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 6 | } |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 7 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 8 | uint32_t CmdIdentification::action(std::vector<std::string> args) |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 9 | { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 10 | std::string version = AT_APPLICATION_VERSION; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 11 | #ifdef DEBUG_MAC |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 12 | version += "-debug"; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 13 | #endif |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 14 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 15 | char buf[16]; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 16 | size_t size = snprintf(buf, sizeof(buf), "-mbed%d"); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 17 | if (size > 0) { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 18 | version.append(buf, size); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 19 | } |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 20 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 21 | #if defined(TARGET_MTS_MDOT_F411RE) |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 22 | CommandTerminal::Serial()->writef("MultiTech mDot\r\n"); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 23 | #else |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 24 | CommandTerminal::Serial()->writef("MultiTech xDot\r\n"); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 25 | #endif /* TARGET_MTS_MDOT_F411RE */ |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 26 | CommandTerminal::Serial()->writef("Firmware : %s\r\n", version.c_str()); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 27 | CommandTerminal::Serial()->writef("Library : %s\r\n", CommandTerminal::Dot()->getId().c_str()); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 28 | CommandTerminal::Serial()->writef("MTS-Lora : %s\r\n", CommandTerminal::Dot()->getMtsLoraId().c_str()); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 29 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 30 | return 0; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 31 | } |