lxi_rb 0.2.3 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e72bc52c850f4d1904dd30130293eda4a68c004f201026f7b90f967980820db
4
- data.tar.gz: bf7cf567edc90d38f1a295ffee34b7ac1eef04a564b5ebca1003995c9381fbea
3
+ metadata.gz: 5c4bc605d049472e8d0144e47698bbe5b2ea5e943464956fe44da6ad97b6e05e
4
+ data.tar.gz: 0ac0386d1043a2de040339e87d3dd494fa67ccec21d3e86453903a46aec433bd
5
5
  SHA512:
6
- metadata.gz: 56dd416d6c473a111929c8b69dcf12f8c4c0a71b65f3c3b1f8d37333022ceb902f6228d691fb8dbfb4884dcf284a6f9c07c9da8892e9eb8fcd038b15e75d959c
7
- data.tar.gz: 44fea582e9a62f9f3c1c3eadc89838d471e1d9649c3627ad837d49a5e4ef5c5caf48036626f82782da307451635c0452de32f1d9eaf49820f44ea0b371baa896
6
+ metadata.gz: 1cda03b1354f2d8b2b413b2139ef490e7b66869e1304db263774541578f389e85e6cd7dcb60221ad2be7e1ffd47514e72124a22af7f8389da29894ed3a946437
7
+ data.tar.gz: f30e8e12228cee9e8bdf05106f447413af3bf3c5f3313179b20cd1d539aff78c922bc94b394e2bf42caf3665efbe1140d56681452f309965a6697fe536a314b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
+ ## Unreleased (2023-05-07)
2
+
3
+ ### New feature:
4
+
5
+ - **device**: Init LXI Session([`4880f26`](https://github.com/robcarruthers/lxi_rb/commit/4880f2602b0a63713186a407ac4b3d2bd2dd4b10)) (by Rob Carruthers)
6
+
1
7
  ## v0.2.3 (2023-05-07)
2
- ## v0.2.2 (2023-05-07)
8
+
3
9
  ## v0.2.1 (2023-05-07)
4
10
 
5
11
  ### New feature:
data/Gemfile CHANGED
@@ -1,12 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in lxi_rb.gemspec
6
6
  gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
11
-
12
- gem "rubocop", "~> 1.21"
7
+ gem 'minitest', '~> 5.0'
8
+ gem 'rake', '~> 13.0'
9
+ gem 'rubocop', '~> 1.21'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lxi_rb (0.2.3)
4
+ lxi_rb (0.2.6)
5
5
  ffi (~> 1.15)
6
6
 
7
7
  GEM
data/Rakefile CHANGED
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rake/testtask"
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
5
5
 
6
6
  Rake::TestTask.new(:test) do |t|
7
- t.libs << "test"
8
- t.libs << "lib"
9
- t.test_files = FileList["test/**/test_*.rb"]
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/test_*.rb']
10
10
  end
11
11
 
12
- require "rubocop/rake_task"
12
+ require 'rubocop/rake_task'
13
13
 
14
14
  RuboCop::RakeTask.new
15
15
 
data/lib/lxi/device.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Lxi
2
3
  class Device
3
4
  include FFI
@@ -17,7 +18,7 @@ module Lxi
17
18
  end
18
19
 
19
20
  def connect
20
- raise Error, 'LXI Library Initialisation Error' unless Lxi.lxi_init == LXI_OK
21
+ init_lxi_session
21
22
 
22
23
  @id = Lxi.lxi_connect(@address, @port, @name, @timeout, @protocol)
23
24
  raise Error, 'LXI Connection Error' if @id == LXI_ERROR
data/lib/lxi/ffi.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'ffi'
2
3
 
3
4
  module Lxi
@@ -55,7 +56,7 @@ module Lxi
55
56
  end
56
57
 
57
58
  # Search for LXI-11 devices on the specified interface and return hash of devices
58
- def self.devices(interface: 'en0', timeout: 1000, type: :vxi11)
59
+ def self.devices(timeout: 1000, type: :vxi11)
59
60
  raise Error, 'LXI Library Initialisation Error' unless lxi_init == LXI_OK
60
61
 
61
62
  devices = []
@@ -68,10 +69,8 @@ module Lxi
68
69
  info[:broadcast] = BroadcastCallback
69
70
  info[:device] = callback
70
71
 
71
- result = lxi_discover_internal(info, timeout, type)
72
+ lxi_discover_internal(info, timeout, type)
72
73
  sleep 0.1
73
- puts "result: #{result}"
74
- puts "info: #{info[:device].read_string}"
75
74
  devices
76
75
  end
77
76
 
@@ -87,6 +86,6 @@ module Lxi
87
86
 
88
87
  result = lxi_discover_internal(info, timeout, type)
89
88
 
90
- puts "Error during discovery: #{result}" if result < 0
89
+ puts "Error during discovery: #{result}" if result.negative?
91
90
  end
92
91
  end
data/lib/lxi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lxi
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lxi_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Carruthers