Module: RSMP::SiteProxy::Modules::Alarms
- Included in:
- RSMP::SiteProxy
- Defined in:
- lib/rsmp/proxy/site/modules/alarms.rb
Overview
Handles alarm messages
Instance Method Summary collapse
- #process_alarm(message) ⇒ Object
- #send_alarm_acknowledgement(component, alarm_code, options = {}) ⇒ Object
Instance Method Details
#process_alarm(message) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/rsmp/proxy/site/modules/alarms.rb', line 6 def process_alarm() component = find_component .attribute('cId') status = %w[ack aS sS].map { |key| .attribute(key) }.join(',') component.handle_alarm alarm_code = .attribute('aCId') asp = .attribute('aSp') log "Received #{message.type}, #{alarm_code} #{asp} [#{status}]", message: , level: :log acknowledge end |
#send_alarm_acknowledgement(component, alarm_code, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/rsmp/proxy/site/modules/alarms.rb', line 16 def send_alarm_acknowledgement(component, alarm_code, = {}) = RSMP::AlarmAcknowledged.new({ 'cId' => component, 'aCId' => alarm_code }) , validate: [:validate] end |