Class: TC_Agri

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
AgriController
Defined in:
lib/agri-controller/device/wr1010.rb

Overview

require “agri-controller”

Constant Summary

Constants included from AgriController

AgriController::MINOR_VERSION, AgriController::VERSION

Instance Method Summary collapse

Methods included from AgriController

#_24hour, ary2dat, chdat, #delete_comment, dt, #error_caption, #error_catch, housa, housa2, houwa, houwa2, houwa_pressure, houwa_pressure2, join_csv, main, main_linux, main_new, #multiple_pulse_timer, #next_pulse, #pulse_timer, #pulse_timers, rename_csv, roten, #save_each_day, #thermo_data_each_day, thermo_data_logger_thread, #thermo_gruff, #thermo_gruff2, #thermo_gruff_generate, thermo_gruff_loop, thermo_loop_thread, thermo_read, #time?, #timer, #timers, #to_h, ttyUSB_watchdog, ttyUSB_watchdog_loop, webrick_start, yaml_db, yaml_dbr, yaml_dump, yaml_key, yaml_load, zettai

Instance Method Details

#setupObject



301
302
303
# File 'lib/agri-controller/device/wr1010.rb', line 301

def setup
  @res=WR1010::sample
end

#test_WR1010Object



305
306
307
308
309
310
311
# File 'lib/agri-controller/device/wr1010.rb', line 305

def test_WR1010
  p WR1010::send_sample(3) # =>
  p WR1010::sample # =>
  p WR1010::toa(WR1010::sample) #=>
  p x=WR1010::read("/dev/ttyUSB0",speed=57600,_to_address=3,from_adress=0)#[1,0] means 1st thermoonly,[3,1] means 2nd 3rd thermo
  p WR1010::parse(x)
end