libusb++ API Documentation

USB::Busses Class Reference

Class representing all the busses on the machine. More...

#include <usbpp.h>

List of all members.

Public Member Functions

 Busses ()
void rescan (void)
 Update method.
std::list< Device * > match (u_int8_t Class)
 find all devices with matching device class designator
std::list< Device * > match (DeviceIDList)
 find all devices with matching device IDs


Detailed Description

Class representing all the busses on the machine.

This class is essentially a list of Bus class instances

Definition at line 789 of file usbpp.h.


Member Function Documentation

void USB::Busses::rescan ( void   ) 

Update method.

This method can be called to rescan the various devices attached to the various busses. You should use it to update if things change. Unfortunately there is no way to automatically detect this change in a portable way, so worst case is that you need to call this using some kind of timer in the background.

Definition at line 26 of file usbpp.cpp.

References USB::Interface::numAltSettings(), USB::Device::numConfigurations(), USB::AltSetting::numEndpoints(), USB::Configuration::numInterfaces(), USB::Endpoint::setDescriptor(), USB::AltSetting::setDescriptor(), USB::Configuration::setDescriptor(), USB::Device::setDescriptor(), USB::Device::setDevHandle(), USB::Bus::setDirectoryName(), USB::Device::setFileName(), USB::Interface::setInterfaceNumber(), USB::Interface::setNumAltSettings(), USB::Endpoint::setParent(), USB::Interface::setParent(), USB::Device::setProduct(), USB::Device::setSerialNumber(), USB::Device::setVendor(), and USB::Device::string().

Referenced by Busses().

std::list< Device * > USB::Busses::match ( u_int8_t  Class  ) 

find all devices with matching device class designator

This method searches every device on every bus, and returns a list of pointers to the devices that have a matching device class code

Definition at line 113 of file usbpp.cpp.

std::list< Device * > USB::Busses::match ( DeviceIDList   ) 

find all devices with matching device IDs

This method searches every device on every bus, and returns a list of pointers to the devices that have a matching device ID. That is, if the (vendor, product) tuple of a device matches one of the tuples on the list, then the device will be added to the list of matches.

An example of usage is shown below:

 USB::Busses buslist;
 USB::Device *device;
 std::list<USB::Device> miceFound;
 USB::DeviceIDList mouseList;

 mouseList.append(USB::DeviceID(VENDOR_LOGITECH, 0xC00E)); // Wheel Mouse Optical
 mouseList.append(USB::DeviceID(VENDOR_LOGITECH, 0xC012)); // MouseMan Dual Optical
 mouseList.append(USB::DeviceID(VENDOR_LOGITECH, 0xC506)); // MX700 Optical Mouse

 miceFound = buslist.match(mouseList);

 for ( device = miceFound.first(); device; device = miceFound.next() ) {
     // do something with each mouse that matched
 }
 FIXME: This is incorrect now

Definition at line 133 of file usbpp.cpp.


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 00:19:42 2007 by doxygen 1.5.1 written by Dimitri van Heesch.