Class: Phidgets::IR::IR_code_info

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/phidgets-ffi/ir.rb

Overview

This represents the encoding parameters needed to transmit a code.

Examples:

puts ir.code_info[:bit_count]
puts ir.code_info[:encoding]	
puts ir.code_info[:length]
puts ir.code_info[:gap]
puts ir.code_info[:trail]
puts ir.code_info[:header]
puts ir.code_info[:one]
puts ir.code_info[:zero]
puts ir.code_info[:repeat]
puts ir.code_info[:min_repeat]
puts ir.code_info[:toggle_mask]
puts ir.code_info[:carrier_frequency]
puts ir.code_info[:duty_cycle]

Instance Attribute Summary collapse

Instance Attribute Details

#bit_countInteger

Number of bits in the code

Returns:

  • (Integer)

    returns the number of bits



30
31
32
# File 'lib/phidgets-ffi/ir.rb', line 30

def bit_count
  @bit_count
end

#carrier_frequencyInteger

Carrier frequency in Hz - defaults to 38kHz

Returns:

  • (Integer)

    returns the carrier frequency



74
75
76
# File 'lib/phidgets-ffi/ir.rb', line 74

def carrier_frequency
  @carrier_frequency
end

#duty_cycleInteger

Duty cycle in precent(10-50%) - defaults to 33

Returns:

  • (Integer)

    returns the duty cycle



78
79
80
# File 'lib/phidgets-ffi/ir.rb', line 78

def duty_cycle
  @duty_cycle
end

#encodingPhidgets::FFI::IREncoding

Encoding used to encode the data

Returns:



34
35
36
# File 'lib/phidgets-ffi/ir.rb', line 34

def encoding
  @encoding
end

#gapInteger

Gap time in us

Returns:

  • (Integer)

    returns the gap time



42
43
44
# File 'lib/phidgets-ffi/ir.rb', line 42

def gap
  @gap
end

#headerFFI::Struct::InlineArray[2<Integer>]

Header pulse and space - can be 0 for none

Returns:

  • (FFI::Struct::InlineArray[2<Integer>])

    returns the header



50
51
52
# File 'lib/phidgets-ffi/ir.rb', line 50

def header
  @header
end

#lengthPhidgets::FFI::IRLength

Constant or variable length encoding

Returns:



38
39
40
# File 'lib/phidgets-ffi/ir.rb', line 38

def length
  @length
end

#min_repeatInteger

Minimum number of times to repeat a code on transmit

Returns:

  • (Integer)

    returns the minimum repeat



66
67
68
# File 'lib/phidgets-ffi/ir.rb', line 66

def min_repeat
  @min_repeat
end

#oneFFI::Struct::InlineArray[2<Integer>]

Pulse and space times to represent a ‘1’ bit, in us

Returns:

  • (FFI::Struct::InlineArray[2<Integer>])

    returns the pulse and space times



54
55
56
# File 'lib/phidgets-ffi/ir.rb', line 54

def one
  @one
end

#repeatFFI::Struct::InlineArray[26<Integer>]

A series or pulse and space times to represent the repeat code. Start and end with pulses and null terminate - can be 0 for none

Returns:

  • (FFI::Struct::InlineArray[26<Integer>])

    returns the repeat code



62
63
64
# File 'lib/phidgets-ffi/ir.rb', line 62

def repeat
  @repeat
end

#toggle_maskFFI::StructLayout::CharArray[16<Integer>]

Bit toggles, which are applied to the code after each transmit

Returns:

  • (FFI::StructLayout::CharArray[16<Integer>])

    returns the bit toggles



70
71
72
# File 'lib/phidgets-ffi/ir.rb', line 70

def toggle_mask
  @toggle_mask
end

#trailInteger

Trail time in us - can be 0 for none

Returns:

  • (Integer)

    returns the the trail time



46
47
48
# File 'lib/phidgets-ffi/ir.rb', line 46

def trail
  @trail
end

#zeroFFI::Struct::InlineArray[2<Integer>]

Pulse and space times to represent a ‘0’ bit, in us

Returns:

  • (FFI::Struct::InlineArray[2<Integer>])

    returns the pulse and space times



58
59
60
# File 'lib/phidgets-ffi/ir.rb', line 58

def zero
  @zero
end