DUNE: Uniform Navigational Environment  2.6.1
DUNE::Hardware::HayesModem Class Reference

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)
 
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::TaskgetTask (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)
 

Additional Inherited Members

- Public Types inherited from DUNE::Concurrency::Runnable
enum  State {
  StateStarting, StateRunning, StateStopping, StateDead,
  StateUnknown
}
 
- Protected Types inherited from DUNE::Hardware::BasicModem
enum  ReadMode { READ_MODE_LINE, READ_MODE_RAW }
 
- Protected Attributes inherited from DUNE::Hardware::BasicModem
Concurrency::Mutex m_mutex
 
IO::Handlem_handle
 
std::string m_last_cmd
 

Constructor & Destructor Documentation

HayesModem::HayesModem ( Tasks::Task task,
IO::Handle handle 
)

Constructor.

Parameters
[in]taskparent task.
[in]handleI/O handle.

References DUNE::Hardware::BasicModem::getTask(), DUNE::IMC::Message::setDestination(), and DUNE::IMC::Message::setDestinationEntity().

virtual DUNE::Hardware::HayesModem::~HayesModem ( void  )
inlinevirtual

Destructor.

Member Function Documentation

void HayesModem::expect ( const std::string &  str)
protected
void HayesModem::expectOK ( void  )
protectedvirtual

References expect().

Referenced by readValue(), setEcho(), and setFlowControl().

void HayesModem::expectREADY ( void  )
protected

References expect().

std::string HayesModem::getIMEI ( void  )

Query the ISU serial number (IMEI).

Returns
ISU serial number (IMEI),

References readValue().

std::string HayesModem::getManufacturer ( void  )

Query the ISU manufacturer.

Returns
ISU manufacturer name.

References readValue().

std::string HayesModem::getModel ( void  )

Query the ISU model.

Returns
ISU model name.

References readValue().

std::string HayesModem::getRevision ( void  )

Query the ISU revision.

Returns
ISU revision.

References DUNE::Utils::String::join(), DUNE::Hardware::BasicModem::readLine(), and sendAT().

float HayesModem::getRSSI ( void  )

Retrieve received signal strength indication (RSSI).

Returns
RSSI value.

References DUNE::Hardware::BasicModem::m_mutex, queryRSSI(), and DUNE::IMC::RSSI::value.

virtual void DUNE::Hardware::HayesModem::queryRSSI ( void  )
inlineprotectedvirtual

Referenced by getRSSI().

std::string HayesModem::readValue ( const std::string &  cmd)
protected
virtual void DUNE::Hardware::HayesModem::sendInitialization ( void  )
inlineprotectedvirtual

Reimplemented from DUNE::Hardware::BasicModem.

Referenced by initialize().

void HayesModem::sendRaw ( const uint8_t *  data,
unsigned  data_size 
)
protected
virtual void DUNE::Hardware::HayesModem::sendReset ( void  )
inlineprotectedvirtual

Reimplemented from DUNE::Hardware::BasicModem.

Referenced by initialize().

void HayesModem::setEcho ( bool  value)
protected

Enable or disable the ISU to echo characters to the DTE.

Parameters
[in]valuetrue to enable, false to disable.

References expectOK(), and sendAT().

void HayesModem::setFlowControl ( bool  value)
protected

Enable or disable RTS/CTS flow control.

Parameters
[in]valuetrue to enable flow control, false otherwise.

References expectOK(), and sendAT().

Collaboration diagram for DUNE::Hardware::HayesModem:
Collaboration graph