balboa_worldwide_app 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e24d4fa8787d36a34d66af9993561f237ecfdf7876e121176870ba93fdd4f67
4
- data.tar.gz: f223828f21309f8742616ab27ee925ddc02eab02304220418a015f25b79802a2
3
+ metadata.gz: 922f748aeb8f4141c3a97285929a57fa96d1b675872739ffbd060acc8b59dc7b
4
+ data.tar.gz: 67841aa0fa3026839d3edc743a0b2f58a21b0c5c8d57a833ade09d87e52c8dfe
5
5
  SHA512:
6
- metadata.gz: 2c12165571d6d619af2019fa30d85bee8af5d6758ffd9829363614b4ddab16993706dde33e91b0d5bc76578734a053f12fdad73290018317ec618ef04a6e6beb
7
- data.tar.gz: 8256ecee88d74681ed4b1f25d1b5d75b7f9d20ff3681b973f8ef9f1d80de08ca63c7c622cc60d0ec3394c2323e5013e8a5b073d23dce80dec08c25f7fb4c25f4
6
+ metadata.gz: b8cb0c05f23d5a01b826e99bc0a0e77bc85ce7ad210c955c5b46b6981f8fc7eb22281b25936ffd489f3c01001a74c2fb37233fde87e1a79b68378af762cc59d0
7
+ data.tar.gz: 5ce90e735133a9419d440a0919c5e18ca8e4fe419a826129b21d79960620ca416ba43e7e8e39c84b011c407c4a0b0c62a87c6538a905ef3ef42ce9f322150eee
@@ -14,8 +14,8 @@ module BWA
14
14
  @io = Net::Telnet::RFC2217.new("Host" => uri.host, "Port" => uri.port || 23, "baud" => 115200)
15
15
  @queue = []
16
16
  else
17
- require 'rubyserial'
18
- @io = Serial.new(uri.path, 115200)
17
+ require 'ccutrer-serialport'
18
+ @io = CCutrer::SerialPort.new(uri.path, baud: 115200)
19
19
  @queue = []
20
20
  end
21
21
  @buffer = ""
@@ -30,7 +30,7 @@ module BWA
30
30
  method = @io.respond_to?(:readpartial) ? :readpartial : :read
31
31
  unless message
32
32
  begin
33
- @buffer.concat(@io.send(method, 64 * 1024))
33
+ @buffer.concat(@io.__send__(method, 64 * 1024))
34
34
  rescue EOFError
35
35
  @io.wait_readable
36
36
  retry
@@ -56,7 +56,12 @@ module BWA
56
56
  "\xbf\x07".force_encoding(Encoding::ASCII_8BIT)].include?(message_type)
57
57
 
58
58
  if klass
59
- raise InvalidMessage.new("Unrecognized data length (#{length}) for message #{klass}", data) unless length - 5 == klass::MESSAGE_LENGTH
59
+ valid_length = if klass::MESSAGE_LENGTH.respond_to?(:include?)
60
+ klass::MESSAGE_LENGTH.include?(length - 5)
61
+ else
62
+ length - 5 == klass::MESSAGE_LENGTH
63
+ end
64
+ raise InvalidMessage.new("Unrecognized data length (#{length}) for message #{klass}", data) unless valid_length
60
65
  else
61
66
  klass = Unrecognized
62
67
  end
@@ -18,7 +18,8 @@ module BWA
18
18
  :current_temperature, :set_temperature
19
19
 
20
20
  MESSAGE_TYPE = "\xaf\x13".force_encoding(Encoding::ASCII_8BIT)
21
- MESSAGE_LENGTH = 24
21
+ # additional features have been added in later versions
22
+ MESSAGE_LENGTH = 24..28
22
23
 
23
24
  def initialize
24
25
  @src = 0xff
@@ -1,3 +1,3 @@
1
1
  module BWA
2
- VERSION = '1.1.2'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balboa_worldwide_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-17 00:00:00.000000000 Z
11
+ date: 2020-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: digest-crc
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.0.3
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubyserial
56
+ name: ccutrer-serialport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.6.0
61
+ version: 1.0.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.6.0
68
+ version: 1.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.1.2
146
+ rubygems_version: 3.1.4
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Library for communication with Balboa Water Group's WiFi module or RS-485