Module: DmmUtil
- Defined in:
- lib/dmm_util/fluke28x_driver.rb,
lib/dmm_util.rb,
lib/dmm_util/meter.rb,
lib/dmm_util/cursor.rb,
lib/dmm_util/reading.rb,
lib/dmm_util/recording.rb,
lib/dmm_util/measurement.rb,
lib/dmm_util/format_convertors.rb,
lib/dmm_util/recording_measurement.rb,
lib/dmm_util/recording_measurement_cursor.rb
Overview
It appears thwe are 32 bit vals: Mulit-map values Sequence numbers duration
Defined Under Namespace
Modules: FormatConvertors Classes: ByteStr, Cursor, Fluke28xDriver, Measurement, Meter, MeterError, Reading, Recording, RecordingMeasurement, RecordingMeasurementCursor
Class Method Summary collapse
Class Method Details
.open ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dmm_util.rb', line 14 def self.open driver = nil Dir.glob("/dev/tty.usbserial*").each do |tty_path| begin driver = open_driver(tty_path) rescue DmmUtil::MeterError $stderr.write "Warning: Did not find meter at #{tty_path}" end end raise "Could not find a valid meter, are you sure it is connected and turned on?" unless driver Meter.new(driver) end |
.open_driver(tty_path) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/dmm_util.rb', line 27 def self.open_driver(tty_path) port = SerialPort.new(tty_path, {"parity"=>0, "stop_bits"=>1, "baud"=>115200, "data_bits"=>8}) port.read_timeout = 1 meter = Fluke28xDriver.new(port) raise MeterError.new("Device at #{tty_path} does not seem to be a supported DMM") unless meter.valid? meter end |