Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QUsbStorageGadget Class Reference

The QUsbStorageGadget class is used to enable mass storage class of USB gadgets. More...

    #include <QUsbStorageGadget>

Inherits QUsbGadget.

Inherited by QUsbStorageGadgetProvider.

Public Functions

Public Slots

Additional Inherited Members

Detailed Description

The QUsbStorageGadget class is used to enable mass storage class of USB gadgets.

The QUsbStorageGadget class is used to configure the USB gadget hardware as a USB mass storage device.

The following code will export the block device, /dev/sda.

    QUsbStorageGadget *storage = QUsbStorageGadget;
    if (gadget->available()) {
        connect(gadget, SIGNAL(activated()), this, SLOT(storageActivated()));
        gadget->setBackingStore(QStringList() << "/dev/sda");

Warning: Filesystem drivers in most operating systems expect exclusive access to the underlying block device. Any modification to the on disk data structures that do not go through the filesystem layer can result in data losses and system crashes. Therefore it is important that the backing store block devices are unmounted prior to activating the USB storage gadget.

See also QUsbManager and UsbGadgetTask.

Member Function Documentation

QUsbStorageGadget::QUsbStorageGadget ( const QString & group = QString(), QObject * parent = 0, QAbstractIpcInterface::Mode mode = Client )

Constructs a new QUsbStorageGadget object in group and attach it to parent. 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.

void QUsbStorageGadget::addBackingStore ( const QString & path )   [virtual slot]

Adds device path to the list of backing stores.

QStringList QUsbStorageGadget::backingStore () const

Returns the list of devices that will be used as the backing store.

See also setBackingStore().

void QUsbStorageGadget::removeBackingStore ( const QString & path )   [virtual slot]

Removes device path from the list of backing stores.

void QUsbStorageGadget::setBackingStore ( const QStringList & paths )   [virtual slot]

Sets the list of backing store devices to paths.

See also backingStore().

Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3