Class: MyHIDAPI::DeviceInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/myhidapi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vendor_id, product_id, path, serial_number, manufacturer_string, product_string, usage, interface_number) ⇒ DeviceInfo

Returns a new instance of DeviceInfo.



9
10
11
12
13
14
15
16
17
18
# File 'lib/myhidapi.rb', line 9

def initialize vendor_id, product_id, path, serial_number, manufacturer_string, product_string, usage, interface_number
  @vendor_id           = vendor_id
  @product_id          = product_id
  @path                = path
  @serial_number       = serial_number
  @manufacturer_string = manufacturer_string
  @product_string      = product_string
  @usage               = usage
  @interface_number    = interface_number
end

Instance Attribute Details

#interface_numberObject (readonly)

Returns the value of attribute interface_number.



7
8
9
# File 'lib/myhidapi.rb', line 7

def interface_number
  @interface_number
end

#manufacturer_stringObject (readonly)

Returns the value of attribute manufacturer_string.



7
8
9
# File 'lib/myhidapi.rb', line 7

def manufacturer_string
  @manufacturer_string
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/myhidapi.rb', line 7

def path
  @path
end

#product_idObject (readonly)

Returns the value of attribute product_id.



7
8
9
# File 'lib/myhidapi.rb', line 7

def product_id
  @product_id
end

#product_stringObject (readonly)

Returns the value of attribute product_string.



7
8
9
# File 'lib/myhidapi.rb', line 7

def product_string
  @product_string
end

#serial_numberObject (readonly)

Returns the value of attribute serial_number.



7
8
9
# File 'lib/myhidapi.rb', line 7

def serial_number
  @serial_number
end

#usageObject (readonly)

Returns the value of attribute usage.



7
8
9
# File 'lib/myhidapi.rb', line 7

def usage
  @usage
end

#vendor_idObject (readonly)

Returns the value of attribute vendor_id.



7
8
9
# File 'lib/myhidapi.rb', line 7

def vendor_id
  @vendor_id
end

Instance Method Details

#openObject



20
21
22
# File 'lib/myhidapi.rb', line 20

def open
  MyHIDAPI.open vendor_id, product_id
end