Class: GPhoto2::PortInfo

Inherits:
Object
  • Object
show all
Includes:
FFI::GPhoto2Port, Struct
Defined in:
lib/gphoto2/port_info.rb

Constant Summary

Constants included from FFI::GPhoto2Port

FFI::GPhoto2Port::GPPortSerialParity, FFI::GPhoto2Port::GPPortType, FFI::GPhoto2Port::GP_ERROR, FFI::GPhoto2Port::GP_ERROR_BAD_PARAMETERS, FFI::GPhoto2Port::GP_ERROR_FIXED_LIMIT_EXCEEDED, FFI::GPhoto2Port::GP_ERROR_HAL, FFI::GPhoto2Port::GP_ERROR_IO, FFI::GPhoto2Port::GP_ERROR_IO_INIT, FFI::GPhoto2Port::GP_ERROR_IO_LOCK, FFI::GPhoto2Port::GP_ERROR_IO_READ, FFI::GPhoto2Port::GP_ERROR_IO_SERIAL_SPEED, FFI::GPhoto2Port::GP_ERROR_IO_SUPPORTED_SERIAL, FFI::GPhoto2Port::GP_ERROR_IO_SUPPORTED_USB, FFI::GPhoto2Port::GP_ERROR_IO_UPDATE, FFI::GPhoto2Port::GP_ERROR_IO_USB_CLAIM, FFI::GPhoto2Port::GP_ERROR_IO_USB_CLEAR_HALT, FFI::GPhoto2Port::GP_ERROR_IO_USB_FIND, FFI::GPhoto2Port::GP_ERROR_IO_WRITE, FFI::GPhoto2Port::GP_ERROR_LIBRARY, FFI::GPhoto2Port::GP_ERROR_NOT_SUPPORTED, FFI::GPhoto2Port::GP_ERROR_NO_MEMORY, FFI::GPhoto2Port::GP_ERROR_TIMEOUT, FFI::GPhoto2Port::GP_ERROR_UNKNOWN_PORT, FFI::GPhoto2Port::GP_OK

Instance Attribute Summary

Attributes included from Struct

#ptr

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Struct

#to_ptr

Constructor Details

#initialize(port_info_list, index) ⇒ PortInfo

Returns a new instance of PortInfo.

Parameters:



16
17
18
19
20
# File 'lib/gphoto2/port_info.rb', line 16

def initialize(port_info_list, index)
  @port_info_list = port_info_list
  @index = index
  new
end

Class Method Details

.find(port) ⇒ GPhoto2::PortInfo

Parameters:

  • port (String)

Returns:



8
9
10
11
12
# File 'lib/gphoto2/port_info.rb', line 8

def self.find(port)
  port_info_list = PortInfoList.new
  index = port_info_list.lookup_path(port)
  port_info_list[index]
end

Instance Method Details

#nameString

Returns:

  • (String)


23
24
25
# File 'lib/gphoto2/port_info.rb', line 23

def name
  get_name
end

#pathString

Returns:

  • (String)


28
29
30
# File 'lib/gphoto2/port_info.rb', line 28

def path
  get_path
end

#typeGPPortType

Returns:



33
34
35
# File 'lib/gphoto2/port_info.rb', line 33

def type
  get_type
end