Sha256: c6ceedcc87aec2dfe12cd0209b5980b49e377d79673c9fe4facd2e19ad7dfe67
Contents?: true
Size: 897 Bytes
Versions: 2
Compression:
Stored size: 897 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'applix' $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') require 'rfid-usb-gom-sensor' #Thread.abort_on_exception = true $stderr.sync = true $stdout.sync = true class Usage < ArgumentError; end def main argv options = Hash.from_argv argv args = (options.delete :args) #options[:callback_port] ||= 32119 sensor_url = args.shift sensor_url or (raise Usage, "no <sensor_url>") puts " -- starting RFID sensor: #{Time.now}" daemon = Gom::Remote::Daemon.new(sensor_url, options) do |daemon, _| daemon.check_in end sensor = RfidUsbGomSensor::Node.new daemon.service_path, options sensor.preroll daemon.forever { sensor.detect } rescue Usage => e puts <<-TXT usage: #{__FILE__} <GOM Sensor URL> ## #{e} TXT rescue => e puts " ## #{e}\n -> #{e.backtrace.join "\n "}" end main ARGV # vim: syntax=ruby
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rfid-usb-gom-sensor-0.1.1 | bin/rfid-usb-gom-sensor.rb |
rfid-usb-gom-sensor-0.1.0 | bin/rfid-usb-gom-sensor.rb |