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

Public Member Functions

 HayesModem (Tasks::Task *task, Hardware::SerialPort *uart)
 
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, Hardware::SerialPort *uart)
 
virtual ~BasicModem (void)
 
void initialize (void)
 
void setTxRateMax (double rate)
 
bool isBusy (void)
 
bool isCooling (void)
 
- Public Member Functions inherited from DUNE::Concurrency::Thread
 Thread (void)
 
virtual ~Thread (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)
 
void sendAT (const std::string &str)
 
void sendRaw (const uint8_t *data, unsigned data_size)
 
void expect (const std::string &str)
 
void expectOK (void)
 
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)
 
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)
 
void setBusy (bool value)
 
- 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
}
 
- Static Public Member Functions inherited from DUNE::Concurrency::Thread
static unsigned native (void)
 
- 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
 
Hardware::SerialPortm_uart
 
std::string m_last_cmd
 

Constructor & Destructor Documentation

HayesModem::HayesModem ( Tasks::Task task,
Hardware::SerialPort uart 
)

Constructor.

Parameters
[in]taskparent task.
[in]uartserial port connected to the ISU.

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  )
protected

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::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
void HayesModem::sendAT ( const std::string &  str)
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().

Referenced by initialize().

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