Module: RSMP::SiteProxy::Modules::Commands
- Included in:
- RSMP::SiteProxy
- Defined in:
- lib/rsmp/proxy/site/modules/commands.rb
Overview
Handles command requests and responses
Instance Method Summary collapse
- #process_command_response(message) ⇒ Object
- #send_command(component, command_list, options = {}) ⇒ Object
Instance Method Details
#process_command_response(message) ⇒ Object
24 25 26 27 |
# File 'lib/rsmp/proxy/site/modules/commands.rb', line 24 def process_command_response() log "Received #{message.type}", message: , level: :log acknowledge end |
#send_command(component, command_list, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rsmp/proxy/site/modules/commands.rb', line 6 def send_command(component, command_list, = {}) validate_ready 'send command' m_id = [:m_id] || RSMP::Message.make_m_id = RSMP::CommandRequest.new({ 'cId' => component, 'arg' => command_list, 'mId' => m_id }) send_and_optionally_collect , do || CommandResponseCollector.new( self, command_list, .merge(task: @task, m_id: m_id) ) end end |