DUNE: Uniform Navigational Environment
2019.02.1
|
Public Member Functions | |
HayesModem (Tasks::Task *task, IO::Handle *handle) | |
virtual | ~HayesModem (void) |
void | initialize (void) |
std::string | getManufacturer (void) |
std::string | getModel (void) |
std::string | getRevision (void) |
std::string | getIMEI (void) |
float | getRSSI (void) |
Public Member Functions inherited from DUNE::Hardware::BasicModem | |
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) |
unsigned | getPriority (void) |
State | getState (void) |
bool | isCreated (void) |
bool | isStopping (void) |
bool | isRunning (void) |
bool | isStarting (void) |
bool | isDead (void) |
Protected Member Functions | |
virtual void | sendInitialization (void) |
virtual void | sendReset (void) |
virtual void | queryRSSI (void) |
virtual void | expectOK (void) |
void | sendAT (const std::string &str) |
void | sendRaw (const uint8_t *data, unsigned data_size) |
void | expect (const std::string &str) |
void | expectREADY (void) |
void | setRSSI (float value) |
void | setFlowControl (bool value) |
void | setEcho (bool value) |
std::string | readValue (const std::string &cmd) |
Protected Member Functions inherited from DUNE::Hardware::BasicModem | |
virtual bool | handleUnsolicited (const std::string &str) |
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) |
unsigned | getPriorityImpl (void) |
Additional Inherited Members | |
Public Types inherited from DUNE::Concurrency::Runnable | |
Protected Types inherited from DUNE::Hardware::BasicModem | |
Protected Attributes inherited from DUNE::Hardware::BasicModem | |
Concurrency::Mutex | m_mutex |
IO::Handle * | m_handle |
std::string | m_last_cmd |
HayesModem::HayesModem | ( | Tasks::Task * | task, |
IO::Handle * | handle | ||
) |
Constructor.
[in] | task | parent task. |
[in] | handle | I/O handle. |
References DUNE::Hardware::BasicModem::getTask(), DUNE::IMC::Message::setDestination(), and DUNE::IMC::Message::setDestinationEntity().
|
inlinevirtual |
Destructor.
References getIMEI(), getManufacturer(), getModel(), getRevision(), getRSSI(), and initialize().
|
protected |
References DUNE::Hardware::BasicModem::readLine().
Referenced by expectOK(), expectREADY(), and queryRSSI().
|
protectedvirtual |
References expect().
Referenced by queryRSSI(), readValue(), setEcho(), and setFlowControl().
|
protected |
References expect().
Referenced by queryRSSI().
std::string HayesModem::getIMEI | ( | void | ) |
Query the ISU serial number (IMEI).
References readValue().
Referenced by ~HayesModem().
std::string HayesModem::getManufacturer | ( | void | ) |
Query the ISU manufacturer.
References readValue().
Referenced by ~HayesModem().
std::string HayesModem::getModel | ( | void | ) |
std::string HayesModem::getRevision | ( | void | ) |
Query the ISU revision.
References DUNE::Utils::String::join(), DUNE::Hardware::BasicModem::readLine(), and sendAT().
Referenced by ~HayesModem().
float HayesModem::getRSSI | ( | void | ) |
Retrieve received signal strength indication (RSSI).
References DUNE::Hardware::BasicModem::m_mutex, queryRSSI(), and DUNE::IMC::RSSI::value.
Referenced by ~HayesModem().
void HayesModem::initialize | ( | void | ) |
Perform ISU initialization, this function must be called before any other.
References DUNE::IO::Handle::flushInput(), DUNE::Hardware::BasicModem::m_handle, DUNE::Hardware::BasicModem::READ_MODE_LINE, sendInitialization(), sendReset(), DUNE::Hardware::BasicModem::setReadMode(), DUNE::Concurrency::Runnable::start(), and DUNE::Time::Delay::wait().
Referenced by ~HayesModem().
|
inlineprotectedvirtual |
References expect(), expectOK(), expectREADY(), readValue(), sendAT(), sendRaw(), setEcho(), setFlowControl(), and setRSSI().
Referenced by getRSSI().
|
protected |
References expectOK(), DUNE::Hardware::BasicModem::readLine(), and sendAT().
Referenced by getIMEI(), getManufacturer(), getModel(), and queryRSSI().
|
protected |
References DUNE::Tasks::Task::dispatch(), DUNE::Hardware::BasicModem::getLineTermOut(), DUNE::Hardware::BasicModem::getTask(), DUNE::Hardware::BasicModem::m_last_cmd, DUNE::Hardware::BasicModem::send(), DUNE::IMC::Message::setDestination(), and DUNE::IMC::DevDataText::value.
Referenced by getRevision(), queryRSSI(), readValue(), setEcho(), and setFlowControl().
|
inlineprotectedvirtual |
Reimplemented from DUNE::Hardware::BasicModem.
Referenced by initialize().
|
protected |
References DUNE::Hardware::BasicModem::m_handle, and DUNE::IO::Handle::write().
Referenced by queryRSSI().
|
inlineprotectedvirtual |
Reimplemented from DUNE::Hardware::BasicModem.
Referenced by initialize().
|
protected |
Enable or disable the ISU to echo characters to the DTE.
[in] | value | true to enable, false to disable. |
References expectOK(), and sendAT().
Referenced by queryRSSI().
|
protected |
Enable or disable RTS/CTS flow control.
[in] | value | true to enable flow control, false otherwise. |
References expectOK(), and sendAT().
Referenced by queryRSSI().
|
protected |
References DUNE::Tasks::Task::dispatch(), DUNE::Hardware::BasicModem::getTask(), DUNE::Hardware::BasicModem::m_mutex, and DUNE::IMC::RSSI::value.
Referenced by queryRSSI().