Module: LIBUSB
- Defined in:
- lib/libusb.rb,
lib/libusb/call.rb,
lib/libusb/device.rb,
lib/libusb/context.rb,
lib/libusb/setting.rb,
lib/libusb/endpoint.rb,
lib/libusb/transfer.rb,
lib/libusb/constants.rb,
lib/libusb/interface.rb,
lib/libusb/dev_handle.rb,
lib/libusb/version_gem.rb,
lib/libusb/eventmachine.rb,
lib/libusb/configuration.rb,
lib/libusb/version_struct.rb
Overview
This file is part of Libusb for Ruby.
Libusb for Ruby is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Libusb for Ruby is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Libusb for Ruby. If not, see <www.gnu.org/licenses/>.
Defined Under Namespace
Modules: Call Classes: BulkTransfer, Configuration, Context, ControlTransfer, DevHandle, Device, Endpoint, Error, Interface, InterruptTransfer, IsoPacket, IsochronousTransfer, Setting, Transfer, Version
Constant Summary collapse
- CONTROL_SETUP_SIZE =
8- DT_DEVICE_SIZE =
18- DT_CONFIG_SIZE =
9- DT_INTERFACE_SIZE =
9- DT_ENDPOINT_SIZE =
7- DT_ENDPOINT_AUDIO_SIZE =
Audio extension
9- DT_HUB_NONVAR_SIZE =
7- ENDPOINT_ADDRESS_MASK =
in bEndpointAddress
0x0f- ENDPOINT_DIR_MASK =
0x80- TRANSFER_TYPE_MASK =
in bmAttributes
0x03- ISO_SYNC_TYPE_MASK =
0x0C- ISO_USAGE_TYPE_MASK =
0x30- POLLIN =
1- POLLOUT =
4- HOTPLUG_MATCH_ANY =
Wildcard matching for hotplug events.
-1
- VERSION =
Library version of libusb for Ruby
"0.4.1"
Class Method Summary collapse
- .dev_string(base_class, sub_class, protocol) ⇒ Object
-
.has_capability?(capability) ⇒ Boolean
Check at runtime if the loaded library has a given capability.
- .raise_error(res, text) ⇒ Object
-
.version ⇒ Version
Get version of the underlying libusb library.
Class Method Details
.dev_string(base_class, sub_class, protocol) ⇒ Object
145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/libusb/constants.rb', line 145 def self.dev_string(base_class, sub_class, protocol) if desc = CLASS_CODES_HASH3[[base_class, sub_class, protocol]] desc elsif desc = CLASS_CODES_HASH2[[base_class, sub_class]] desc + " (%02x)" % [protocol] elsif desc = CLASS_CODES_HASH1[base_class] desc + " (%02x,%02x)" % [sub_class, protocol] else "Unknown(%02x,%02x,%02x)" % [base_class, sub_class, protocol] end end |
.has_capability?(capability) ⇒ Boolean
Check at runtime if the loaded library has a given capability. Available since libusb-1.0.9.
46 47 48 49 |
# File 'lib/libusb.rb', line 46 def self.has_capability?(capability) r = Call.libusb_has_capability(capability) return r != 0 end |
.raise_error(res, text) ⇒ Object
56 57 58 59 |
# File 'lib/libusb/constants.rb', line 56 def self.raise_error(res, text) klass = ErrorClassForResult[res] raise klass, "#{klass} #{text}" end |