USB::Interface Class Reference
Class representing an interface of a Device. More...
#include <usbpp.h>
Inherits list.

Public Member Functions | |
int | driverName (std::string &driver) |
get the current driver for an interface | |
u_int8_t | numAltSettings (void) |
Number of Alternative Settings that this interface has. | |
AltSetting * | firstAltSetting (void) |
First AltSetting for the Interface. | |
AltSetting * | nextAltSetting (void) |
Next AltSetting for the Interface. | |
AltSetting * | lastAltSetting (void) |
Last AltSetting for the Interface. | |
Friends | |
class | Busses |
Busses is a friend because it fills in the descriptor type information on initialisation and rescan. |
Detailed Description
Class representing an interface of a Device.The Interface class represents a USB interface for a device attached to a Universal Serial Bus.
Interfaces are the main element of the USB class structure.
Definition at line 165 of file usbpp.h.
Member Function Documentation
int USB::Interface::driverName | ( | std::string & | driver | ) |
get the current driver for an interface
- Parameters:
-
driver a string containing the name of the current driver for the interface. You can typically pass in an empty string for this.
- Returns:
- length of string, or 0 on error.
Definition at line 386 of file usbpp.cpp.
References USB::Device::handle().
u_int8_t USB::Interface::numAltSettings | ( | void | ) |
Number of Alternative Settings that this interface has.
This is a simple accessor method that specifies the number alternative settings that this device interface has.
Definition at line 418 of file usbpp.cpp.
Referenced by USB::Busses::rescan().
AltSetting * USB::Interface::firstAltSetting | ( | void | ) |
First AltSetting for the Interface.
This method returns a pointer to the first AltSetting for the Interface.
See nextAltSetting() for an example of how it might be used.
- See also:
- nextAltSetting(), lastAltSetting(), numAltSettings()
AltSetting * USB::Interface::nextAltSetting | ( | void | ) |
Next AltSetting for the Interface.
This method returns a pointer to the next AltSetting for the Interface.
If you want to iterate through each AltSetting on a device, you can use something like the following:
USB::Configuration *this_Configuration; this_Configuration = device->firstConfiguration(); for (i=0; i < device->numConfigurations(); i++) { this_Configuration->dumpDescriptor(); USB::Interface *this_Interface; this_Interface = this_Configuration->firstInterface(); for (j=0; j < this_Configuration->numInterfaces(); j++) { USB::AltSetting *this_AltSetting; this_AltSetting = this_Interface->firstAltSetting(); for (k=0; k < this_Interface->numAltSettings(); k++) { // do something with this_AltSetting this_AltSetting = this_Interface->nextAltSetting(); } this_Interface = this_Configuration->nextInterface(); } this_Configuration = device->nextConfiguration(); }
- See also:
- firstAltSetting(), lastAltSetting(), numAltSettings()
AltSetting * USB::Interface::lastAltSetting | ( | void | ) |
Last AltSetting for the Interface.
This method returns a pointer to the last AltSetting for the Interface.
- See also:
- firstAltSetting(), nextAltSetting(), numAltSettings()
Friends And Related Function Documentation
friend class Busses [friend] |
The documentation for this class was generated from the following files: