Skip to content

Inscoper::USBConnectionConfig

USBConnectionConfig class provides required information for USB devices configuration. More...

#include <USBConnectionConfig.h>

Inherits from Inscoper::ConnectionConfig

Public Functions

Name
USBConnectionConfig()
Default constructor.
virtual void fromXML(Inscoper::XMLNode & connectionNode) override
Provide USB connection information from the XML node.
virtual void toXML(Inscoper::XMLNode & xmlParent) override
Export USB connection information in an XML node attached to the parent XML node.
virtual Inscoper::EConnectionType getType() override
Return the type of connection.
unsigned int getMatchBitField() const
Get the bit field.
void setMatchBitField(unsigned int matchBitField)
Set the bit field.
unsigned short getVid() const
Get the VID.
void setVid(unsigned short vid)
Set the VID.
unsigned short getPid() const
Get the PID.
void setPid(unsigned short pid)
Set the PID.
const std::string & getManufacturer() const
Get the manufacturer name.
void setManufacturer(const std::string & manufacturer)
Set the manufacturer name.
const std::string & getProduct() const
Get the product name.
void setProduct(const std::string & product)
Set the product name.
const std::string & getSerialNumber() const
Get the serial number.
void setSerialNumber(const std::string & serialNumber)
Set the serial number.
const std::string & getWaitingAns() const
Get the waiting answer.
void setWaitingAns(const std::string & waitingAns)
Set the waiting answer.
unsigned char getNumInterface() const
Get the interface number.
void setNumInterface(unsigned char numInterface)
Set the interface number.
unsigned short getSubDeviceTag() const
Get the sub-device tag.
void setSubDeviceTag(unsigned short subDeviceTag)
Set the sub-device tag.

Additional inherited members

Public Functions inherited from Inscoper::ConnectionConfig

Name
ConnectionConfig()
Constructor.
ConnectionConfig(unsigned char tag)
Constructor.
virtual ~ConnectionConfig()
Default destructor.
unsigned short getTag() const
Get the tag of the current connection.
void setTag(unsigned short tag)
Set the tag of the current connection.

Detailed Description

class Inscoper::USBConnectionConfig;

USBConnectionConfig class provides required information for USB devices configuration.

Note: This class is non-copyable and non-movable.

This class extends ConnectionConfig to manage USB-specific settings including Vendor ID (VID), Product ID (PID), serial number.

Public Functions Documentation

function USBConnectionConfig

USBConnectionConfig()

Default constructor.

Initializes a new instance of the USBConnectionConfig class.

function fromXML

virtual void fromXML(
    Inscoper::XMLNode & connectionNode
) override

Provide USB connection information from the XML node.

Parameters:

  • connectionNode : The XML node containing USB connection information

Exceptions:

Reimplements: Inscoper::ConnectionConfig::fromXML

Populates the USB connection configuration from the provided XML node.

function toXML

virtual void toXML(
    Inscoper::XMLNode & xmlParent
) override

Export USB connection information in an XML node attached to the parent XML node.

Parameters:

  • xmlParent : The parent XML node

Exceptions:

Reimplements: Inscoper::ConnectionConfig::toXML

Serializes the USB connection configuration to the specified parent XML node.

function getType

virtual Inscoper::EConnectionType getType() override

Return the type of connection.

Return: The type of connection

Reimplements: Inscoper::ConnectionConfig::getType

Retrieves the specific type of connection configuration (USB).

function getMatchBitField

unsigned int getMatchBitField() const

Get the bit field.

Return: The bit field

Retrieves the bit field used to identify the USB device among those connected to the device controller.

function setMatchBitField

void setMatchBitField(
    unsigned int matchBitField
)

Set the bit field.

Parameters:

  • matchBitField The bit field to set

Sets the bit field used to identify the USB device among those connected to the device controller.

Bit field definitions:

  • MATCH_USB_VID 0x00000001
  • MATCH_USB_PID 0x00000002
  • MATCH_USB_IMANUFACTURER 0x00000004
  • MATCH_USB_IPRODUCT 0x00000008
  • MATCH_USB_ISERIALNUMBER 0x00000010
  • MATCH_USB_FUNCTION 0x00000020
  • MATCH_USB_NUM_INTERFACE 0x00000040

function getVid

unsigned short getVid() const

Get the VID.

Return: The VID

Retrieves the Vendor ID (VID) of the USB device.

function setVid

void setVid(
    unsigned short vid
)

Set the VID.

Parameters:

  • vid : The VID

Sets the Vendor ID (VID) of the USB device.

function getPid

unsigned short getPid() const

Get the PID.

Return: The PID

Retrieves the Product ID (PID) of the USB device.

function setPid

void setPid(
    unsigned short pid
)

Set the PID.

Parameters:

  • pid : The PID

Sets the Product ID (PID) of the USB device.

function getManufacturer

const std::string & getManufacturer() const

Get the manufacturer name.

Return: The manufacturer name

Retrieves the manufacturer name of the USB device.

function setManufacturer

void setManufacturer(
    const std::string & manufacturer
)

Set the manufacturer name.

Parameters:

  • manufacturer : The manufacturer name

Sets the manufacturer name of the USB device.

function getProduct

const std::string & getProduct() const

Get the product name.

Return: The product name

Retrieves the product name of the USB device.

function setProduct

void setProduct(
    const std::string & product
)

Set the product name.

Parameters:

  • product : The product name

Sets the product name of the USB device.

function getSerialNumber

const std::string & getSerialNumber() const

Get the serial number.

Return: The serial number

Retrieves the serial number of the USB device.

function setSerialNumber

void setSerialNumber(
    const std::string & serialNumber
)

Set the serial number.

Parameters:

  • serialNumber : The serial number

Sets the serial number of the USB device.

function getWaitingAns

const std::string & getWaitingAns() const

Get the waiting answer.

Return: The waiting answer

Retrieves the expected response string (to differentiate devices with identical USB parameters).

function setWaitingAns

void setWaitingAns(
    const std::string & waitingAns
)

Set the waiting answer.

Parameters:

  • waitingAns : The waiting answer

Sets the expected response string (to differentiate devices with identical USB parameters).

function getNumInterface

unsigned char getNumInterface() const

Get the interface number.

Return: The interface number

Retrieves the interface number on the USB device.

function setNumInterface

void setNumInterface(
    unsigned char numInterface
)

Set the interface number.

Parameters:

  • numInterface : The interface number

Sets the interface number on the USB device.

function getSubDeviceTag

unsigned short getSubDeviceTag() const

Get the sub-device tag.

Return: The sub-device tag

Retrieves the tag of the sub-device used to differentiate devices with identical USB parameters.

function setSubDeviceTag

void setSubDeviceTag(
    unsigned short subDeviceTag
)

Set the sub-device tag.

Parameters:

  • subDeviceTag : The sub-device tag

Sets the tag of the sub-device used to differentiate devices with identical USB parameters.


Updated on 2026-04-02 at 10:55:36 +0200