MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
Public Member Functions | Static Public Attributes | List of all members
microstrain::connections::UsbSerialConnection Class Reference

A serial connection but indicates that it's actually a USB connection. More...

#include <serial_connection.hpp>

Inheritance diagram for microstrain::connections::UsbSerialConnection:
microstrain::connections::SerialConnection microstrain::Connection

Public Member Functions

 UsbSerialConnection (const std::string &portName, uint32_t baudrate)
 
- Public Member Functions inherited from microstrain::connections::SerialConnection
 SerialConnection (std::string portName, uint32_t baudrate)
 Creates a Serial Connection that will communicate with a device over serial. More...
 
 ~SerialConnection () override
 Closes the underlying serial port. More...
 
bool recvFromDevice (uint8_t *buffer, size_t max_length, unsigned int wait_time_ms, size_t *length_out, EmbeddedTimestamp *timestamp_out) final
 Receives bytes from the device. More...
 
bool sendToDevice (const uint8_t *data, size_t length) final
 Sends bytes to the device. More...
 
bool isConnected () const override
 Check if the port is connected. More...
 
bool connect () override
 Connect to the port. More...
 
bool disconnect () override
 Disconnect from the port. More...
 
void connectionInfo (std::string &name, uint32_t &baudrate) const
 
uint32_t baudrate () const
 
bool setBaudrate (uint32_t baud)
 Change the baudrate. More...
 
const char * interfaceName () const override
 
uint32_t parameter () const override
 
- Public Member Functions inherited from microstrain::Connection
 Connection ()
 
virtual ~Connection ()
 
const char * type () const
 

Static Public Attributes

static constexpr const char * TYPE = "USB"
 
- Static Public Attributes inherited from microstrain::connections::SerialConnection
static constexpr const char * TYPE = "Serial"
 
- Static Public Attributes inherited from microstrain::Connection
static constexpr const char * TYPE = "None"
 

Additional Inherited Members

- Protected Attributes inherited from microstrain::Connection
const char * mType
 

Detailed Description

A serial connection but indicates that it's actually a USB connection.

Constructor & Destructor Documentation

◆ UsbSerialConnection()

microstrain::connections::UsbSerialConnection::UsbSerialConnection ( const std::string &  portName,
uint32_t  baudrate 
)
inline

Member Data Documentation

◆ TYPE

constexpr const char* microstrain::connections::UsbSerialConnection::TYPE = "USB"
staticconstexpr

The documentation for this class was generated from the following file: