rmodbus 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS.md CHANGED
@@ -1,3 +1,7 @@
1
+ 2012-06-06 Release 1.1.3
2
+ ==================================
3
+ 1. Fixed issue [#22](https://github.com/flipback/rmodbus/issues/22)
4
+
1
5
  2012-05-12 Release 1.1.2
2
6
  ==================================
3
7
  1. Fixed issue [#20](https://github.com/flipback/rmodbus/issues/20)
data/lib/rmodbus/rtu.rb CHANGED
@@ -48,6 +48,8 @@ module ModBus
48
48
  def send_rtu_pdu(pdu)
49
49
  msg = @uid.chr + pdu
50
50
  msg << crc16(msg).to_word
51
+
52
+ @io.read # Clean input buffer
51
53
  @io.write msg
52
54
 
53
55
  log "Tx (#{msg.size} bytes): " + logging_bytes(msg)
@@ -13,5 +13,5 @@
13
13
  # GNU General Public License for more details.
14
14
  module ModBus
15
15
  # Package version
16
- VERSION = '1.1.2'
16
+ VERSION = '1.1.3'
17
17
  end
data/spec/logging_spec.rb CHANGED
@@ -51,6 +51,7 @@ begin
51
51
  it 'should log rec\send bytes' do
52
52
  request = "\x3\x0\x1\x0\x1"
53
53
  @sp.should_receive(:write).with("\1#{request}\xd5\xca")
54
+ @sp.should_receive(:read).and_return("\xff\xff") # Clean a garbage
54
55
  @sp.should_receive(:read).with(2).and_return("\x1\x3")
55
56
  @sp.should_receive(:read).with(1).and_return("\x2")
56
57
  @sp.should_receive(:read).with(4).and_return("\xff\xff\xb9\xf4")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmodbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-18 00:00:00.000000000 Z
12
+ date: 2012-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &11352520 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *11352520
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: bundler
27
- requirement: &11352100 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *11352100
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rspec
38
- requirement: &11351580 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: 2.9.0
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *11351580
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.9.0
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: simplecov
49
- requirement: &11351140 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *11351140
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: yard
60
- requirement: &11350680 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *11350680
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: rdiscount
71
- requirement: &11350260 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: '0'
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *11350260
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: pry
82
- requirement: &11349840 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: '0'
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *11349840
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: serialport
93
- requirement: &11349400 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ! '>='
@@ -98,10 +133,15 @@ dependencies:
98
133
  version: '0'
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *11349400
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
102
142
  - !ruby/object:Gem::Dependency
103
143
  name: guard-rspec
104
- requirement: &11348980 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
105
145
  none: false
106
146
  requirements:
107
147
  - - ! '>='
@@ -109,7 +149,12 @@ dependencies:
109
149
  version: '0'
110
150
  type: :development
111
151
  prerelease: false
112
- version_requirements: *11348980
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
113
158
  description:
114
159
  email: atimin@gmail.com
115
160
  executables: []
@@ -118,48 +163,48 @@ extra_rdoc_files:
118
163
  - README.md
119
164
  - NEWS.md
120
165
  files:
121
- - lib/rmodbus/slave.rb
166
+ - lib/rmodbus/options.rb
122
167
  - lib/rmodbus/errors.rb
123
- - lib/rmodbus/rtu_via_tcp_server.rb
124
- - lib/rmodbus/tcp_client.rb
125
- - lib/rmodbus/rtu.rb
126
- - lib/rmodbus/tcp_slave.rb
127
- - lib/rmodbus/version.rb
128
- - lib/rmodbus/server.rb
168
+ - lib/rmodbus/rtu_server.rb
129
169
  - lib/rmodbus/client.rb
130
- - lib/rmodbus/ext.rb
131
- - lib/rmodbus/rtu_slave.rb
170
+ - lib/rmodbus/debug.rb
132
171
  - lib/rmodbus/rtu_client.rb
133
- - lib/rmodbus/rtu_via_tcp_client.rb
172
+ - lib/rmodbus/version.rb
173
+ - lib/rmodbus/tcp.rb
134
174
  - lib/rmodbus/sp.rb
135
- - lib/rmodbus/rtu_server.rb
175
+ - lib/rmodbus/rtu_slave.rb
176
+ - lib/rmodbus/server.rb
136
177
  - lib/rmodbus/tcp_server.rb
137
178
  - lib/rmodbus/rtu_via_tcp_slave.rb
179
+ - lib/rmodbus/rtu.rb
180
+ - lib/rmodbus/ext.rb
181
+ - lib/rmodbus/rtu_via_tcp_server.rb
182
+ - lib/rmodbus/tcp_slave.rb
138
183
  - lib/rmodbus/proxy.rb
139
- - lib/rmodbus/tcp.rb
140
- - lib/rmodbus/debug.rb
141
- - lib/rmodbus/options.rb
184
+ - lib/rmodbus/tcp_client.rb
185
+ - lib/rmodbus/rtu_via_tcp_client.rb
186
+ - lib/rmodbus/slave.rb
142
187
  - lib/rmodbus.rb
143
- - examples/simple-xpca-gateway.rb
144
- - examples/perfomance_rtu.rb
145
188
  - examples/perfomance_tcp.rb
146
- - examples/use_rtu_via_tcp_modbus.rb
189
+ - examples/simple-xpca-gateway.rb
147
190
  - examples/use_tcp_modbus.rb
148
- - spec/rtu_client_spec.rb
149
- - spec/logging_spec.rb
150
- - spec/slave_spec.rb
191
+ - examples/use_rtu_via_tcp_modbus.rb
192
+ - examples/perfomance_rtu.rb
151
193
  - spec/tcp_server_spec.rb
152
- - spec/rtu_server_spec.rb
153
- - spec/read_rtu_response_spec.rb
154
- - spec/spec_helper.rb
155
- - spec/tcp_client_spec.rb
156
- - spec/client_spec.rb
157
- - spec/exception_spec.rb
158
- - spec/ext_spec.rb
159
194
  - spec/proxy_spec.rb
160
- - spec/rtu_via_tcp_client_spec.rb
161
195
  - spec/rtu_via_tcp_server_spec.rb
196
+ - spec/exception_spec.rb
197
+ - spec/rtu_via_tcp_client_spec.rb
198
+ - spec/rtu_client_spec.rb
199
+ - spec/read_rtu_response_spec.rb
200
+ - spec/slave_spec.rb
162
201
  - spec/response_mismach_spec.rb
202
+ - spec/tcp_client_spec.rb
203
+ - spec/ext_spec.rb
204
+ - spec/logging_spec.rb
205
+ - spec/client_spec.rb
206
+ - spec/spec_helper.rb
207
+ - spec/rtu_server_spec.rb
163
208
  - Rakefile
164
209
  - README.md
165
210
  - NEWS.md
@@ -188,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
233
  version: '0'
189
234
  requirements: []
190
235
  rubyforge_project:
191
- rubygems_version: 1.8.15
236
+ rubygems_version: 1.8.23
192
237
  signing_key:
193
238
  specification_version: 3
194
239
  summary: RModBus - free implementation of protocol ModBus