lib/lxi/device.rb in lxi_rb-0.10.1 vs lib/lxi/device.rb in lxi_rb-0.10.3

- old
+ new

@@ -4,11 +4,11 @@ class Device include FFI attr_accessor :id, :address, :port, :name, :timeout, :protocol - def initialize(address, protocol) + def initialize(address, protocol = :vxi11) @address = address @port = 0 @name = nil @timeout = 1000 @protocol = protocol @@ -50,11 +50,12 @@ message.read_string end alias gets read - def query(message) + def query(message, bytes = 512, resp_delay: 0.02) write(message) - read(10_000) + sleep :resp_delay + read(bytes) end end end