![]() |
DUNE: Uniform Navigational Environment
2016.05.0
|
Public Member Functions | |
| BasicModem (Tasks::Task *task, IO::Handle *handle) | |
| virtual | ~BasicModem (void) |
| void | initialize (void) |
| void | setLineTermIn (const std::string &term) |
| const std::string & | getLineTermIn (void) |
| void | setLineTermOut (const std::string &str) |
| const std::string & | getLineTermOut (void) |
| void | setLineTrim (bool enable) |
| void | setTxRateMax (double rate) |
| bool | isBusy (void) |
| bool | isCooling (void) |
| void | setBusy (bool value) |
Public Member Functions inherited from DUNE::Concurrency::Thread | |
| Thread (void) | |
| virtual | ~Thread (void) |
| int | getProcessorUsage (void) |
Public Member Functions inherited from DUNE::Concurrency::Runnable | |
| Runnable (void) | |
| virtual | ~Runnable (void) |
| void | start (void) |
| void | stop (void) |
| void | join (void) |
| void | stopAndJoin (void) |
| void | setPriority (Scheduler::Policy policy, unsigned priority) |
| State | getState (void) |
| bool | isCreated (void) |
| bool | isStopping (void) |
| bool | isRunning (void) |
| bool | isStarting (void) |
| bool | isDead (void) |
Protected Types | |
| enum | ReadMode { READ_MODE_LINE, READ_MODE_RAW } |
Protected Member Functions | |
| virtual bool | handleUnsolicited (const std::string &str) |
| virtual void | sendInitialization (void) |
| virtual void | sendReset (void) |
| virtual bool | isFragment (const std::string &str) |
| void | sendRaw (const uint8_t *data, unsigned data_size) |
| void | send (const std::string &str) |
| void | setTimeout (double timeout) |
| double | getTimeout (void) |
| void | expect (const std::string &str) |
| void | readRaw (Time::Counter< double > &timer, uint8_t *data, unsigned data_size) |
| ReadMode | getReadMode (void) |
| void | setReadMode (ReadMode mode) |
| void | flushInput (void) |
| std::string | readLine (void) |
| std::string | readLine (Time::Counter< double > &timer) |
| Tasks::Task * | getTask (void) |
| void | setSkipLine (const std::string &line) |
Protected Member Functions inherited from DUNE::Concurrency::Thread | |
| void | startImpl (void) |
| void | stopImpl (void) |
| void | joinImpl (void) |
| void | setPriorityImpl (Scheduler::Policy policy, unsigned priority) |
Protected Attributes | |
| Concurrency::Mutex | m_mutex |
| IO::Handle * | m_handle |
| std::string | m_last_cmd |
Additional Inherited Members | |
Public Types inherited from DUNE::Concurrency::Runnable | |
| enum | State { StateStarting, StateRunning, StateStopping, StateDead, StateUnknown } |
|
protected |
| DUNE::Hardware::BasicModem::BasicModem | ( | Tasks::Task * | task, |
| IO::Handle * | handle | ||
| ) |
Constructor.
| [in] | task | parent task. |
| [in] | handle | I/O handle. |
References DUNE::IO::Handle::flushInput(), and m_handle.
|
inlinevirtual |
|
protected |
References readLine().
|
protected |
References DUNE::IO::Handle::flushInput(), and m_handle.
| const std::string & DUNE::Hardware::BasicModem::getLineTermIn | ( | void | ) |
References m_mutex.
| const std::string & DUNE::Hardware::BasicModem::getLineTermOut | ( | void | ) |
References m_mutex.
Referenced by DUNE::Hardware::HayesModem::sendAT().
|
protected |
References m_mutex.
|
inlineprotected |
|
protected |
References m_mutex.
Referenced by readLine().
|
inlineprotectedvirtual |
Handle unsolicited or asynchronous commands.
| [in] | str | command string. |
| void DUNE::Hardware::BasicModem::initialize | ( | void | ) |
| bool DUNE::Hardware::BasicModem::isBusy | ( | void | ) |
Test if the modem is busy.
Test if ISU is busy performing an SBD session.
References m_mutex.
| bool DUNE::Hardware::BasicModem::isCooling | ( | void | ) |
Test if the modem is cooling down.
Test if ISU is cooling down.
References m_mutex, and DUNE::Time::Counter< T >::overflow().
|
inlineprotectedvirtual |
Test if command is not complete (i.e.
is a fragment). This method is useful when the protocol allows mixing ASCII with binary data.
| [in] | str | command string. |
|
protected |
References getTimeout().
Referenced by DUNE::Hardware::HayesModem::expect(), expect(), DUNE::Hardware::HayesModem::getRevision(), readLine(), and DUNE::Hardware::HayesModem::readValue().
|
protected |
|
protected |
|
protected |
References getTask(), DUNE::Streams::sanitize(), sendRaw(), and DUNE::Tasks::Task::trace().
Referenced by DUNE::Hardware::HayesModem::sendAT().
|
inlineprotectedvirtual |
Reimplemented in DUNE::Hardware::HayesModem.
Referenced by initialize().
|
protected |
References m_handle, and DUNE::IO::Handle::write().
Referenced by send().
|
inlineprotectedvirtual |
Reimplemented in DUNE::Hardware::HayesModem.
Referenced by initialize().
| void DUNE::Hardware::BasicModem::setBusy | ( | bool | value | ) |
References m_mutex, and DUNE::Time::Counter< T >::reset().
| void DUNE::Hardware::BasicModem::setLineTermIn | ( | const std::string & | term | ) |
Set line termination for modem to CPU commands.
| [in] | term | line terminator. |
References m_mutex.
| void DUNE::Hardware::BasicModem::setLineTermOut | ( | const std::string & | str | ) |
Set line termination for CPU to modem commands.
| [in] | str | line terminator. |
References m_mutex.
| void DUNE::Hardware::BasicModem::setLineTrim | ( | bool | enable | ) |
Remove leading and trailing blank characters from lines.
| [in] | enable | true to enable trimming, false otherwise. |
References m_mutex.
|
protected |
References m_mutex.
Referenced by initialize(), and DUNE::Hardware::HayesModem::initialize().
|
protected |
|
protected |
References m_mutex.
| void DUNE::Hardware::BasicModem::setTxRateMax | ( | double | rate | ) |
Set maximum transmission rate.
| [in] | rate | transmission rate in second. Negative values will disable transmission rate control. |
| [in] | rate | transmission rate in second. Negative values will disable transmission rate cap. |
References m_mutex, and DUNE::Time::Counter< T >::setTop().
|
protected |
I/O handle.
Referenced by BasicModem(), flushInput(), initialize(), DUNE::Hardware::HayesModem::initialize(), DUNE::Hardware::HayesModem::sendRaw(), and sendRaw().
|
protected |
Last command sent to modem.
Referenced by readLine(), and DUNE::Hardware::HayesModem::sendAT().
|
protected |
Concurrency lock.
Referenced by getLineTermIn(), getLineTermOut(), getReadMode(), DUNE::Hardware::HayesModem::getRSSI(), getTimeout(), isBusy(), isCooling(), setBusy(), setLineTermIn(), setLineTermOut(), setLineTrim(), setReadMode(), DUNE::Hardware::HayesModem::setRSSI(), setTimeout(), and setTxRateMax().
