![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
AT terminal for the mDot using the USB debug port instead of the serial port.
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
CommandTerminal/CmdNetworkLinkCheck.cpp@14:f9a77400b622, 2016-11-04 (annotated)
- Committer:
- Mike Fiore
- Date:
- Fri Nov 04 14:25:43 2016 -0500
- Revision:
- 14:f9a77400b622
- Parent:
- 1:e52ae6584f1c
update from git revision 2.0.16
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mike Fiore |
1:e52ae6584f1c | 1 | #include "CmdNetworkLinkCheck.h" |
Mike Fiore |
1:e52ae6584f1c | 2 | #include "CommandTerminal.h" |
Mike Fiore |
1:e52ae6584f1c | 3 | |
Mike Fiore |
14:f9a77400b622 | 4 | CmdNetworkLinkCheck::CmdNetworkLinkCheck() |
Mike Fiore |
1:e52ae6584f1c | 5 | : |
Mike Fiore |
14:f9a77400b622 | 6 | Command("Network Link Check", "AT+NLC", "Perform network link check, displays dBm above floor, number of gateways in range and optional packet payload if received", "(-20.0-20.0),(1-)") { |
Mike Fiore |
14:f9a77400b622 | 7 | |
Mike Fiore |
1:e52ae6584f1c | 8 | } |
Mike Fiore |
1:e52ae6584f1c | 9 | |
Mike Fiore |
1:e52ae6584f1c | 10 | uint32_t CmdNetworkLinkCheck::action(std::vector<std::string> args) { |
Mike Fiore |
1:e52ae6584f1c | 11 | mDot::link_check lc; |
Mike Fiore |
1:e52ae6584f1c | 12 | |
Mike Fiore |
14:f9a77400b622 | 13 | lc = CommandTerminal::Dot()->networkLinkCheck(); |
Mike Fiore |
1:e52ae6584f1c | 14 | if (lc.status) { |
Mike Fiore |
14:f9a77400b622 | 15 | CommandTerminal::Serial()->writef("%d,%lu\r\n", lc.dBm, lc.gateways); |
Mike Fiore |
1:e52ae6584f1c | 16 | |
Mike Fiore |
1:e52ae6584f1c | 17 | if (!lc.payload.empty()) |
Mike Fiore |
14:f9a77400b622 | 18 | CommandTerminal::Serial()->writef("%s\r\n", CommandTerminal::formatPacketData(lc.payload, CommandTerminal::Dot()->getRxOutput()).c_str()); |
Mike Fiore |
1:e52ae6584f1c | 19 | |
Mike Fiore |
1:e52ae6584f1c | 20 | } else { |
Mike Fiore |
14:f9a77400b622 | 21 | CommandTerminal::setErrorMessage(CommandTerminal::Dot()->getLastError()); |
Mike Fiore |
1:e52ae6584f1c | 22 | return 1; |
Mike Fiore |
1:e52ae6584f1c | 23 | } |
Mike Fiore |
1:e52ae6584f1c | 24 | |
Mike Fiore |
1:e52ae6584f1c | 25 | return 0; |
Mike Fiore |
1:e52ae6584f1c | 26 | } |
Mike Fiore |
1:e52ae6584f1c | 27 |