Class: UVC::SelectorUnitDescriptor

Inherits:
ClassSpecificVCInterfaceDescriptor show all
Defined in:
lib/uvc.rb

Instance Attribute Summary collapse

Attributes inherited from ClassSpecificVCInterfaceDescriptor

#bDescriptorSubType, #bDescriptorType, #rest

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ClassSpecificVCInterfaceDescriptor

parse_array, #short_inspect

Constructor Details

#initialize(bDescriptorType, bDescriptorSubType, bUnitID, bNrInPins, baSourceID, iSelector) ⇒ SelectorUnitDescriptor

Returns a new instance of SelectorUnitDescriptor.



480
481
482
483
484
485
486
# File 'lib/uvc.rb', line 480

def initialize(bDescriptorType, bDescriptorSubType, bUnitID, bNrInPins, baSourceID, iSelector)
	super(bDescriptorType, bDescriptorSubType)
	@bUnitID = bUnitID
	@bNrInPins = bNrInPins
	@baSourceID = baSourceID
	@iSelector = iSelector
end

Instance Attribute Details

#baSourceIDObject (readonly)

Returns the value of attribute baSourceID.



468
469
470
# File 'lib/uvc.rb', line 468

def baSourceID
  @baSourceID
end

#bNrInPinsObject (readonly)

Returns the value of attribute bNrInPins.



467
468
469
# File 'lib/uvc.rb', line 467

def bNrInPins
  @bNrInPins
end

#bUnitIDObject (readonly)

Returns the value of attribute bUnitID.



466
467
468
# File 'lib/uvc.rb', line 466

def bUnitID
  @bUnitID
end

#iSelectorObject (readonly)

Returns the value of attribute iSelector.



469
470
471
# File 'lib/uvc.rb', line 469

def iSelector
  @iSelector
end

Class Method Details

.parse(bDescriptorType, bDescriptorSubType, rest) ⇒ Object



471
472
473
474
475
476
477
478
# File 'lib/uvc.rb', line 471

def self.parse(bDescriptorType, bDescriptorSubType, rest)
	bUnitID, bNrInPins, *baSourceID = *rest.unpack("ccc*")
	iSelector = nil
	if baSourceID.size >= bNrInPins
		iSelector = baSourceID.pop
	end
	self.new(bDescriptorType, bDescriptorSubType, bUnitID, bNrInPins, baSourceID, iSelector)
end