lxi_rb 0.2.1 → 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: 5e2583bda1cd48c51967b68e5b16f139c77f915cab04b8abbfd88165dba8b245
4
- data.tar.gz: b4e21c0a5430cb59bcddfb8db0d4740da4a9368b0e695ed777083fb06b9d3bf4
3
+ metadata.gz: 5c4bc605d049472e8d0144e47698bbe5b2ea5e943464956fe44da6ad97b6e05e
4
+ data.tar.gz: 0ac0386d1043a2de040339e87d3dd494fa67ccec21d3e86453903a46aec433bd
5
5
  SHA512:
6
- metadata.gz: 035f02d9942e7a270f0b3a4b3d4a1220e1ca0c01bd7a366e9a6ce39f635fdfc796a9df572856284fc6fcf12120142d8a87960cfa3d7abc55b2bcb682a007b8ec
7
- data.tar.gz: ba12b510bc5f56cbd7ee5530c2d8c7119b2e6340c580ba84c0d863c175d74cbc596785ba63abc8aae958c9733f65c4731a17d6bfff1be81ad6968a72bcf11b6d
6
+ metadata.gz: 1cda03b1354f2d8b2b413b2139ef490e7b66869e1304db263774541578f389e85e6cd7dcb60221ad2be7e1ffd47514e72124a22af7f8389da29894ed3a946437
7
+ data.tar.gz: f30e8e12228cee9e8bdf05106f447413af3bf3c5f3313179b20cd1d539aff78c922bc94b394e2bf42caf3665efbe1140d56681452f309965a6697fe536a314b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
- ## [Unreleased]
1
+ ## Unreleased (2023-05-07)
2
2
 
3
- ## [0.1.0] - 2023-05-02
3
+ ### New feature:
4
4
 
5
- - Initial release
5
+ - **device**: Init LXI Session([`4880f26`](https://github.com/robcarruthers/lxi_rb/commit/4880f2602b0a63713186a407ac4b3d2bd2dd4b10)) (by Rob Carruthers)
6
+
7
+ ## v0.2.3 (2023-05-07)
8
+
9
+ ## v0.2.1 (2023-05-07)
10
+
11
+ ### New feature:
12
+
13
+ - **ffi**: Add search class method([`8f7351f`](https://github.com/robcarruthers/lxi_rb/commit/8f7351f9b541614a717a83d291d169b1fd8db356)) (by Rob Carruthers)
14
+
15
+ ## v0.2.0 (2023-05-07)
16
+
17
+ ## v0.1.0 (2023-05-07)
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.1)
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,9 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  require 'ffi'
2
3
 
3
4
  module Lxi
4
5
  extend FFI::Library
5
6
 
6
- # Set the path to the library
7
7
  ffi_lib '/opt/homebrew/lib/liblxi.dylib'
8
8
  ffi_lib_flags :now, :global
9
9
 
@@ -56,7 +56,7 @@ module Lxi
56
56
  end
57
57
 
58
58
  # Search for LXI-11 devices on the specified interface and return hash of devices
59
- def self.devices(interface: 'en0', timeout: 1000, type: :vxi11)
59
+ def self.devices(timeout: 1000, type: :vxi11)
60
60
  raise Error, 'LXI Library Initialisation Error' unless lxi_init == LXI_OK
61
61
 
62
62
  devices = []
@@ -69,10 +69,8 @@ module Lxi
69
69
  info[:broadcast] = BroadcastCallback
70
70
  info[:device] = callback
71
71
 
72
- result = lxi_discover_internal(info, timeout, type)
72
+ lxi_discover_internal(info, timeout, type)
73
73
  sleep 0.1
74
- puts "result: #{result}"
75
- puts "info: #{info[:device].read_string}"
76
74
  devices
77
75
  end
78
76
 
@@ -88,6 +86,6 @@ module Lxi
88
86
 
89
87
  result = lxi_discover_internal(info, timeout, type)
90
88
 
91
- puts "Error during discovery: #{result}" if result < 0
89
+ puts "Error during discovery: #{result}" if result.negative?
92
90
  end
93
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.1'
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.1
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Carruthers