firm newest
Dependencies: MTS-Serial libmDot-dev-mbed5-deprecated
CommandTerminal/CmdSessionDataRate.cpp@0:3c869a8cb8f8, 2018-10-18 (annotated)
- Committer:
- nguyenhoang9x5555
- Date:
- Thu Oct 18 04:18:48 2018 +0000
- Revision:
- 0:3c869a8cb8f8
DOT AT FIRMWARE 18102018
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 1 | #include "CmdSessionDataRate.h" |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 2 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 3 | CmdSessionDataRate::CmdSessionDataRate() |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 4 | : Command("Session Data Rate", "AT+SDR", "Get the current datarate", "US:(7-10|DR0-DR4|DR8-DR13)) EU:(7-12|DR0-DR7))") |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 5 | { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 6 | _queryable = true; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 7 | } |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 8 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 9 | uint32_t CmdSessionDataRate::action(std::vector<std::string> args) { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 10 | if (args.size() == 1) { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 11 | CommandTerminal::Serial()->writef("DR%d - %s\r\n", CommandTerminal::Dot()->getSessionDataRate(), CommandTerminal::Dot()->getDateRateDetails(CommandTerminal::Dot()->getSessionDataRate()).c_str()); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 12 | } |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 13 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 14 | return 0; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 15 | } |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 16 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 17 | bool CmdSessionDataRate::verify(std::vector<std::string> args) { |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 18 | if (args.size() == 1) |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 19 | return true; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 20 | |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 21 | CommandTerminal::setErrorMessage("Invalid arguments"); |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 22 | return false; |
nguyenhoang9x5555 | 0:3c869a8cb8f8 | 23 | } |