DUNE: Uniform Navigational Environment  2017.01.0
Transports::Radio::Radio3dr Class Reference

Detailed Description

Author
João Teixeira.

Classes

struct  DeviceParam
 

Public Types

enum  At_cmd {
  ENABLE_CMD, AT, RADIO_VERSION, BOARD_TYPE,
  BOARD_FREQUENCY, BOARD_VERSION, SETTABLE_EEPROM_PARAMETERS, TDM_TIMING,
  RSSI, EXIT_AT_COMMAND_MODE, DISPLAY_OR_SET_PARAMETER_N, REBOOT,
  WRITE_PARAMETERS_EEPROM, ENABLE_RSSI_REPORTING, ENABLE_TDM_REPORTING, DISABLE_DEBUG_REPORTING,
  NO_CMD
}
 
enum  Mavlink { NO_MAVLINK_FRAMING, FRAME_MAVLINK, LOW_LATENCY_MAVLINK }
 

Public Member Functions

 Radio3dr (RadioConfParam args, Tasks::Task *taskp=NULL)
 
 ~Radio3dr (void)
 
int configDevice (void)
 
int DeviceVerifyConf ()
 
std::string commandCreate (At_cmd cmd_type, std::string &data)
 
void sendCommandAndWait (const std::string &cmd, double delay_aft)
 
void sendCommand (const std::string &cmd)
 
void sendString (std::string &msg)
 
bool saveIfExpectedCmdIs (const std::string &msg, std::string &expectedCmd, std::string &output)
 
void process (const std::string msg)
 
- Public Member Functions inherited from Transports::Radio::RadioDriver
 RadioDriver (RadioConfParam args, Tasks::Task *taskp=NULL)
 
virtual ~RadioDriver (void)
 
bool processNewReport (std::string &rxData)
 
bool processCrc (void)
 
bool sendData (std::string txData)
 
bool readSentence (void)
 
bool openSocket (void)
 
int connectToDevice ()
 
void processInputInit (double timeout=0.1)
 
bool processInput (double timeout=0.1)
 

Protected Attributes

DeviceParam device_param
 
bool cmd_mode
 
std::string last_command
 
- Protected Attributes inherited from Transports::Radio::RadioDriver
Tasks::Task * task
 
IMC::DevDataText m_dev_data
 
IO::Handle * m_handle
 
std::string m_line
 
std::string m_last_line
 
RadioConfParam radioParams
 

Additional Inherited Members

- Public Attributes inherited from Transports::Radio::RadioDriver
DeviceReports device_reports
 

Member Enumeration Documentation

Entity states.

Enumerator
ENABLE_CMD 
AT 
RADIO_VERSION 
BOARD_TYPE 
BOARD_FREQUENCY 
BOARD_VERSION 
SETTABLE_EEPROM_PARAMETERS 
TDM_TIMING 
RSSI 
EXIT_AT_COMMAND_MODE 
DISPLAY_OR_SET_PARAMETER_N 
REBOOT 
WRITE_PARAMETERS_EEPROM 
ENABLE_RSSI_REPORTING 
ENABLE_TDM_REPORTING 
DISABLE_DEBUG_REPORTING 
NO_CMD 
Enumerator
NO_MAVLINK_FRAMING 
FRAME_MAVLINK 
LOW_LATENCY_MAVLINK 

Constructor & Destructor Documentation

Transports::Radio::Radio3dr::Radio3dr ( RadioConfParam  args,
Tasks::Task *  taskp = NULL 
)
inline

Radio 3DR driver.

Transports::Radio::Radio3dr::~Radio3dr ( void  )
inline

Default destructor.

References Transports::Radio::RadioDriver::m_handle.

Member Function Documentation

std::string Transports::Radio::Radio3dr::commandCreate ( At_cmd  cmd_type,
std::string &  data 
)
inline

References ENABLE_CMD, and last_command.

Referenced by DeviceVerifyConf(), and sendString().

int Transports::Radio::Radio3dr::configDevice ( void  )
inlinevirtual
int Transports::Radio::Radio3dr::DeviceVerifyConf ( )
inline

References Transports::Radio::RadioConfParam::air_speed, AT, BOARD_FREQUENCY, Transports::Radio::Radio3dr::DeviceParam::board_frequency, BOARD_TYPE, Transports::Radio::Radio3dr::DeviceParam::board_type, BOARD_VERSION, Transports::Radio::Radio3dr::DeviceParam::board_version, cmd_mode, commandCreate(), device_param, Transports::Radio::RadioDriver::device_reports, DISPLAY_OR_SET_PARAMETER_N, Transports::Radio::RadioConfParam::duty_cycle, ENABLE_CMD, ENABLE_RSSI_REPORTING, ENABLE_TDM_REPORTING, Transports::Radio::RadioConfParam::error_correction, EXIT_AT_COMMAND_MODE, Transports::Radio::RadioDriver::m_last_line, Transports::Radio::RadioDriver::m_line, Transports::Radio::RadioConfParam::max_frequency, Transports::Radio::RadioConfParam::min_frequency, Transports::Radio::RadioConfParam::mum_channels, Transports::Radio::RadioConfParam::net_id, Transports::Radio::RadioConfParam::power_level, RADIO_VERSION, Transports::Radio::Radio3dr::DeviceParam::radio_version, Transports::Radio::RadioDriver::radioParams, REBOOT, RSSI, Transports::Radio::DeviceReports::rssi, Transports::Radio::RadioConfParam::rssi_report, Transports::Radio::Radio3dr::DeviceParam::s10_mum_channels, Transports::Radio::Radio3dr::DeviceParam::s11_duty_cycle, Transports::Radio::Radio3dr::DeviceParam::s2_air_speed, Transports::Radio::Radio3dr::DeviceParam::s3_net_id, Transports::Radio::Radio3dr::DeviceParam::s4_power_level, Transports::Radio::Radio3dr::DeviceParam::s5_error_correction, Transports::Radio::Radio3dr::DeviceParam::s8_min_frequency, Transports::Radio::Radio3dr::DeviceParam::s9_max_frequency, sendCommandAndWait(), SETTABLE_EEPROM_PARAMETERS, Transports::Radio::RadioDriver::task, Transports::Radio::RadioConfParam::tdm_report, TDM_TIMING, Transports::Radio::DeviceReports::tdm_timing_max_data_packet, and WRITE_PARAMETERS_EEPROM.

Referenced by configDevice().

void Transports::Radio::Radio3dr::process ( const std::string  msg)
inlinevirtual

Process sentence.

Parameters
[in]msgsentence.

Implements Transports::Radio::RadioDriver.

References BOARD_FREQUENCY, Transports::Radio::Radio3dr::DeviceParam::board_frequency, BOARD_TYPE, Transports::Radio::Radio3dr::DeviceParam::board_type, BOARD_VERSION, Transports::Radio::Radio3dr::DeviceParam::board_version, cmd_mode, Transports::Radio::DATA_REPORT, Transports::Radio::DeviceReports::data_report, device_param, Transports::Radio::RadioDriver::device_reports, last_command, Transports::Radio::RadioDriver::m_dev_data, RADIO_VERSION, Transports::Radio::Radio3dr::DeviceParam::radio_version, Transports::Radio::DeviceReports::report_status, Transports::Radio::DeviceReports::rssi, Transports::Radio::RSSI_REPORT, Transports::Radio::Radio3dr::DeviceParam::s0_format, Transports::Radio::Radio3dr::DeviceParam::s10_mum_channels, Transports::Radio::Radio3dr::DeviceParam::s11_duty_cycle, Transports::Radio::Radio3dr::DeviceParam::s12_lbt_rssi, Transports::Radio::Radio3dr::DeviceParam::s13_manchester, Transports::Radio::Radio3dr::DeviceParam::s14_rtscts, Transports::Radio::Radio3dr::DeviceParam::s1_serial_speed, Transports::Radio::Radio3dr::DeviceParam::s2_air_speed, Transports::Radio::Radio3dr::DeviceParam::s3_net_id, Transports::Radio::Radio3dr::DeviceParam::s4_power_level, Transports::Radio::Radio3dr::DeviceParam::s5_error_correction, Transports::Radio::Radio3dr::DeviceParam::s6_mavlink, Transports::Radio::Radio3dr::DeviceParam::s7_oppresend, Transports::Radio::Radio3dr::DeviceParam::s8_min_frequency, Transports::Radio::Radio3dr::DeviceParam::s9_max_frequency, saveIfExpectedCmdIs(), SETTABLE_EEPROM_PARAMETERS, Transports::Radio::RadioDriver::task, Transports::Radio::TDM_REPORT, Transports::Radio::DeviceReports::tdm_report, TDM_TIMING, Transports::Radio::DeviceReports::tdm_timing_max_data_packet, Transports::Radio::DeviceReports::tdm_timing_silence_period, and Transports::Radio::DeviceReports::tdm_timing_tx_window.

bool Transports::Radio::Radio3dr::saveIfExpectedCmdIs ( const std::string &  msg,
std::string &  expectedCmd,
std::string &  output 
)
inline

References Transports::Radio::RadioDriver::task.

Referenced by process().

void Transports::Radio::Radio3dr::sendCommand ( const std::string &  cmd)
inline
void Transports::Radio::Radio3dr::sendCommandAndWait ( const std::string &  cmd,
double  delay_aft 
)
inline
void Transports::Radio::Radio3dr::sendString ( std::string &  msg)
inlinevirtual

Member Data Documentation

bool Transports::Radio::Radio3dr::cmd_mode
protected

Referenced by DeviceVerifyConf(), and process().

DeviceParam Transports::Radio::Radio3dr::device_param
protected

Referenced by DeviceVerifyConf(), and process().

std::string Transports::Radio::Radio3dr::last_command
protected

Referenced by commandCreate(), and process().

Collaboration diagram for Transports::Radio::Radio3dr:
Collaboration graph