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: SX1272lib mbed-src
Commands/TxCmd.cpp@2:8d8295a51f68, 2015-10-01 (annotated)
- Committer:
- WGorniak
- Date:
- Thu Oct 01 09:40:30 2015 +0200
- Revision:
- 2:8d8295a51f68
added terminal app
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| WGorniak | 2:8d8295a51f68 | 1 | #include "TxCmd.h" |
| WGorniak | 2:8d8295a51f68 | 2 | |
| WGorniak | 2:8d8295a51f68 | 3 | |
| WGorniak | 2:8d8295a51f68 | 4 | TxCmd::TxCmd(Settings* radioSettings) |
| WGorniak | 2:8d8295a51f68 | 5 | : RadioCmd(radioSettings) |
| WGorniak | 2:8d8295a51f68 | 6 | , settings_(radioSettings) |
| WGorniak | 2:8d8295a51f68 | 7 | { |
| WGorniak | 2:8d8295a51f68 | 8 | queryable_ = true; |
| WGorniak | 2:8d8295a51f68 | 9 | delay = settings_->get("delay"); |
| WGorniak | 2:8d8295a51f68 | 10 | } |
| WGorniak | 2:8d8295a51f68 | 11 | |
| WGorniak | 2:8d8295a51f68 | 12 | TxCmd::~TxCmd() |
| WGorniak | 2:8d8295a51f68 | 13 | { |
| WGorniak | 2:8d8295a51f68 | 14 | } |
| WGorniak | 2:8d8295a51f68 | 15 | |
| WGorniak | 2:8d8295a51f68 | 16 | bool TxCmd::execute(list<std::string> args) |
| WGorniak | 2:8d8295a51f68 | 17 | { |
| WGorniak | 2:8d8295a51f68 | 18 | debug( "Performing tx\r\n" ); |
| WGorniak | 2:8d8295a51f68 | 19 | txBuffer = args.empty() ? string("TXTXTX") : *args.begin(); |
| WGorniak | 2:8d8295a51f68 | 20 | return true; |
| WGorniak | 2:8d8295a51f68 | 21 | } |
| WGorniak | 2:8d8295a51f68 | 22 | |
| WGorniak | 2:8d8295a51f68 | 23 | Cmd::Status TxCmd::process() |
| WGorniak | 2:8d8295a51f68 | 24 | { |
| WGorniak | 2:8d8295a51f68 | 25 | RadioContex* p = getRadioContex(); |
| WGorniak | 2:8d8295a51f68 | 26 | p->Send(txBuffer); |
| WGorniak | 2:8d8295a51f68 | 27 | wait_ms(delay); |
| WGorniak | 2:8d8295a51f68 | 28 | return CONTINUE; |
| WGorniak | 2:8d8295a51f68 | 29 | } |
| WGorniak | 2:8d8295a51f68 | 30 | |
| WGorniak | 2:8d8295a51f68 | 31 | string TxCmd::cmd() |
| WGorniak | 2:8d8295a51f68 | 32 | { |
| WGorniak | 2:8d8295a51f68 | 33 | return "tx"; |
| WGorniak | 2:8d8295a51f68 | 34 | } |
| WGorniak | 2:8d8295a51f68 | 35 | |
| WGorniak | 2:8d8295a51f68 | 36 | string TxCmd::desc() |
| WGorniak | 2:8d8295a51f68 | 37 | { |
| WGorniak | 2:8d8295a51f68 | 38 | return "transmit string - tx [string]"; |
| WGorniak | 2:8d8295a51f68 | 39 | } |
| WGorniak | 2:8d8295a51f68 | 40 | |
| WGorniak | 2:8d8295a51f68 | 41 | string TxCmd::getResponse(void) |
| WGorniak | 2:8d8295a51f68 | 42 | { |
| WGorniak | 2:8d8295a51f68 | 43 | return "tx cmd rulez!"; |
| WGorniak | 2:8d8295a51f68 | 44 | } |
| WGorniak | 2:8d8295a51f68 | 45 |