DUNE: Uniform Navigational Environment  2016.09.0
DUNE::Hardware::LUCL::Protocol Class Reference

Public Member Functions

 Protocol (void)
 
 ~Protocol (void)
 
void setUART (const std::string &uart_dev)
 
void setI2C (const std::string &i2c_dev, uint8_t addr)
 
void setName (const std::string &name)
 
void open (int baud=0)
 
bool isOpen (void)
 
void close (void)
 
unsigned read (uint8_t *bfr, unsigned bfr_len)
 
unsigned write (const uint8_t *bfr, unsigned bfr_len)
 
CommandType consumeData (Command &cmd)
 
template<typename H >
void read (H &handler)
 
void sendCommand (uint8_t cmd, const uint8_t *data=0, int data_size=0)
 
void requestVersion (void)
 
void requestName (void)
 
void requestReset (void)
 
void requestBootJump (void)
 
int requestBaud (const std::string &device)
 
std::string searchNewFirmware (const FileSystem::Path &path, unsigned ver=0, unsigned rev=0, unsigned pat=0, bool ver_fixed=false)
 

Static Public Member Functions

static const char * getErrorString (uint8_t error)
 

Constructor & Destructor Documentation

DUNE::Hardware::LUCL::Protocol::Protocol ( void  )
DUNE::Hardware::LUCL::Protocol::~Protocol ( void  )

References close().

Member Function Documentation

void DUNE::Hardware::LUCL::Protocol::close ( void  )

Referenced by ~Protocol().

const char * DUNE::Hardware::LUCL::Protocol::getErrorString ( uint8_t  error)
static
bool DUNE::Hardware::LUCL::Protocol::isOpen ( void  )
void DUNE::Hardware::LUCL::Protocol::open ( int  baud = 0)

Open device.

Parameters
baudtarget baud rate for uart devices. 0 means auto-detect.

References DUNE::Hardware::I2C::connect(), DUNE::Hardware::I2C, and DUNE::Hardware::SerialPort.

unsigned DUNE::Hardware::LUCL::Protocol::read ( uint8_t *  bfr,
unsigned  bfr_len 
)
template<typename H >
void DUNE::Hardware::LUCL::Protocol::read ( H &  handler)
inline

References read().

int DUNE::Hardware::LUCL::Protocol::requestBaud ( const std::string &  device)
void DUNE::Hardware::LUCL::Protocol::requestBootJump ( void  )

References sendCommand().

void DUNE::Hardware::LUCL::Protocol::requestName ( void  )

References sendCommand().

void DUNE::Hardware::LUCL::Protocol::requestReset ( void  )

References sendCommand().

void DUNE::Hardware::LUCL::Protocol::requestVersion ( void  )

References sendCommand().

std::string DUNE::Hardware::LUCL::Protocol::searchNewFirmware ( const FileSystem::Path path,
unsigned  ver = 0,
unsigned  rev = 0,
unsigned  pat = 0,
bool  ver_fixed = false 
)
void DUNE::Hardware::LUCL::Protocol::sendCommand ( uint8_t  cmd,
const uint8_t *  data = 0,
int  data_size = 0 
)
void DUNE::Hardware::LUCL::Protocol::setI2C ( const std::string &  i2c_dev,
uint8_t  addr 
)
void DUNE::Hardware::LUCL::Protocol::setName ( const std::string &  name)
void DUNE::Hardware::LUCL::Protocol::setUART ( const std::string &  uart_dev)
unsigned DUNE::Hardware::LUCL::Protocol::write ( const uint8_t *  bfr,
unsigned  bfr_len 
)
Collaboration diagram for DUNE::Hardware::LUCL::Protocol:
Collaboration graph