Class: HackRF::Device::Info

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

Instance Method Summary collapse

Constructor Details

#initialize(device) ⇒ Info

Returns a new instance of Info.



128
129
130
# File 'lib/hackrf/device.rb', line 128

def initialize(device)
  @device = device.ptr
end

Instance Method Details

#board_idObject



131
132
133
134
135
136
137
# File 'lib/hackrf/device.rb', line 131

def board_id
  ptr = FFI::MemoryPointer.new(:uint8)
  
  HackRF.hackrf_board_id_read(@device,ptr)
  
  return ptr.read_uint8
end

#part_id_and_serial_numberObject



147
148
149
150
151
152
153
# File 'lib/hackrf/device.rb', line 147

def part_id_and_serial_number
  part_id_serial_number = PartIDSerialNumber.new
  
  HackRF.hackrf_board_partid_serialno_read(@device,part_id_serial_number)
  
  return part_id_serial_number
end

#version_stringObject



139
140
141
142
143
144
145
# File 'lib/hackrf/device.rb', line 139

def version_string
  buffer = FFI::Buffer.new(255)
  
  HackRF.hackrf_version_string_read(@device,buffer,buffer.size)
  
  return buffer.get_string(0)
end