Class: UVC::InputTerminalDescriptor

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

Direct Known Subclasses

CameraTerminalDescriptor

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

Constructor Details

#initialize(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest = nil) ⇒ InputTerminalDescriptor

Returns a new instance of InputTerminalDescriptor.



316
317
318
319
320
321
322
323
# File 'lib/uvc.rb', line 316

def initialize(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest=nil)
	super(bDescriptorType, bDescriptorSubType)
	@bTerminalID = bTerminalID
	@wTerminalType = wTerminalType
	@bAssocTerminal = bAssocTerminal
	@iTerminal = iTerminal
	@rest = rest
end

Instance Attribute Details

#bAssocTerminalObject (readonly)

Returns the value of attribute bAssocTerminal.



303
304
305
# File 'lib/uvc.rb', line 303

def bAssocTerminal
  @bAssocTerminal
end

#bTerminalIDObject (readonly)

Returns the value of attribute bTerminalID.



301
302
303
# File 'lib/uvc.rb', line 301

def bTerminalID
  @bTerminalID
end

#iTerminalObject (readonly)

Returns the value of attribute iTerminal.



304
305
306
# File 'lib/uvc.rb', line 304

def iTerminal
  @iTerminal
end

#wTerminalTypeObject (readonly)

Returns the value of attribute wTerminalType.



302
303
304
# File 'lib/uvc.rb', line 302

def wTerminalType
  @wTerminalType
end

Class Method Details

.parse(bDescriptorType, bDescriptorSubType, rest) ⇒ Object



306
307
308
309
310
311
312
313
314
# File 'lib/uvc.rb', line 306

def self.parse(bDescriptorType, bDescriptorSubType, rest)
	bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest = *rest.unpack("cvcca*")
	case wTerminalType
	when ITT_CAMERA
		CameraTerminalDescriptor.parse(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest)
	else
		self.new(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest)
	end
end

Instance Method Details

#bUnitIDObject



325
326
327
# File 'lib/uvc.rb', line 325

def bUnitID
	@bTerminalID
end

#short_inspectObject



329
330
331
332
333
334
# File 'lib/uvc.rb', line 329

def short_inspect
	"%s bUnitID=%d" % [
		self.class.name.sub(/Descriptor$/, ''),
		self.bUnitID
	]
end