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 +4 -4
- data/lib/bwa/client.rb +3 -3
- data/lib/bwa/message.rb +6 -1
- data/lib/bwa/messages/status.rb +2 -1
- data/lib/bwa/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 922f748aeb8f4141c3a97285929a57fa96d1b675872739ffbd060acc8b59dc7b
|
4
|
+
data.tar.gz: 67841aa0fa3026839d3edc743a0b2f58a21b0c5c8d57a833ade09d87e52c8dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8cb0c05f23d5a01b826e99bc0a0e77bc85ce7ad210c955c5b46b6981f8fc7eb22281b25936ffd489f3c01001a74c2fb37233fde87e1a79b68378af762cc59d0
|
7
|
+
data.tar.gz: 5ce90e735133a9419d440a0919c5e18ca8e4fe419a826129b21d79960620ca416ba43e7e8e39c84b011c407c4a0b0c62a87c6538a905ef3ef42ce9f322150eee
|
data/lib/bwa/client.rb
CHANGED
@@ -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 '
|
18
|
-
@io =
|
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.
|
33
|
+
@buffer.concat(@io.__send__(method, 64 * 1024))
|
34
34
|
rescue EOFError
|
35
35
|
@io.wait_readable
|
36
36
|
retry
|
data/lib/bwa/message.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/bwa/messages/status.rb
CHANGED
@@ -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
|
-
|
21
|
+
# additional features have been added in later versions
|
22
|
+
MESSAGE_LENGTH = 24..28
|
22
23
|
|
23
24
|
def initialize
|
24
25
|
@src = 0xff
|
data/lib/bwa/version.rb
CHANGED
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.
|
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-
|
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:
|
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.
|
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.
|
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.
|
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
|