Class: UVC::ExtensionUnitDescriptor
- Inherits:
-
ClassSpecificVCInterfaceDescriptor
- Object
- ClassSpecificVCInterfaceDescriptor
- UVC::ExtensionUnitDescriptor
- Defined in:
- lib/uvc.rb
Instance Attribute Summary collapse
-
#baSourceID ⇒ Object
readonly
Returns the value of attribute baSourceID.
-
#bControlSize ⇒ Object
readonly
Returns the value of attribute bControlSize.
-
#bmControls ⇒ Object
readonly
Returns the value of attribute bmControls.
-
#bNrInPins ⇒ Object
readonly
Returns the value of attribute bNrInPins.
-
#bNumControls ⇒ Object
readonly
Returns the value of attribute bNumControls.
-
#bUnitID ⇒ Object
readonly
Returns the value of attribute bUnitID.
-
#guidExtensionCode ⇒ Object
readonly
Returns the value of attribute guidExtensionCode.
-
#iExtension ⇒ Object
readonly
Returns the value of attribute iExtension.
Attributes inherited from ClassSpecificVCInterfaceDescriptor
#bDescriptorSubType, #bDescriptorType, #rest
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bDescriptorType, bDescriptorSubType, bUnitID, guidExtensionCode, bNumControls, bNrInPins, baSourceID, bControlSize, bmControls, iExtension) ⇒ ExtensionUnitDescriptor
constructor
A new instance of ExtensionUnitDescriptor.
- #short_inspect ⇒ Object
Methods inherited from ClassSpecificVCInterfaceDescriptor
Constructor Details
#initialize(bDescriptorType, bDescriptorSubType, bUnitID, guidExtensionCode, bNumControls, bNrInPins, baSourceID, bControlSize, bmControls, iExtension) ⇒ ExtensionUnitDescriptor
Returns a new instance of ExtensionUnitDescriptor.
627 628 629 630 631 632 633 634 635 636 637 |
# File 'lib/uvc.rb', line 627 def initialize(bDescriptorType, bDescriptorSubType, bUnitID, guidExtensionCode, bNumControls, bNrInPins, baSourceID, bControlSize, bmControls, iExtension) super(bDescriptorType, bDescriptorSubType) @bUnitID = bUnitID @guidExtensionCode = guidExtensionCode @bNumControls = bNumControls @bNrInPins = bNrInPins @baSourceID = baSourceID @bControlSize = bControlSize @bmControls = bmControls @iExtension = iExtension end |
Instance Attribute Details
#baSourceID ⇒ Object (readonly)
Returns the value of attribute baSourceID.
611 612 613 |
# File 'lib/uvc.rb', line 611 def baSourceID @baSourceID end |
#bControlSize ⇒ Object (readonly)
Returns the value of attribute bControlSize.
612 613 614 |
# File 'lib/uvc.rb', line 612 def bControlSize @bControlSize end |
#bmControls ⇒ Object (readonly)
Returns the value of attribute bmControls.
613 614 615 |
# File 'lib/uvc.rb', line 613 def bmControls @bmControls end |
#bNrInPins ⇒ Object (readonly)
Returns the value of attribute bNrInPins.
610 611 612 |
# File 'lib/uvc.rb', line 610 def bNrInPins @bNrInPins end |
#bNumControls ⇒ Object (readonly)
Returns the value of attribute bNumControls.
609 610 611 |
# File 'lib/uvc.rb', line 609 def bNumControls @bNumControls end |
#bUnitID ⇒ Object (readonly)
Returns the value of attribute bUnitID.
607 608 609 |
# File 'lib/uvc.rb', line 607 def bUnitID @bUnitID end |
#guidExtensionCode ⇒ Object (readonly)
Returns the value of attribute guidExtensionCode.
608 609 610 |
# File 'lib/uvc.rb', line 608 def guidExtensionCode @guidExtensionCode end |
#iExtension ⇒ Object (readonly)
Returns the value of attribute iExtension.
614 615 616 |
# File 'lib/uvc.rb', line 614 def iExtension @iExtension end |
Class Method Details
.parse(bDescriptorType, bDescriptorSubType, rest) ⇒ Object
616 617 618 619 620 621 622 623 624 625 |
# File 'lib/uvc.rb', line 616 def self.parse(bDescriptorType, bDescriptorSubType, rest) bUnitID, guidExtensionCode, bNumControls, bNrInPins, rest = *rest.unpack("ca16cca*") *baSourceID, rest = *rest.unpack("c#{bNrInPins}a*") bControlSize, rest = *rest.unpack("ca*") bmControls, iExtension = *rest.unpack("B#{bControlSize*8}c") guidExtensionCode = guidExtensionCode.unpack("H8 H4 H4 H4 H12").join("-") self.new(bDescriptorType, bDescriptorSubType, bUnitID, guidExtensionCode, bNumControls, bNrInPins, baSourceID, bControlSize, bmControls, iExtension) end |
Instance Method Details
#short_inspect ⇒ Object
639 640 641 642 643 644 645 |
# File 'lib/uvc.rb', line 639 def short_inspect "%s bUnitID=%d\n %s" % [ self.class.name.sub(/Descriptor$/, ''), self.bUnitID, self.guidExtensionCode ] end |