USBConnectionConfig¶
Bases: ConnectionConfig
USBConnectionConfig class provides required information for USB devices configuration.
Notes: 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.
__init__()
¶
Default constructor.
Initializes a new instance of the USBConnectionConfig class.
fromXML(connectionNode)
¶
Provide USB connection information from the XML node.
Populates the USB connection configuration from the provided XML node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connectionNode
|
XMLNode
|
The XML node containing USB connection information |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurred |
toXML(xmlParent)
¶
Export USB connection information in an XML node attached to the parent XML node.
Serializes the USB connection configuration to the specified parent XML node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xmlParent
|
XMLNode
|
The parent XML node |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurred |
getType()
¶
Return the type of connection.
Retrieves the specific type of connection configuration (USB).
Returns:
| Type | Description |
|---|---|
int
|
The type of connection |
getMatchBitField()
¶
Get the bit field.
Retrieves the bit field used to identify the USB device among those connected to the device controller.
Returns:
| Type | Description |
|---|---|
int
|
The bit field |
setMatchBitField(matchBitField)
¶
Set the bit field.
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
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matchBitField
|
int
|
The bit field to set |
required |
getVid()
¶
Get the VID.
Retrieves the Vendor ID (VID) of the USB device.
Returns:
| Type | Description |
|---|---|
int
|
The VID |
setVid(vid)
¶
Set the VID.
Sets the Vendor ID (VID) of the USB device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vid
|
int
|
The VID |
required |
getPid()
¶
Get the PID.
Retrieves the Product ID (PID) of the USB device.
Returns:
| Type | Description |
|---|---|
int
|
The PID |
setPid(pid)
¶
Set the PID.
Sets the Product ID (PID) of the USB device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
The PID |
required |
getManufacturer()
¶
Get the manufacturer name.
Retrieves the manufacturer name of the USB device.
Returns:
| Type | Description |
|---|---|
str
|
The manufacturer name |
setManufacturer(manufacturer)
¶
Set the manufacturer name.
Sets the manufacturer name of the USB device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manufacturer
|
string
|
The manufacturer name |
required |
getProduct()
¶
Get the product name.
Retrieves the product name of the USB device.
Returns:
| Type | Description |
|---|---|
str
|
The product name |
setProduct(product)
¶
Set the product name.
Sets the product name of the USB device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product
|
string
|
The product name |
required |
getSerialNumber()
¶
Get the serial number.
Retrieves the serial number of the USB device.
Returns:
| Type | Description |
|---|---|
str
|
The serial number |
setSerialNumber(serialNumber)
¶
Set the serial number.
Sets the serial number of the USB device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serialNumber
|
string
|
The serial number |
required |
getWaitingAns()
¶
Get the waiting answer.
Retrieves the expected response string (to differentiate devices with identical USB parameters).
Returns:
| Type | Description |
|---|---|
str
|
The waiting answer |
setWaitingAns(waitingAns)
¶
Set the waiting answer.
Sets the expected response string (to differentiate devices with identical USB parameters).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waitingAns
|
string
|
The waiting answer |
required |
getNumInterface()
¶
Get the interface number.
Retrieves the interface number on the USB device.
Returns:
| Type | Description |
|---|---|
int
|
The interface number |
setNumInterface(numInterface)
¶
Set the interface number.
Sets the interface number on the USB device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
numInterface
|
int
|
The interface number |
required |
getSubDeviceTag()
¶
Get the sub-device tag.
Retrieves the tag of the sub-device used to differentiate devices with identical USB parameters.
Returns:
| Type | Description |
|---|---|
int
|
The sub-device tag |
setSubDeviceTag(subDeviceTag)
¶
Set the sub-device tag.
Sets the tag of the sub-device used to differentiate devices with identical USB parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subDeviceTag
|
int
|
The sub-device tag |
required |