Method: OpenC3::InterfaceTopic.protocol_cmd

Defined in:
lib/openc3/topics/interface_topic.rb

.protocol_cmd(interface_name, cmd_name, *cmd_params, read_write: :READ_WRITE, index: -1,, scope:) ⇒ Object



89
90
91
92
93
94
95
96
# File 'lib/openc3/topics/interface_topic.rb', line 89

def self.protocol_cmd(interface_name, cmd_name, *cmd_params, read_write: :READ_WRITE, index: -1, scope:)
  data = {}
  data['cmd_name'] = cmd_name
  data['cmd_params'] = cmd_params
  data['read_write'] = read_write.to_s.upcase
  data['index'] = index
  Topic.write_topic("{#{scope}__CMD}INTERFACE__#{interface_name}", { 'protocol_cmd' => JSON.generate(data, allow_nan: true) }, '*', 100)
end