BAOS SDK  18.2.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
kdrive::baos::UsbConnector Class Reference

The UsbConnector is responsible for creating a SUB connection with the baos server. More...

#include <UsbConnector.h>

Inheritance diagram for kdrive::baos::UsbConnector:
kdrive::baos::BaosConnector

Public Types

typedef std::shared_ptr< UsbConnectorPtr
 
- Public Types inherited from kdrive::baos::BaosConnector
typedef std::shared_ptr< BaosConnectorPtr
 

Public Member Functions

 UsbConnector ()
 Creates a default (disconnected) USB baos connector. More...
 
virtual ~UsbConnector ()
 Closes the connections and destroys the connector. More...
 
void open (int index)
 Opens a connection with the local device. More...
 
std::string getDescription () override
 Returns a formatted port description. More...
 
bool isConnected () const override
 Indicates whether the rx thread is still running, which means that the connector is connected. More...
 
unsigned int getUsbIndex () const
 Returns the usb index. More...
 
unsigned int getUsbVendorId ()
 Returns the USB device vendor ID. More...
 
unsigned int getUsbProductId ()
 Returns the USB device product ID. More...
 
std::string getUsbManufacturerString ()
 Returns the USB manufacturer string. More...
 
std::string getUsbProductString ()
 Returns the USB product string. More...
 
std::string getUsbSerialNumberString ()
 Returns the USB serial number string. More...
 
- Public Member Functions inherited from kdrive::baos::BaosConnector
 BaosConnector ()=delete
 
virtual ~BaosConnector ()
 Destroys the BaosConnector. More...
 
unsigned int getConnectorId () const
 Returns the connector id. More...
 
void setVersion (unsigned char version)
 Sets the protocol version. More...
 
unsigned char getVersion () const
 Returns the protocol version. More...
 

Static Public Attributes

static const std::string ConnectorTypeLabel
 
- Static Public Attributes inherited from kdrive::baos::BaosConnector
static const std::string ConnectorId = "baos.connector_id"
 Property Key for the connector id, set in the constructor. More...
 
static const std::string Version = "baos.version"
 Property Key for version, set by the connector type or enumeration. More...
 
static const std::string RouteTransportPacket = "baos.route_transport_packet"
 

Additional Inherited Members

- Protected Member Functions inherited from kdrive::baos::BaosConnector
 BaosConnector (unsigned char version)
 Property Key for enable/disable routing of Transport Packets. More...
 
void resetPropertiesImpl () override
 Calls resetPropertiesImpl from base class and readded own properties. More...
 

Detailed Description

The UsbConnector is responsible for creating a SUB connection with the baos server.

This class supports BAOS protocol 2.x (via USB). (It exist not usd device with protocol version 1.x)

Member Typedef Documentation

Constructor & Destructor Documentation

UsbConnector::UsbConnector ( )

Creates a default (disconnected) USB baos connector.

UsbConnector::~UsbConnector ( )
virtual

Closes the connections and destroys the connector.

Member Function Documentation

std::string UsbConnector::getDescription ( )
override

Returns a formatted port description.

Format: "USB"<UsbIndex+1> e.g. USB1

unsigned int UsbConnector::getUsbIndex ( ) const

Returns the usb index.

Ports are enumerated with the hid driver, and are numbered in the order that the hid driver enumerates the devices.

std::string UsbConnector::getUsbManufacturerString ( )

Returns the USB manufacturer string.

unsigned int UsbConnector::getUsbProductId ( )

Returns the USB device product ID.

std::string UsbConnector::getUsbProductString ( )

Returns the USB product string.

std::string UsbConnector::getUsbSerialNumberString ( )

Returns the USB serial number string.

unsigned int UsbConnector::getUsbVendorId ( )

Returns the USB device vendor ID.

bool UsbConnector::isConnected ( ) const
overridevirtual

Indicates whether the rx thread is still running, which means that the connector is connected.

Note: it is possible that the rx thread is still running and the connector is not connected, and there is typically a small delay before a socket exception is thrown and the rx thread is shutdown

Reimplemented from kdrive::baos::BaosConnector.

void UsbConnector::open ( int  index)

Opens a connection with the local device.

Parameters
indexis the last enumeration index

Member Data Documentation

const std::string UsbConnector::ConnectorTypeLabel
static
Initial value:
=
"\x62\x61\x6f\x73\x2e\x75\x73\x62"

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