libusb++ API Documentation

USB::Configuration Class Reference

Class representing a configuration of a Device. More...

#include <usbpp.h>

List of all members.

Public Member Functions

 Configuration ()
void dumpDescriptor (void)
 Configuration descriptor information output.
u_int8_t numInterfaces (void)
 Number of Interfaces that this device has.
InterfacefirstInterface (void)
 First Interface for the Configuration.
InterfacenextInterface (void)
 Next Interface for the Configuration.
InterfacelastInterface (void)
 Last Interface for the Configuration.

Friends

class Busses
 Busses is a friend because it fills in the descriptor type information on initialisation and rescan.


Detailed Description

Class representing a configuration of a Device.

The Configuration class represents a single configuration of a device attached to a Universal Serial Bus.

Author:
Brad Hards

Definition at line 308 of file usbpp.h.


Member Function Documentation

void USB::Configuration::dumpDescriptor ( void   ) 

Configuration descriptor information output.

This method dumps out the various characteristics of the configuration to standard output.

It is mostly useful for debugging.

Definition at line 356 of file usbpp.cpp.

u_int8_t USB::Configuration::numInterfaces ( void   ) 

Number of Interfaces that this device has.

This is a simple accessor method that specifies the number Interfaces that this device configuration has.

Definition at line 339 of file usbpp.cpp.

Referenced by USB::Busses::rescan().

Interface * USB::Configuration::firstInterface ( void   ) 

First Interface for the Configuration.

This method returns a pointer to the first Interface for the Configuration.

See nextInterface() for an example of how it might be used.

See also:
nextInterface(), lastInterface(), numInterfaces()

Definition at line 366 of file usbpp.cpp.

Interface * USB::Configuration::nextInterface ( void   ) 

Next Interface for the Configuration.

This method returns a pointer to the next Interface for the Configuration.

If you want to iterate through each Interface 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_Interface = this_Configuration->firstInterface();
     for (j=0; j < this_Configuration->numInterfaces(); j++) {
     // do something with this_Interface
     this_Interface = this_Configuration->nextInterface();
   }
   this_Configuration->nextConfiguration();
 }

See also:
firstInterface(), lastInterface(), numInterfaces()

Definition at line 372 of file usbpp.cpp.

Interface * USB::Configuration::lastInterface ( void   ) 

Last Interface for the Configuration.

This method returns a pointer to the last Interface for the Configuration.

See also:
firstInterface(), nextInterface(), numInterfaces()

Definition at line 380 of file usbpp.cpp.


Friends And Related Function Documentation

friend class Busses [friend]

Busses is a friend because it fills in the descriptor type information on initialisation and rescan.

Definition at line 313 of file usbpp.h.


The documentation for this class was generated from the following files:
This file is part of the documentation for libusb++ .
Documentation copyright © 2004 Brad Hards.
Generated on Tue Jan 23 03:59:44 2007 by doxygen 1.5.1 written by Dimitri van Heesch.