Class: HackRF::Device::Info
- Inherits:
-
Object
- Object
- HackRF::Device::Info
- Defined in:
- lib/hackrf/device.rb
Instance Method Summary collapse
- #board_id ⇒ Object
-
#initialize(device) ⇒ Info
constructor
A new instance of Info.
- #part_id_and_serial_number ⇒ Object
- #version_string ⇒ Object
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_id ⇒ Object
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_number ⇒ Object
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_string ⇒ Object
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 |