rsmp 0.9.3 → 0.9.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rsmp/collect/alarm_collector.rb +19 -4
- data/lib/rsmp/tlc/traffic_controller.rb +6 -4
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41a71b0cd593d1ab4c3f9d0707929106b73d9ec6d8ce36a0f087f3efa73dccc3
|
4
|
+
data.tar.gz: 553a83ff465de1d07cc7e82531100059686caaf59710f7a452adbf07452f0bb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df2053f172e30f6fd57fe6794b99636729a0909ae1e382b12171ec5927fa744b3ec9ba689ebdde117fb8744c2b2182bff1d91c97e8936aeb1dafff53fb663fd5
|
7
|
+
data.tar.gz: 5eefd3e4c7ebe6c9eeeaf5e9c29f7681b52f69dc42e122afeda559b81698644ceb64b8321e4785df8c485f9fc8c235751ac5676e0a3d0e9289a0857847bedd2d
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module RSMP
|
2
2
|
# Class for waiting for specific command responses
|
3
3
|
class AlarmCollector < Collector
|
4
|
-
def initialize proxy,
|
5
|
-
@
|
4
|
+
def initialize proxy,options={}
|
5
|
+
@query = options[:query] || {}
|
6
6
|
super proxy, options.merge(
|
7
7
|
type: 'Alarm',
|
8
8
|
title:'alarm'
|
@@ -11,8 +11,23 @@ module RSMP
|
|
11
11
|
|
12
12
|
def type_match? message
|
13
13
|
return false if super(message) == false
|
14
|
-
|
15
|
-
|
14
|
+
|
15
|
+
# match fixed attributes
|
16
|
+
%w{aCId aSp ack aS sS cat pri}.each do |key|
|
17
|
+
return false if @query[key] && @query[key] != message.attribute(key)
|
18
|
+
end
|
19
|
+
|
20
|
+
# match rvs items
|
21
|
+
if @query['rvs']
|
22
|
+
query_rvs = @query['rvs']
|
23
|
+
message_rvs = message.attributes['rvs']
|
24
|
+
return false unless message_rvs
|
25
|
+
return false unless query_rvs.all? do |query_item|
|
26
|
+
return false unless message_rvs.any? do |message_item|
|
27
|
+
next message_item['n'] == query_item['n'] && message_item['v'] == query_item['v']
|
28
|
+
end
|
29
|
+
next true
|
30
|
+
end
|
16
31
|
end
|
17
32
|
true
|
18
33
|
end
|
@@ -268,14 +268,16 @@ module RSMP
|
|
268
268
|
def handle_m0006 arg
|
269
269
|
@node.verify_security_code 2, arg['securityCode']
|
270
270
|
input = arg['input'].to_i
|
271
|
+
unless input>0 && input<=@num_inputs
|
272
|
+
raise MessageRejected.new("Input #{idx} is invalid, must be in the range 1-#{@num_inputs}")
|
273
|
+
end
|
271
274
|
idx = input - 1
|
272
|
-
return unless idx>=0 && input<@num_inputs # TODO should NotAck
|
273
275
|
@input_activations[idx] = bool_string_to_digit arg['status']
|
274
276
|
recompute_input idx
|
275
|
-
if @input_activations[idx]
|
276
|
-
log "Activating input #{
|
277
|
+
if @input_activations[idx] == '1'
|
278
|
+
log "Activating input #{input}", level: :info
|
277
279
|
else
|
278
|
-
log "Deactivating input #{
|
280
|
+
log "Deactivating input #{input}", level: :info
|
279
281
|
end
|
280
282
|
end
|
281
283
|
|
data/lib/rsmp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|