Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

device::usb::bus(3pm) [debian man page]

Device::USB::Bus(3pm)					User Contributed Perl Documentation				     Device::USB::Bus(3pm)

NAME
Device::USB::Bus - Use libusb to access USB devices. VERSION
Version 0.12 SYNOPSIS
This class encapsulates the USB bus structure and provides methods for retrieving data from it. This class is not meant to be used alone, it is part of the Device::USB package. Device:USB:LibUSB provides a Perl wrapper around the libusb library. This supports Perl code controlling and accessing USB devices. use Device::USB; my $usb = Device::USB->new(); foreach my $bus ($usb->list_busses()) { print $bus->dirname(), ": "; foreach my $dev ($bus->devices()) { print " ", $dev->filename(), " "; } } DESCRIPTION
This module provides a Perl interface to the bus structures returned by the libusb library. This library supports a read-only interface to the data libusb returns about a USB bus. FUNCTIONS
dirname Return the directory name associated with this bus. location Return the location value associated with this bus. devices In array context, it returns a list of Device::USB::Device objects representing all of the devices on this bus. In scalar context, it returns a reference to that array. find_device_if Find a particular USB device based on the supplied predicate coderef. If more than one device would satisfy the predicate, the first one found is returned. pred the predicate used to select a device returns a device reference or undef if none was found. list_devices_if This method provides a flexible interface for finding devices. It takes a single coderef parameter that is used to test each discovered device. If the coderef returns a true value, the device is returned in the list of matching devices, otherwise it is not. pred coderef to test devices. For example, my @devices = $bus->list_devices_if( sub { Device::USB::CLASS_HUB == $_->bDeviceClass() } ); Returns all USB hubs found on this bus. The device to test is available to the coderef in the $_ variable for simplicity. DIAGNOSTICS
This is an explanation of the diagnostic and error messages this module can generate. DEPENDENCIES
This module depends on the Carp and Device::USB, as well as the strict and warnings pragmas. Obviously, libusb must be available since that is the entire reason for the module's existence. AUTHOR
G. Wade Johnson (wade at anomaly dot org) Paul Archer (paul at paularcher dot org) Houston Perl Mongers Group BUGS
Please report any bugs or feature requests to "bug-device-usb@rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Device::USB>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. ACKNOWLEDGEMENTS
Thanks go to various members of the Houston Perl Mongers group for input on the module. But thanks mostly go to Paul Archer who proposed the project and helped with the development. Thanks also go to Josep MonA~Xs Teixidor, Mike McCauley, and Tony Awtrey for spotting, reporting, and (sometimes) fixing bugs. COPYRIGHT &; LICENSE Copyright 2006 Houston Perl Mongers This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2006-09-17 Device::USB::Bus(3pm)

Check Out this Related Man Page

USB(4)                                                     BSD Kernel Interfaces Manual                                                     USB(4)

NAME
usb -- Universal Serial Bus SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device usb Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): usb_load="YES" USERLAND PROGRAMMING
USB functions can be accessed from userland through the libusb library. See libusb(3) for more information. DESCRIPTION
FreeBSD provides machine-independent bus support and drivers for USB devices in host and device side mode. The usb driver has three layers: USB Controller (Bus) USB Device USB Driver The controller attaches to a physical bus like pci(4). The USB bus attaches to the controller, and the root hub attaches to the controller. Any devices attached to the bus will attach to the root hub or another hub attached to the USB bus. The uhub device will always be present as it is needed for the root hub. INTRODUCTION TO USB
The USB is a system where external devices can be connected to a PC. The most common USB speeds are: Low Speed (1.5MBit/sec) Full Speed (12MBit/sec) High Speed (480MBit/sec) Each USB has a USB controller that is the master of the bus. The physical communication is simplex which means the host controller only com- municates with one USB device at a time. There can be up to 127 devices connected to an USB HUB tree. The addresses are assigned dynamically by the host when each device is attached to the bus. Within each device there can be up to 16 endpoints. Each endpoint is individually addressed and the addresses are static. Each of these endpoints will communicate in one of four different modes: control, isochronous, bulk, or interrupt. A device always has at least one end- point. This endpoint has address 0 and is a control endpoint and is used to give commands to and extract basic data, such as descriptors, from the device. Each endpoint, except the control endpoint, is unidirectional. The endpoints in a device are grouped into interfaces. An interface is a logical unit within a device; e.g. a compound device with both a keyboard and a trackball would present one interface for each. An interface can sometimes be set into different modes, called alternate set- tings, which affects how it operates. Different alternate settings can have different endpoints within it. A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. The bus enumeration of the USB bus proceeds in several steps: 1. Any interface specific driver can attach to the device. 2. If none is found, generic interface class drivers can attach. SEE ALSO
The USB specifications can be found at: http://www.usb.org/developers/docs/ libusb(3), usbdi(4), aue(4), axe(4), cue(4), ehci(4), kue(4), ohci(4), pci(4), rue(4), ucom(4), udav(4), uhci(4), uhid(4), ukbd(4), ulpt(4), umass(4), ums(4), uplcom(4), urio(4), uvscom(4), usbconfig(8) STANDARDS
The usb module complies with the USB 2.0 standard. HISTORY
The usb module has been inspired by the NetBSD USB stack initially written by Lennart Augustsson. The usb module was written by Hans Petter Selasky <hselasky@freebsd.org>. BSD May 20, 2009 BSD
Man Page