The UsbConnector is responsible for creating a SUB connection with the baos server.
More...
#include <UsbConnector.h>
|
static const std::string | ConnectorTypeLabel |
|
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" |
|
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)
UsbConnector::UsbConnector |
( |
| ) |
|
Creates a default (disconnected) USB baos connector.
UsbConnector::~UsbConnector |
( |
| ) |
|
|
virtual |
Closes the connections and destroys the connector.
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
-
index | is the last enumeration index |
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: