Detailed Description
The QUsbGadget class is the base class of all USB gadget classes.
QUsbGadget and derived classes provides information on the supported USB device classes and an API for controlling the USB gadget hardware. The USB gadget API is split into two sets of classes: the provider classes and the client classes. Both sets are subclasses of QUsbGadget.
The client classes provide an API for querying and controlling the USB gadget hardware. Client classes are created with the QAbstractIpcInterface::Client mode.
The provider classes implement the backend functionality that interfaces with the USB hardware. Provider classes are created with the QAbstractIpcInterface::Server mode. Qt Extended comes with an implementation for the standard Linux USB gadget stack. Support for custom USB gadget drivers is achieved by creating addition subclasses of QUsbGadget. Support for alternative USB gadget stacks is achieved by implementing alternative provider classes.
See also QUsbManager and UsbGadgetTask.
Member Function Documentation
QUsbGadget::QUsbGadget ( const QString & interfaceName, const QString & group = QString(), QObject * parent = 0, QAbstractIpcInterface::Mode mode = Client )
Constructs a new QUsbGadget object for the interface called interfaceName, on group and attach it to parent. If mode is Server then the object is constructed in server mode and register with QUsbManager. If mode is Client, then the object is constructed in client mode and group may be empty to indicate that the default group should be used. o
void QUsbGadget::activate () [virtual slot]
Activates the USB gadget. Deactivating other gadgets if necessary.
The activated() signal will be emitted to indicate that the USB gadget has been activated and is ready for use. On failure the deactivated() signal is emitted.
void QUsbGadget::activateFailed () [signal]
Signal which is emitted when the activation of this USB gadget fails.
void QUsbGadget::activated () [signal]
Signal which is emitted when this USB gadget activates.
bool QUsbGadget::active () const
Returns true if the USB gadget is active.
void QUsbGadget::deactivate () [virtual slot]
Deactivates the USB gadget.
The deactivated() signal will be emitted to indicate that the USB gadget has been deactivated. On failure the activated() signal is emitted.
void QUsbGadget::deactivateFailed () [signal]
Signal which is emitted when the deactivation of this USB gadget fails.
void QUsbGadget::deactivated () [signal]
Signal which is emitted when this USB gadget deactivates.
QByteArray QUsbGadget::gadget () const
Returns the name of the gadget. The value that is returned is the same as the Usb.conf settings group associated with this gadget.
QByteArray QUsbGadget::product () const
Returns the product string. Returns a null bytearray if supportsProduct() returns false.
See also setProduct().
quint16 QUsbGadget::productId () const
Returns the product id. Returns 0 if supportsProductId() returns false.
See also setProductId().
void QUsbGadget::saveConfig () [virtual slot]
Saves the settings to the Trolltech/Usb.conf configuration file.
void QUsbGadget::setProduct ( const QByteArray & product ) [virtual slot]
Sets the product string to product.
See also product().
void QUsbGadget::setProductId ( const quint16 id ) [virtual slot]
Sets the product id to id.
See also productId().
void QUsbGadget::setVendor ( const QByteArray & vendor ) [virtual slot]
Sets the vendor string to vendor.
See also vendor().
void QUsbGadget::setVendorId ( const quint16 id ) [virtual slot]
Sets the vendor id to id.
See also vendorId().
bool QUsbGadget::supportsProduct () const
Returns true if the USB gadget supports setting and getting the product string.
bool QUsbGadget::supportsProductId () const
Returns true if the USB gadget supports setting and getting the product id.
bool QUsbGadget::supportsVendor () const
Returns true if the USB gadget supports setting and getting the vendor string.
bool QUsbGadget::supportsVendorId () const
Returns true if the USB gadget supports setting and getting the vendor id.
QByteArray QUsbGadget::vendor () const
Returns the vendor string. Returns a null bytearray if supportsVendor() returns false.
See also setVendor().
quint16 QUsbGadget::vendorId () const
Returns the vendor id. Returns 0 if supportsVendorId() returns false.
See also setVendorId().