rmodbus 1.0.0-java → 1.0.1-java
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.
- data/NEWS.md +5 -1
- data/lib/rmodbus/rtu.rb +5 -1
- data/lib/rmodbus/rtu_client.rb +1 -3
- data/lib/rmodbus/rtu_via_tcp_client.rb +1 -2
- data/lib/rmodbus/sp.rb +1 -1
- data/lib/rmodbus/tcp.rb +0 -2
- data/lib/rmodbus/tcp_client.rb +1 -2
- data/lib/rmodbus/version.rb +1 -1
- metadata +2 -2
data/NEWS.md
CHANGED
data/lib/rmodbus/rtu.rb
CHANGED
@@ -20,7 +20,11 @@ module ModBus
|
|
20
20
|
# We have to read specific amounts of numbers of bytes from the network depending on the function code and content
|
21
21
|
def read_rtu_response(io)
|
22
22
|
# Read the slave_id and function code
|
23
|
-
|
23
|
+
msg = nil
|
24
|
+
while msg.nil?
|
25
|
+
msg = io.read(2)
|
26
|
+
end
|
27
|
+
|
24
28
|
function_code = msg.getbyte(1)
|
25
29
|
case function_code
|
26
30
|
when 1,2,3,4 then
|
data/lib/rmodbus/rtu_client.rb
CHANGED
@@ -20,7 +20,7 @@ module ModBus
|
|
20
20
|
# end
|
21
21
|
# end
|
22
22
|
#
|
23
|
-
# @see
|
23
|
+
# @see SP#open_serial_port
|
24
24
|
# @see Client#initialize
|
25
25
|
class RTUClient < Client
|
26
26
|
include RTU
|
@@ -28,12 +28,10 @@ module ModBus
|
|
28
28
|
|
29
29
|
protected
|
30
30
|
# Open serial port
|
31
|
-
# @see SP#open_serial_port
|
32
31
|
def open_connection(port, baud=9600, opts = {})
|
33
32
|
open_serial_port(port, baud, opts)
|
34
33
|
end
|
35
34
|
|
36
|
-
# @private
|
37
35
|
def get_slave(uid, io)
|
38
36
|
RTUSlave.new(uid, io)
|
39
37
|
end
|
@@ -21,7 +21,7 @@ module ModBus
|
|
21
21
|
# end
|
22
22
|
# end
|
23
23
|
#
|
24
|
-
# @see
|
24
|
+
# @see TCP#open_tcp_connection
|
25
25
|
# @see Client#initialize
|
26
26
|
class RTUViaTCPClient < Client
|
27
27
|
include RTU
|
@@ -29,7 +29,6 @@ module ModBus
|
|
29
29
|
|
30
30
|
protected
|
31
31
|
# Open TCP\IP connection
|
32
|
-
# @see TCP#open_tcp_connection
|
33
32
|
def open_connection(ipaddr, port = 10002, opts = {})
|
34
33
|
io = open_tcp_connection(ipaddr, port, opts)
|
35
34
|
end
|
data/lib/rmodbus/sp.rb
CHANGED
@@ -35,7 +35,7 @@ module ModBus
|
|
35
35
|
@data_bits = opts[:data_bits] unless opts[:data_bits].nil?
|
36
36
|
@stop_bits = opts[:stop_bits] unless opts[:stop_bits].nil?
|
37
37
|
@parity = opts[:parity] unless opts[:parity].nil?
|
38
|
-
@read_timeout =
|
38
|
+
@read_timeout = opts[:read_timeout] unless opts[:read_timeout].nil?
|
39
39
|
|
40
40
|
io = SerialPort.new(@port, @baud, @data_bits, @stop_bits, @parity)
|
41
41
|
io.read_timeout = @read_timeout
|
data/lib/rmodbus/tcp.rb
CHANGED
data/lib/rmodbus/tcp_client.rb
CHANGED
@@ -21,13 +21,12 @@ module ModBus
|
|
21
21
|
# end
|
22
22
|
#
|
23
23
|
# @see TCPClient#open_connection
|
24
|
-
# @see
|
24
|
+
# @see TCP::open_connection
|
25
25
|
class TCPClient < Client
|
26
26
|
include TCP
|
27
27
|
|
28
28
|
protected
|
29
29
|
# Open TCP\IP connection
|
30
|
-
# @see TCP::open_connection
|
31
30
|
def open_connection(ipaddr, port = 502, opts = {})
|
32
31
|
open_tcp_connection(ipaddr, port, opts)
|
33
32
|
end
|
data/lib/rmodbus/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rmodbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.1
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- A.Timin, J. Sanders, K. Reynolds
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-07-01 00:00:00 +06:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|