Module: Cosmos::Api

Includes:
ApiShared, Extract
Included in:
BackgroundTask, CmdTlmServer, Interface, LimitsResponse
Defined in:
lib/cosmos/tools/cmd_tlm_server/api.rb

Constant Summary

Constants included from ApiShared

Cosmos::ApiShared::DEFAULT_TLM_POLLING_RATE

Constants included from Extract

Extract::SCANNING_REGULAR_EXPRESSION

Instance Method Summary collapse

Instance Method Details

#cmd(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target.

Accepts two different calling styles:

cmd("TGT CMD with PARAM1 val, PARAM2 val")
cmd('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



160
161
162
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 160

def cmd(*args)
  cmd_implementation(true, true, false, 'cmd', *args)
end

#cmd_no_checks(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without performing any value range checks or hazardous checks both on the command itself and its parameters.

Accepts two different calling styles:

cmd_no_checks("TGT CMD with PARAM1 val, PARAM2 val")
cmd_no_checks('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



207
208
209
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 207

def cmd_no_checks(*args)
  cmd_implementation(false, false, false, 'cmd_no_checks', *args)
end

#cmd_no_hazardous_check(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without performing any hazardous checks both on the command itself and its parameters. Useful in scripts to prevent popping up warnings to the user.

Accepts two different calling styles:

cmd_no_hazardous_check("TGT CMD with PARAM1 val, PARAM2 val")
cmd_no_hazardous_check('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



192
193
194
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 192

def cmd_no_hazardous_check(*args)
  cmd_implementation(true, false, false, 'cmd_no_hazardous_check', *args)
end

#cmd_no_range_check(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without performing any value range checks on the parameters. Useful for testing to allow sending command parameters outside the allowable range as defined in the configuration.

Accepts two different calling styles:

cmd_no_range_check("TGT CMD with PARAM1 val, PARAM2 val")
cmd_no_range_check('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



176
177
178
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 176

def cmd_no_range_check(*args)
  cmd_implementation(false, true, false, 'cmd_no_range_check', *args)
end

#cmd_raw(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without running conversions.

Accepts two different calling styles:

cmd_raw("TGT CMD with PARAM1 val, PARAM2 val")
cmd_raw('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



221
222
223
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 221

def cmd_raw(*args)
  cmd_implementation(true, true, true, 'cmd_raw', *args)
end

#cmd_raw_no_checks(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without running conversions or performing any value range checks or hazardous checks both on the command itself and its parameters.

Accepts two different calling styles:

cmd_raw_no_checks("TGT CMD with PARAM1 val, PARAM2 val")
cmd_raw_no_checks('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



268
269
270
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 268

def cmd_raw_no_checks(*args)
  cmd_implementation(false, false, true, 'cmd_raw_no_checks', *args)
end

#cmd_raw_no_hazardous_check(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without running conversions or performing any hazardous checks both on the command itself and its parameters. Useful in scripts to prevent popping up warnings to the user.

Accepts two different calling styles:

cmd_raw_no_hazardous_check("TGT CMD with PARAM1 val, PARAM2 val")
cmd_raw_no_hazardous_check('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



253
254
255
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 253

def cmd_raw_no_hazardous_check(*args)
  cmd_implementation(true, false, true, 'cmd_raw_no_hazardous_check', *args)
end

#cmd_raw_no_range_check(*args) ⇒ Array<String, String, Hash>

Send a command packet to a target without performing any value range checks on the parameters or running conversions. Useful for testing to allow sending command parameters outside the allowable range as defined in the configuration.

Accepts two different calling styles:

cmd_raw_no_range_check("TGT CMD with PARAM1 val, PARAM2 val")
cmd_raw_no_range_check('TGT','CMD','PARAM1'=>val,'PARAM2'=>val)

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:



237
238
239
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 237

def cmd_raw_no_range_check(*args)
  cmd_implementation(false, true, true, 'cmd_raw_no_range_check', *args)
end

#cmd_tlm_clear_countersObject

Clear server counters



1491
1492
1493
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1491

def cmd_tlm_clear_counters
  CmdTlmServer.clear_counters
end

#cmd_tlm_reloadObject

Reload the default configuration



1483
1484
1485
1486
1487
1488
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1483

def cmd_tlm_reload
  Thread.new do
    CmdTlmServer.instance.reload
  end
  nil
end

#connect_interface(interface_name, *params) ⇒ Object

Connects to an interface and starts its telemetry gathering thread. If optional parameters are given, the interface is recreated with new parameters.

Parameters:

  • interface_name (String)

    The name of the interface

  • params (Array)

    Parameters to pass to the interface.



1065
1066
1067
1068
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1065

def connect_interface(interface_name, *params)
  CmdTlmServer.interfaces.connect(interface_name, *params)
  nil
end

#connect_router(router_name, *params) ⇒ Object

Connects a router and starts its command gathering thread. If optional parameters are given, the router is recreated with new parameters.

Parameters:

  • router_name (String)

    The name of the router

  • params (Array)

    Parameters to pass to the router.



1107
1108
1109
1110
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1107

def connect_router(router_name, *params)
  CmdTlmServer.routers.connect(router_name, *params)
  nil
end

#disable_limits(*args) ⇒ Object

Disable limit checking for a telemetry item

Accepts two different calling styles:

disable_limits("TGT PKT ITEM")
disable_limits('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:



885
886
887
888
889
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 885

def disable_limits(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'disable_limits')
  System.limits.disable(target_name, packet_name, item_name)
  nil
end

#disable_limits_group(group_name) ⇒ Object

Disables limit checking for all the items in the given group.

Parameters:

  • group_name (String)

    Name of the group to disable



938
939
940
941
942
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 938

def disable_limits_group(group_name)
  Logger.info("Disabling Limits Group: #{group_name.upcase}")
  System.limits.disable_group(group_name)
  nil
end

#disconnect_interface(interface_name) ⇒ Object

Disconnects from an interface and kills its telemetry gathering thread

Parameters:

  • interface_name (String)

    The name of the interface



1073
1074
1075
1076
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1073

def disconnect_interface(interface_name)
  CmdTlmServer.interfaces.disconnect(interface_name)
  nil
end

#disconnect_router(router_name) ⇒ Object

Disconnects a router and kills its command gathering thread

Parameters:

  • router_name (String)

    The name of the router



1115
1116
1117
1118
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1115

def disconnect_router(router_name)
  CmdTlmServer.routers.disconnect(router_name)
  nil
end

#enable_limits(*args) ⇒ Object

Enable limits checking for a telemetry item

Accepts two different calling styles:

enable_limits("TGT PKT ITEM")
enable_limits('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:



870
871
872
873
874
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 870

def enable_limits(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'enable_limits')
  System.limits.enable(target_name, packet_name, item_name)
  nil
end

#enable_limits_group(group_name) ⇒ Object

Enables limit checking for all the items in the given group.

Parameters:

  • group_name (String)

    Name of the group to enable



931
932
933
934
935
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 931

def enable_limits_group(group_name)
  Logger.info("Enabling Limits Group: #{group_name.upcase}")
  System.limits.enable_group(group_name)
  nil
end

#get_all_cmd_infoNumeric

Get information on all command packets

Returns:

  • (Numeric)

    Transmit count for the command



1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1242

def get_all_cmd_info
  info = []
  System.commands.all.sort.each do |target_name, packets|
    packets.sort.each do |packet_name, packet|
      info << [target_name, packet_name, packet.received_count]
    end
  end
  info
end

#get_all_interface_infoArray<Array<String, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric>>

Get information about all interfaces

Returns:



1186
1187
1188
1189
1190
1191
1192
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1186

def get_all_interface_info
  info = []
  CmdTlmServer.interfaces.names.sort.each do |interface_name|
    info << [interface_name].concat(CmdTlmServer.interfaces.get_info(interface_name))
  end
  info
end

#get_all_packet_logger_infoObject



1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1292

def get_all_packet_logger_info
  info = []
  CmdTlmServer.packet_logging.all.keys.sort.each do |packet_logger_name|
    packet_log_writer_pair = CmdTlmServer.packet_logging.all[packet_logger_name.upcase]
    interfaces = []
    CmdTlmServer.interfaces.all.each do |interface_name, interface|
      if interface.packet_log_writer_pairs.include?(packet_log_writer_pair)
        interfaces << interface.name
      end
    end
    info << [packet_logger_name, interfaces].concat(CmdTlmServer.packet_logging.get_info(packet_logger_name))
  end
  info
end

#get_all_router_infoArray<Array<String, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric>>

Get information about all routers

Returns:



1211
1212
1213
1214
1215
1216
1217
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1211

def get_all_router_info
  info = []
  CmdTlmServer.routers.names.sort.each do |router_name|
    info << [router_name].concat(CmdTlmServer.routers.get_info(router_name))
  end
  info
end

#get_all_target_infoArray<Array<String, Numeric, Numeric>] Array of Arrays \[name, cmd_cnt, tlm_cnt]

Get information about all targets

Returns:



1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1140

def get_all_target_info
  info = []
  System.targets.sort.each do |target_name, target|
    interface_name = target.interface ? target.interface.name : ''
    info << [target_name, interface_name, target.cmd_cnt, target.tlm_cnt]
  end
  info
end

#get_all_tlm_infoNumeric

Get information on all telemetry packets

Returns:

  • (Numeric)

    Receive count for the telemetry packet



1255
1256
1257
1258
1259
1260
1261
1262
1263
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1255

def get_all_tlm_info
  info = []
  System.telemetry.all.sort.each do |target_name, packets|
    packets.sort.each do |packet_name, packet|
      info << [target_name, packet_name, packet.received_count]
    end
  end
  info
end

#get_background_tasksArray<Array<String, String, String>>

Get background task information

Returns:



1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1311

def get_background_tasks
  result = []
  CmdTlmServer.background_tasks.all.each do |task|
    if task.thread
      thread_status = task.thread.status
      thread_status = 'complete' if thread_status == false
    else
      thread_status = 'no thread'
    end
    result << [task.name, thread_status, task.status]
  end
  result
end

#get_cmd_buffer(target_name, command_name) ⇒ String

Returns the raw buffer from the most recent specified command packet.

Parameters:

  • target_name (String)

    Target name of the command

  • command_name (String)

    Packet name of the command

Returns:

  • (String)

    last command buffer packet



286
287
288
289
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 286

def get_cmd_buffer(target_name, command_name)
  packet = System.commands.packet(target_name, command_name)
  return packet.buffer
end

#get_cmd_cnt(target_name, command_name) ⇒ Numeric

Get the transmit count for a command packet

Parameters:

  • target_name (String)

    Target name of the command

  • command_name (String)

    Packet name of the command

Returns:

  • (Numeric)

    Transmit count for the command



1224
1225
1226
1227
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1224

def get_cmd_cnt(target_name, command_name)
  packet = System.commands.packet(target_name, command_name)
  packet.received_count
end

#get_cmd_hazardous(target_name, command_name, params = {}) ⇒ Boolean

Returns whether the specified command is hazardous

Parameters:

  • params (Hash) (defaults to: {})

    Command parameter hash to test whether a particular parameter setting makes the command hazardous

  • target_name (String)

    Name of the target

  • command_name (String)

    Name of the command

Returns:

  • (Boolean)

    Whether the command is hazardous



336
337
338
339
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 336

def get_cmd_hazardous(target_name, command_name, params = {})
  hazardous, _ = System.commands.cmd_hazardous?(target_name, command_name, params)
  return hazardous
end

#get_cmd_list(target_name) ⇒ Array<Array<String, String>>

Returns the list of all the command names and their descriptions from the given target.

Parameters:

  • target_name (String)

    Name of the target

Returns:

  • (Array<Array<String, String>>)

    Array containing [command name, command description] for all commands in the target



297
298
299
300
301
302
303
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 297

def get_cmd_list(target_name)
  list = []
  System.commands.packets(target_name).each do |name, command|
    list << [name, command.description]
  end
  return list.sort
end

#get_cmd_log_filename(packet_log_writer_name = 'DEFAULT') ⇒ String

Returns The command packet log filename.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'DEFAULT')

    The name of the packet log writer which is writing the command packet log

Returns:

  • (String)

    The command packet log filename



1364
1365
1366
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1364

def get_cmd_log_filename(packet_log_writer_name = 'DEFAULT')
  CmdTlmServer.packet_logging.cmd_filename(packet_log_writer_name)
end

#get_cmd_param_list(target_name, command_name) ⇒ Array<Array<String, Object, nil|Array, nil|String, nil|String, nil|String, Boolean>] Array containing \[name, default, states, description, units_full, units, required] for all parameters in the command

Returns the list of all the parameters for the given command.

Parameters:

  • command_name (String)

    Name of the command

  • target_name (String)

    Name of the target

Returns:

  • (Array<Array<String, Object, nil|Array, nil|String, nil|String, nil|String, Boolean>] Array containing \[name, default, states, description, units_full, units, required] for all parameters in the command)

    Array<Array<String, Object, nil|Array, nil|String, nil|String, nil|String, Boolean>] Array containing [name, default, states, description, units_full, units, required] for all parameters in the command



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 313

def get_cmd_param_list(target_name, command_name)
  list = []
  System.commands.params(target_name, command_name).each do |parameter|
    if parameter.format_string
      unless parameter.default.kind_of?(Array)
        list << [parameter.name, sprintf(parameter.format_string, parameter.default), parameter.states, parameter.description, parameter.units_full, parameter.units, parameter.required, parameter.data_type.to_s]
      else
        list << [parameter.name, "[]", parameter.states, parameter.description, parameter.units_full, parameter.units, parameter.required, parameter.data_type.to_s]
      end
    else
      list << [parameter.name, parameter.default, parameter.states, parameter.description, parameter.units_full, parameter.units, parameter.required, parameter.data_type.to_s]
    end
  end
  return list
end

#get_cmd_time(target_name = nil, command_name = nil) ⇒ Array<Target Name, Command Name, Time Seconds, Time Microseconds>

Returns the time the most recent command was sent

Parameters:

  • target_name (String) (defaults to: nil)

    Target name of the command. If not given then the most recent time from all commands will be returned

  • command_name (String) (defaults to: nil)

    Packet name of the command. If not given then then most recent time from the given target will be returned.

Returns:



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 392

def get_cmd_time(target_name = nil, command_name = nil)
  last_command = nil
  if target_name
    if command_name
      last_command = System.commands.packet(target_name, command_name)
    else
      System.commands.packets(target_name).each do |packet_name, command|
        last_command = command if !last_command and command.received_time
        if command.received_time and command.received_time > last_command.received_time
          last_command = command
        end
      end
    end
  else
    commands = System.commands.all
    commands.each do |_, target_commands|
      target_commands.each do |packet_name, command|
        last_command = command if !last_command and command.received_time
        if command.received_time and command.received_time > last_command.received_time
          last_command = command
        end
      end
    end
  end

  if last_command
    if last_command.received_time
      return [last_command.target_name, last_command.packet_name, last_command.received_time.tv_sec, last_command.received_time.tv_usec]
    else
      return [last_command.target_name, last_command.packet_name, nil, nil]
    end
  else
    return [nil, nil, nil, nil]
  end
end

#get_cmd_value(target_name, command_name, parameter_name, value_type = :CONVERTED) ⇒ Varies

Returns a value from the specified command

Parameters:

  • target_name (String)

    Target name of the command

  • command_name (String)

    Packet name of the command

  • parameter_name (String)

    Parameter name in the command

  • value_type (Symbol) (defaults to: :CONVERTED)

    How the values should be converted. Must be one of Packet::VALUE_TYPES

Returns:

  • (Varies)

    value



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 349

def get_cmd_value(target_name, command_name, parameter_name, value_type = :CONVERTED)
  packet = System.commands.packet(target_name, command_name)
  # Virtually support RECEIVED_TIMEFORMATTED, RECEIVED_TIMESECONDS, RECEIVED_COUNT
  # Also PACKET_TIMEFORMATTED and PACKET_TIMESECONDS
  case parameter_name.to_s.upcase
  when 'PACKET_TIMEFORMATTED'
    if packet.packet_time
      return packet.packet_time.formatted
    else
      return 'No Packet Time'
    end
  when 'PACKET_TIMESECONDS'
    if packet.packet_time
      return packet.packet_time.to_f
    else
      return 0.0
    end
  when 'RECEIVED_TIMEFORMATTED'
    if packet.received_time
      return packet.received_time.formatted
    else
      return 'No Packet Received Time'
    end
  when 'RECEIVED_TIMESECONDS'
    if packet.received_time
      return packet.received_time.to_f
    else
      return 0.0
    end
  when 'RECEIVED_COUNT'
    return packet.received_count
  else
    return packet.read(parameter_name, value_type.intern)
  end
end

#get_interface_info(interface_name) ⇒ Array<String, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric>

Get information about an interface

Parameters:

  • interface_name (String)

    Interface name

Returns:



1176
1177
1178
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1176

def get_interface_info(interface_name)
  CmdTlmServer.interfaces.get_info(interface_name)
end

#get_interface_namesArray<String>

Returns All the interface names.

Returns:



1055
1056
1057
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1055

def get_interface_names
  CmdTlmServer.interfaces.names
end

#get_interface_targets(interface_name) ⇒ Array<String>

Returns All the targets mapped to the given interface.

Returns:

  • (Array<String>)

    All the targets mapped to the given interface



1050
1051
1052
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1050

def get_interface_targets(interface_name)
  CmdTlmServer.interfaces.targets(interface_name)
end

#get_limits(target_name, packet_name, item_name, limits_set = nil) ⇒ Array<limits_set, persistence, enabled, red_low, yellow_low, red_high, yellow_high, green_low (optional), green_high (optional)] Limits information

Get the limits for a telemetry item

Parameters:

  • target_name (String)

    Target Name

  • packet_name (String)

    Packet Name

  • item_name (String)

    Item Name

  • limits_set (String or Symbol or nil) (defaults to: nil)

    Desired Limits set. nil = current limits set

Returns:

  • (Array<limits_set, persistence, enabled, red_low, yellow_low, red_high, yellow_high, green_low (optional), green_high (optional)] Limits information)

    Array<limits_set, persistence, enabled, red_low, yellow_low, red_high, yellow_high, green_low (optional), green_high (optional)] Limits information



910
911
912
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 910

def get_limits(target_name, packet_name, item_name, limits_set = nil)
  System.limits.get(target_name, packet_name, item_name, limits_set)
end

#get_limits_event(id, non_block = false) ⇒ Object



989
990
991
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 989

def get_limits_event(id, non_block = false)
  CmdTlmServer.get_limits_event(id, non_block)
end

#get_limits_groupsHash(String, Array)

Returns The defined limits groups.

Returns:



926
927
928
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 926

def get_limits_groups
  return System.limits.groups.keys
end

#get_limits_setString

Returns the active limits set that applies to all telemetry

Returns:

  • (String)

    The current limits set



961
962
963
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 961

def get_limits_set
  return System.limits_set.to_s
end

#get_limits_setsArray<Symbol>

Returns all defined limits sets

Returns:



947
948
949
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 947

def get_limits_sets
  return System.limits.sets
end

#get_out_of_limitsArray<Array<String, String, String, Symbol>>

Return an array of arrays indicating all items in the packet that are out of limits

[[target name, packet name, item name, item limits state], ...]

Returns:



837
838
839
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 837

def get_out_of_limits
  return System.limits.out_of_limits
end

#get_output_logs_filenames(filter = '*tlm.bin') ⇒ Object

Get the list of filenames in the outputs logs folder



1496
1497
1498
1499
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1496

def get_output_logs_filenames(filter = '*tlm.bin')
  raise "Filter must not contain slashes" if filter.index('/') or filter.index('\\')
  Dir.glob(File.join(System.paths['LOGS'], '**', filter))
end

#get_overall_limits_state(ignored_items = nil) ⇒ Symbol

Returns The overall limits state for the system.

Parameters:

Returns:

  • (Symbol)

    The overall limits state for the system



842
843
844
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 842

def get_overall_limits_state(ignored_items = nil)
  return System.limits.overall_limits_state(ignored_items)
end

#get_packet(id, non_block = false) ⇒ Object

Get a packet which was previously subscribed to by subscribe_packet_data. This method can block waiting for new packets or not based on the second parameter. It returns a single Cosmos::Packet instance and will return nil when no more packets are buffered (assuming non_block is false). Usage:

get_packet(id, <true or false to block>)


1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1031

def get_packet(id, non_block = false)
  packet = nil
  # The get_packet_data in the CmdTlmServer returns the number of seconds
  # followed by microseconds after the packet_name. This is different that the Script API.
  buffer, target_name, packet_name, rx_sec, rx_usec, rx_count = get_packet_data(id, non_block)
  if buffer
    packet = System.telemetry.packet(target_name, packet_name).clone
    packet.buffer = buffer
    packet.received_time = Time.at(rx_sec, rx_usec).sys
    packet.received_count = rx_count
  end
  packet
end

#get_packet_data(id, non_block = false) ⇒ Object



1005
1006
1007
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1005

def get_packet_data(id, non_block = false)
  CmdTlmServer.get_packet_data(id, non_block)
end

#get_packet_logger_info(packet_logger_name = 'DEFAULT') ⇒ Array<<Array<String>, Boolean, Numeric, String, Numeric, Boolean, Numeric, String, Numeric>] Array containing \[interfaces, cmd logging enabled, cmd queue size, cmd filename, cmd file size, tlm logging enabled, tlm queue size, tlm filename, tlm file size] for the packet logger

Get information about a packet logger.

Parameters:

  • packet_logger_name (String) (defaults to: 'DEFAULT')

    Name of the packet logger

Returns:

  • (Array<<Array<String>, Boolean, Numeric, String, Numeric, Boolean, Numeric, String, Numeric>] Array containing \[interfaces, cmd logging enabled, cmd queue size, cmd filename, cmd file size, tlm logging enabled, tlm queue size, tlm filename, tlm file size] for the packet logger)

    Array<<Array<String>, Boolean, Numeric, String, Numeric, Boolean, Numeric, String, Numeric>] Array containing [interfaces, cmd logging enabled, cmd queue size, cmd filename, cmd file size, tlm logging enabled, tlm queue size, tlm filename, tlm file size] for the packet logger



1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1280

def get_packet_logger_info(packet_logger_name = 'DEFAULT')
  logger_info = CmdTlmServer.packet_logging.get_info(packet_logger_name)
  packet_log_writer_pair = CmdTlmServer.packet_logging.all[packet_logger_name.upcase]
  interfaces = []
  CmdTlmServer.interfaces.all.each do |interface_name, interface|
    if interface.packet_log_writer_pairs.include?(packet_log_writer_pair)
      interfaces << interface.name
    end
  end
  return [interfaces] + logger_info
end

#get_packet_loggersArray<String>

Get the list of packet loggers.

Returns:

  • (Array<String>)

    Array containing the names of all packet loggers



1268
1269
1270
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1268

def get_packet_loggers
  return CmdTlmServer.packet_logging.all.keys
end

#get_router_info(router_name) ⇒ Array<String, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric, Numeric>

Get information about a router

Parameters:

  • router_name (String)

    Router name

Returns:



1201
1202
1203
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1201

def get_router_info(router_name)
  CmdTlmServer.routers.get_info(router_name)
end

#get_router_namesArray<String>

Returns All the router names.

Returns:



1097
1098
1099
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1097

def get_router_names
  CmdTlmServer.routers.names
end

#get_saved_config(configuration_name = nil) ⇒ Object

Get a saved configuration zip file



1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1583

def get_saved_config(configuration_name = nil)
  configuration_name ||= System.initial_config.name if System.initial_config
  if configuration_name
    configuration = System.instance.find_configuration(configuration_name)
    if configuration and File.exist?(configuration) and configuration[-4..-1] == ".zip"
      filename = File.basename(configuration)
      data = ''
      File.open(configuration, 'rb') {|file| data = file.read}
      return [filename, data]
    end
  end
  return nil
end

#get_screen_definition(screen_full_name, config_filename = nil, force_refresh = false) ⇒ Object

Get a specific screen definition



1574
1575
1576
1577
1578
1579
1580
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1574

def get_screen_definition(screen_full_name, config_filename = nil, force_refresh = false)
  get_screen_list(config_filename, force_refresh) if force_refresh or !@tlm_viewer_config
  screen_info = @tlm_viewer_config.screen_infos[screen_full_name.upcase]
  raise "Unknown screen: #{screen_full_name.upcase}" unless screen_info
  screen_definition = File.read(screen_info.filename)
  return screen_definition
end

#get_screen_list(config_filename = nil, force_refresh = false) ⇒ Object

Get the organized list of available telemetry screens



1565
1566
1567
1568
1569
1570
1571
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1565

def get_screen_list(config_filename = nil, force_refresh = false)
  if force_refresh or !@tlm_viewer_config or @tlm_viewer_config_filename != config_filename
    @tlm_viewer_config = TlmViewerConfig.new(config_filename, true)
    @tlm_viewer_config_filename = config_filename
  end
  return @tlm_viewer_config.columns
end

#get_server_message(id, non_block = false) ⇒ Object



1020
1021
1022
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1020

def get_server_message(id, non_block = false)
  CmdTlmServer.get_server_message(id, non_block)
end

#get_server_message_log_filenameString

Returns The server message log filename.

Returns:

  • (String)

    The server message log filename



1468
1469
1470
1471
1472
1473
1474
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1468

def get_server_message_log_filename
  if CmdTlmServer.message_log
    CmdTlmServer.message_log.filename
  else
    nil
  end
end

#get_server_statusString, ...

Get JSON DRB information

Returns:

  • (String, Integer, Integer, Integer, Float, Integer)

    Server status including Limits Set, API Port, JSON DRB num clients, JSON DRB request count, JSON DRB average request time, and the total number of Ruby threads in the server/



1351
1352
1353
1354
1355
1356
1357
1358
1359
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1351

def get_server_status
  [ System.limits_set.to_s,
    CmdTlmServer.mode == :CMD_TLM_SERVER ? System.ports['CTS_API'] : System.ports['REPLAY_API'],
    CmdTlmServer.json_drb.num_clients,
    CmdTlmServer.json_drb.request_count,
    CmdTlmServer.json_drb.average_request_time,
    Thread.list.length
  ]
end

#get_stale(with_limits_only = false, target = nil) ⇒ Array<Array<String, String>>

Get the list of stale packets for a specific target or pass nil to list all stale packets

Parameters:

  • with_limits_only (Boolean) (defaults to: false)

    Return only the stale packets that have limits items and thus affect the overall limits state of the system

  • target (String) (defaults to: nil)

    The target to find stale packets for or nil to list all stale packets in the system

Returns:



901
902
903
904
905
906
907
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 901

def get_stale(with_limits_only = false, target = nil)
  stale = []
  System.telemetry.stale(with_limits_only, target).each do |packet|
    stale << [packet.target_name, packet.packet_name]
  end
  stale
end

#get_target_ignored_items(target_name) ⇒ Array<String>

Get the list of ignored telemetry items for a target

Parameters:

  • target_name (String)

    Target name

Returns:

  • (Array<String>)

    All of the ignored telemetry items for a target.



1163
1164
1165
1166
1167
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1163

def get_target_ignored_items(target_name)
  target = System.targets[target_name.upcase]
  raise "Unknown target: #{target_name}" unless target
  return target.ignored_items
end

#get_target_ignored_parameters(target_name) ⇒ Array<String>

Get the list of ignored command parameters for a target

Parameters:

  • target_name (String)

    Target name

Returns:

  • (Array<String>)

    All of the ignored command parameters for a target.



1153
1154
1155
1156
1157
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1153

def get_target_ignored_parameters(target_name)
  target = System.targets[target_name.upcase]
  raise "Unknown target: #{target_name}" unless target
  return target.ignored_parameters
end

#get_target_info(target_name) ⇒ Array<Numeric, Numeric>

Get information about a target

Parameters:

  • target_name (String)

    Target name

Returns:



1131
1132
1133
1134
1135
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1131

def get_target_info(target_name)
  target = System.targets[target_name.upcase]
  raise "Unknown target: #{target_name}" unless target
  return [target.cmd_cnt, target.tlm_cnt]
end

#get_target_listArray<String>

Returns the list of all target names

Returns:



972
973
974
975
976
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 972

def get_target_list
  list = []
  System.targets.each_key {|target_name| list << target_name }
  return list.sort
end

#get_tlm_buffer(target_name, packet_name) ⇒ String

Returns the raw buffer for a telemetry packet.

Parameters:

  • target_name (String)

    Name of the target

  • packet_name (String)

    Name of the packet

Returns:

  • (String)

    last telemetry packet buffer



740
741
742
743
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 740

def get_tlm_buffer(target_name, packet_name)
  packet = System.telemetry.packet(target_name, packet_name)
  return packet.buffer
end

#get_tlm_cnt(target_name, packet_name) ⇒ Numeric

Get the receive count for a telemetry packet

Parameters:

  • target_name (String)

    Name of the target

  • packet_name (String)

    Name of the packet

Returns:

  • (Numeric)

    Receive count for the telemetry packet



1234
1235
1236
1237
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1234

def get_tlm_cnt(target_name, packet_name)
  packet = System.telemetry.packet(target_name, packet_name)
  packet.received_count
end

#get_tlm_details(item_array) ⇒ Array<Hash>

Returns an array of Hashes with all the attributes of the item.

Parameters:

  • item_array (Array<Array(String String String)>)

    An array consisting of [target name, packet name, item name]

  • value_types (Symbol|Array<Symbol>)

    How to convert the items before returning. A single symbol of Packet::VALUE_TYPES can be passed which will convert all items the same way. Or an array of symbols can be passed to control how each item is converted.

Returns:

  • (Array<Hash>)

    Array of hashes describing the items. All the attributes in PacketItem and StructItem are present in the Hash.



824
825
826
827
828
829
830
831
832
833
834
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 824

def get_tlm_details(item_array)
  if !item_array.is_a?(Array) || !item_array[0].is_a?(Array)
    raise ArgumentError, "item_array must be nested array: [['TGT','PKT','ITEM'],...]"
  end
  details = []
  item_array.each do |target_name, packet_name, item_name|
    _, item = System.telemetry.packet_and_item(target_name, packet_name, item_name)
    details << item.to_hash
  end
  details
end

#get_tlm_item_list(target_name, packet_name) ⇒ Array<String, Hash, String>

Returns the item names and their states and descriptions for a particular packet.

Parameters:

  • target_name (String)

    Name of the target

  • packet_name (String)

    Name of the packet

Returns:



810
811
812
813
814
815
816
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 810

def get_tlm_item_list(target_name, packet_name)
  list = []
  System.telemetry.items(target_name, packet_name).each do |item|
    list << [item.name, item.states, item.description]
  end
  list
end

#get_tlm_list(target_name) ⇒ Array<String, String>

Returns the sorted packet names and their descriptions for a particular target.

Parameters:

  • target_name (String)

    Name of the target

Returns:

  • (Array<String, String>)

    Array of [packet name, packet description] sorted by packet name



794
795
796
797
798
799
800
801
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 794

def get_tlm_list(target_name)
  list = []
  packets = System.telemetry.packets(target_name)
  packets.each do |packet_name, packet|
    list << [packet_name, packet.description]
  end
  list.sort
end

#get_tlm_log_filename(packet_log_writer_name = 'DEFAULT') ⇒ String

Returns The telemetry packet log filename.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'DEFAULT')

    The name of the packet log writer which is writing the telemetry packet log

Returns:

  • (String)

    The telemetry packet log filename



1371
1372
1373
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1371

def get_tlm_log_filename(packet_log_writer_name = 'DEFAULT')
  CmdTlmServer.packet_logging.tlm_filename(packet_log_writer_name)
end

#get_tlm_packet(target_name, packet_name, value_type = :CONVERTED) ⇒ Array<String, Object, Symbol|nil>

Returns all the values (along with their limits state) for a packet.

Parameters:

  • target_name (String)

    Name of the target

  • packet_name (String)

    Name of the packet

  • value_type (Symbol) (defaults to: :CONVERTED)

    How the values should be converted. Must be one of Packet::VALUE_TYPES

Returns:

  • (Array<String, Object, Symbol|nil>)

    Returns an Array consisting of [item name, item value, item limits state] where the item limits state can be one of Limits::LIMITS_STATES



752
753
754
755
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 752

def get_tlm_packet(target_name, packet_name, value_type = :CONVERTED)
  packet = System.telemetry.packet(target_name, packet_name)
  return packet.read_all_with_limits_states(value_type.to_s.intern)
end

#get_tlm_values(item_array, value_types = :CONVERTED) ⇒ Array< Array<Object>, Array<Symbol>, Array<Array<Numeric>>, String>

Returns all the item values (along with their limits state). The items can be from any target and packet and thus must be fully qualified with their target and packet names.

Parameters:

  • item_array (Array<Array(String String String)>)

    An array consisting of [target name, packet name, item name]

  • value_types (Symbol|Array<Symbol>) (defaults to: :CONVERTED)

    How to convert the items before returning. A single symbol of Packet::VALUE_TYPES can be passed which will convert all items the same way. Or an array of symbols can be passed to control how each item is converted.

Returns:

  • (Array< Array<Object>, Array<Symbol>, Array<Array<Numeric>>, String>)

    Array consisting of an Array of item values, an Array of item limits state given as symbols such as :RED, :YELLOW, :STALE, an Array of Arrays including the limits setting such as red low, yellow low, yellow high, red high and optionally green low and high, and the overall limits state which is one of Limits::LIMITS_STATES.



768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 768

def get_tlm_values(item_array, value_types = :CONVERTED)
  if !item_array.is_a?(Array) || (!item_array[0].is_a?(Array) and !item_array.empty?)
    raise ArgumentError, "item_array must be nested array: [['TGT','PKT','ITEM'],...]"
  end
  return [[], [], [], System.limits_set] if item_array.empty?
  if value_types.is_a?(Array)
    elem = value_types[0]
  else
    elem = value_types
  end
  # Due to JSON round tripping from scripts, value_types can be a String
  # so we must check for both Symbol and String
  if !elem.is_a?(Symbol) && !elem.is_a?(String)
    raise ArgumentError, "value_types must be a single symbol or array of symbols specifying the conversion method (:RAW, :CONVERTED, :FORMATTED, :WITH_UNITS)"
  end
  array = System.telemetry.values_and_limits_states(item_array, value_types)
  array << System.limits_set
  return array
end

#initializeObject

Sets api_requests to 0 and initializes the whitelist of allowable API method calls



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 23

def initialize
  @api_whitelist = [
    'cmd',
    'cmd_no_range_check',
    'cmd_no_hazardous_check',
    'cmd_no_checks',
    'cmd_raw',
    'cmd_raw_no_range_check',
    'cmd_raw_no_hazardous_check',
    'cmd_raw_no_checks',
    'send_raw',
    'get_cmd_buffer',
    'get_cmd_list',
    'get_cmd_param_list',
    'get_cmd_hazardous',
    'get_cmd_value',
    'get_cmd_time',
    'tlm',
    'tlm_raw',
    'tlm_formatted',
    'tlm_with_units',
    'tlm_variable',
    'set_tlm',
    'set_tlm_raw',
    'inject_tlm',
    'override_tlm',
    'override_tlm_raw',
    'normalize_tlm',
    'get_tlm_buffer',
    'get_tlm_packet',
    'get_tlm_values',
    'get_tlm_list',
    'get_tlm_item_list',
    'get_tlm_details',
    'get_out_of_limits',
    'get_overall_limits_state',
    'limits_enabled?',
    'enable_limits',
    'disable_limits',
    'get_stale',
    'get_limits',
    'set_limits',
    'get_limits_groups',
    'enable_limits_group',
    'disable_limits_group',
    'get_limits_sets',
    'set_limits_set',
    'get_limits_set',
    'get_target_list',
    'subscribe_limits_events',
    'unsubscribe_limits_events',
    'get_limits_event',
    'subscribe_packet_data',
    'unsubscribe_packet_data',
    'get_packet_data',
    'subscribe_server_messages',
    'unsubscribe_server_messages',
    'get_server_message',
    'get_interface_targets',
    'get_interface_names',
    'connect_interface',
    'disconnect_interface',
    'interface_state',
    'map_target_to_interface',
    'get_router_names',
    'connect_router',
    'disconnect_router',
    'router_state',
    'get_all_target_info',
    'get_target_info',
    'get_target_ignored_parameters',
    'get_target_ignored_items',
    'get_interface_info',
    'get_all_interface_info',
    'get_router_info',
    'get_all_router_info',
    'get_all_cmd_info',
    'get_all_tlm_info',
    'get_cmd_cnt',
    'get_tlm_cnt',
    'get_packet_loggers',
    'get_packet_logger_info',
    'get_all_packet_logger_info',
    'get_background_tasks',
    'start_background_task',
    'stop_background_task',
    'get_server_status',
    'get_cmd_log_filename',
    'get_tlm_log_filename',
    'start_logging',
    'stop_logging',
    'start_cmd_log',
    'start_tlm_log',
    'stop_cmd_log',
    'stop_tlm_log',
    'start_raw_logging_interface',
    'stop_raw_logging_interface',
    'start_raw_logging_router',
    'stop_raw_logging_router',
    'get_server_message_log_filename',
    'start_new_server_message_log',
    'cmd_tlm_reload',
    'cmd_tlm_clear_counters',
    'get_output_logs_filenames',
    'replay_select_file',
    'replay_status',
    'replay_set_playback_delay',
    'replay_play',
    'replay_reverse_play',
    'replay_stop',
    'replay_step_forward',
    'replay_step_back',
    'replay_move_start',
    'replay_move_end',
    'replay_move_index',
    'get_screen_list',
    'get_screen_definition',
    'get_saved_config',
  ]
  @tlm_viewer_config_filename = nil
  @tlm_viewer_config = nil
end

#inject_tlm(target_name, packet_name, item_hash = nil, value_type = :CONVERTED, send_routers = true, send_packet_log_writers = true, create_new_logs = false) ⇒ Object

Injects a packet into the system as if it was received from an interface

Parameters:

  • target_name (String)

    Target name of the packet

  • packet_name (String)

    Packet name of the packet

  • item_hash (Hash) (defaults to: nil)

    Hash of item_name and value for each item you want to change from the current value table

  • value_type (Symbol/String) (defaults to: :CONVERTED)

    Type of the values in the item_hash (RAW or CONVERTED)

  • send_routers (Boolean) (defaults to: true)

    Whether or not to send to routers for the target's interface

  • send_packet_log_writers (Boolean) (defaults to: true)

    Whether or not to send to the packet log writers for the target's interface

  • create_new_logs (Boolean) (defaults to: false)

    Whether or not to create new log files before writing this packet to logs



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 575

def inject_tlm(target_name, packet_name, item_hash = nil, value_type = :CONVERTED, send_routers = true, send_packet_log_writers = true, create_new_logs = false)
  received_time = Time.now
  target = System.targets[target_name.upcase]
  raise "Unknown target: #{target_name}" unless target

  # Find and clone the telemetry packet
  cvt_packet = System.telemetry.packet(target_name, packet_name)
  packet = cvt_packet.clone
  packet.received_time = received_time

  if item_hash
    # Update the packet with item_hash
    value_type = value_type.to_s.intern
    item_hash.each do |item_name, item_value|
      packet.write(item_name.to_s, item_value, value_type)
    end
  end

  # Update current value table
  cvt_packet.buffer = packet.buffer(false)
  cvt_packet.received_time = received_time

  # The interface does the following line, but I don't think inject_tlm should because it could confuse the interface
  target.tlm_cnt += 1
  packet.received_count += 1
  cvt_packet.received_count += 1
  CmdTlmServer.instance.identified_packet_callback(packet)

  # Find the interface for this target
  interface = target.interface

  if interface
    # Write to routers
    if send_routers
      interface.routers.each do |router|
        begin
          router.write(packet) if router.write_allowed? and router.connected?
        rescue => err
          Logger.error "Problem writing to router #{router.name} - #{err.class}:#{err.message}"
        end
      end
    end

    # Write to packet log writers
    if create_new_logs or send_packet_log_writers
      interface.packet_log_writer_pairs.each do |packet_log_writer_pair|
        # Optionally create new log files
        packet_log_writer_pair.tlm_log_writer.start if create_new_logs

        # Optionally write to packet logs - Write errors are handled by the log writer
        packet_log_writer_pair.tlm_log_writer.write(packet) if send_packet_log_writers
      end
    end
  else
    # Some packets don't have an interface - Can still write to standard routers and packet logs

    # Write to routers
    if send_routers
      router = CmdTlmServer.instance.routers.all['PREIDENTIFIED_ROUTER']
      if router
        begin
          router.write(packet) if router.write_allowed? and router.connected?
        rescue => err
          Logger.error "Problem writing to router #{router.name} - #{err.class}:#{err.message}"
        end
      end
    end

    if create_new_logs or send_packet_log_writers
      # Handle packet logging
      packet_log_writer_pair = CmdTlmServer.instance.packet_logging.all['DEFAULT']

      if packet_log_writer_pair
        # Optionally create new logs
        packet_log_writer_pair.tlm_log_writer.start if create_new_logs

        # Optionally write to packet logs - Write errors are handled by the log writer
        packet_log_writer_pair.tlm_log_writer.write(packet) if send_packet_log_writers
      end
    end
  end

  nil
end

#interface_state(interface_name) ⇒ String

Returns The state of the interface which is one of ‘CONNECTED’, ‘ATTEMPTING’ or ‘DISCONNECTED’.

Parameters:

  • interface_name (String)

    The name of the interface

Returns:

  • (String)

    The state of the interface which is one of 'CONNECTED', 'ATTEMPTING' or 'DISCONNECTED'.



1081
1082
1083
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1081

def interface_state(interface_name)
  CmdTlmServer.interfaces.state(interface_name)
end

#limits_enabled?(*args) ⇒ Boolean

Whether the limits are enabled for the given item

Accepts two different calling styles:

limits_enabled?("TGT PKT ITEM")
limits_enabled?('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:

  • (Boolean)

    Whether limits are enable for the itme



856
857
858
859
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 856

def limits_enabled?(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'limits_enabled?')
  return System.limits.enabled?(target_name, packet_name, item_name)
end

#map_target_to_interface(target_name, interface_name) ⇒ Object

Associates a target and all its commands and telemetry with a particular interface. All the commands will go out over and telemetry be received from that interface.

Parameters:

  • target_name (String)

    The name of the target

  • interface_name (String)

    The name of the interface



1091
1092
1093
1094
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1091

def map_target_to_interface(target_name, interface_name)
  CmdTlmServer.interfaces.map_target(target_name, interface_name)
  nil
end

#normalize_tlm(*args) ⇒ Object

Normalize a telemetry item in a packet to its default behavior. Called after override_tlm and override_tlm_raw to restore standard processing.

Accepts two different calling styles:

normalize_tlm("TGT PKT ITEM")
normalize_tlm('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:

  • args

    The args must either be a string or three strings (see the calling style in the description).



706
707
708
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 706

def normalize_tlm(*args)
  _override(__method__, tlm_process_args(args, __method__))
end

#override_tlm(*args) ⇒ Object

Override a telemetry item in a packet to a particular value such that it is always returned even when new telemetry packets are received from the target.

Accepts two different calling styles:

override_tlm("TGT PKT ITEM = 1.0")
override_tlm('TGT','PKT','ITEM', 10.0)

Favor the first syntax where possible as it is more succinct.

Parameters:

  • args

    The args must either be a string followed by a value or three strings followed by a value (see the calling style in the description).



673
674
675
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 673

def override_tlm(*args)
  _override(__method__, set_tlm_process_args(args, __method__))
end

#override_tlm_raw(*args) ⇒ Object

Override a telemetry item in a packet to a particular value such that it is always returned even when new telemetry packets are received from the target. This only accepts RAW data items and any conversions are applied to the raw data when the packet is read.

Accepts two different calling styles:

override_tlm_raw("TGT PKT ITEM = 1.0")
override_tlm_raw('TGT','PKT','ITEM', 10.0)

Favor the first syntax where possible as it is more succinct.

Parameters:

  • args

    The args must either be a string followed by a value or three strings followed by a value (see the calling style in the description).



691
692
693
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 691

def override_tlm_raw(*args)
  _override(__method__, set_tlm_process_args(args, __method__))
end

#replay_move_endObject

Replay move to end of file



1553
1554
1555
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1553

def replay_move_end
  CmdTlmServer.replay_backend.move_end
end

#replay_move_index(index) ⇒ Object

Replay move to index

Parameters:

  • index (Integer)

    packet index into file



1560
1561
1562
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1560

def replay_move_index(index)
  CmdTlmServer.replay_backend.move_index(index)
end

#replay_move_startObject

Replay move to start of file



1548
1549
1550
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1548

def replay_move_start
  CmdTlmServer.replay_backend.move_start
end

#replay_playObject

Replay start playing forward



1523
1524
1525
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1523

def replay_play
  CmdTlmServer.replay_backend.play
end

#replay_reverse_playObject

Replay start playing backward



1528
1529
1530
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1528

def replay_reverse_play
  CmdTlmServer.replay_backend.reverse_play
end

#replay_select_file(filename, packet_log_reader = "DEFAULT") ⇒ Object

Select and start analyzing a file for replay

filename [String] filename relative to output logs folder or absolute filename



1504
1505
1506
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1504

def replay_select_file(filename, packet_log_reader = "DEFAULT")
  CmdTlmServer.replay_backend.select_file(filename, packet_log_reader)
end

#replay_set_playback_delay(delay) ⇒ Object

Set the replay delay

Parameters:

  • delay (Float)

    delay between packets in seconds 0.0 to 1.0, nil = REALTIME



1518
1519
1520
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1518

def replay_set_playback_delay(delay)
  CmdTlmServer.replay_backend.set_playback_delay(delay)
end

#replay_statusObject

Get current replay status

status, delay, filename, file_start, file_current, file_end, file_index, file_max_index



1511
1512
1513
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1511

def replay_status
  CmdTlmServer.replay_backend.status
end

#replay_step_backObject

Replay step backward one packet



1543
1544
1545
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1543

def replay_step_back
  CmdTlmServer.replay_backend.step_back
end

#replay_step_forwardObject

Replay step forward one packet



1538
1539
1540
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1538

def replay_step_forward
  CmdTlmServer.replay_backend.step_forward
end

#replay_stopObject

Replay stop



1533
1534
1535
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1533

def replay_stop
  CmdTlmServer.replay_backend.stop
end

#router_state(router_name) ⇒ String

Returns The state of the router which is one of ‘CONNECTED’, ‘ATTEMPTING’ or ‘DISCONNECTED’.

Parameters:

  • router_name (String)

    The name of the router

Returns:

  • (String)

    The state of the router which is one of 'CONNECTED', 'ATTEMPTING' or 'DISCONNECTED'.



1123
1124
1125
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1123

def router_state(router_name)
  CmdTlmServer.routers.state(router_name)
end

#send_raw(interface_name, data) ⇒ Object

Send a raw binary string to the specified interface.

Parameters:

  • interface_name (String)

    The interface to send the raw binary

  • data (String)

    The raw binary data



276
277
278
279
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 276

def send_raw(interface_name, data)
  CmdTlmServer.commanding.send_raw(interface_name, data)
  nil
end

#set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low = nil, green_high = nil, limits_set = :CUSTOM, persistence = nil, enabled = true) ⇒ Array<limits_set, persistence, enabled, red_low, yellow_low, red_high, yellow_high, green_low (optional), green_high (optional)] Limits information

Set the limits for a telemetry item

Parameters:

  • target_name (String)

    Target Name

  • packet_name (String)

    Packet Name

  • item_name (String)

    Item Name

  • red_low (Float)

    Red Low Limit

  • yellow_low (Float)

    Yellow Low Limit

  • yellow_high (Float)

    Yellow High Limit

  • red_high (Float)

    Red High Limit

  • green_low (Float) (defaults to: nil)

    Green Low Limit

  • green_high (Float) (defaults to: nil)

    Green High Limit

  • limits_set (String or Symbol or nil) (defaults to: :CUSTOM)

    Desired Limits set. nil = current limits set, recommend using :CUSTOM

  • persistence (Integer) (defaults to: nil)

    The number of samples the value must be out of limits before detecting a limits change. nil = Leave unchanged

  • enabled (Boolean) (defaults to: true)

    If limits monitoring is enabled for this item

Returns:

  • (Array<limits_set, persistence, enabled, red_low, yellow_low, red_high, yellow_high, green_low (optional), green_high (optional)] Limits information)

    Array<limits_set, persistence, enabled, red_low, yellow_low, red_high, yellow_high, green_low (optional), green_high (optional)] Limits information



915
916
917
918
919
920
921
922
923
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 915

def set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low = nil, green_high = nil, limits_set = :CUSTOM, persistence = nil, enabled = true)
  result = System.limits.set(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low, green_high, limits_set, persistence, enabled)
  if result[0] != nil
    limits_settings = [target_name, packet_name, item_name].concat(result)
    CmdTlmServer.instance.post_limits_event(:LIMITS_SETTINGS, limits_settings)
    Logger.info("Limits Settings Changed: #{limits_settings}")
  end
  result
end

#set_limits_set(limits_set) ⇒ Object

Changes the active limits set that applies to all telemetry

Parameters:

  • limits_set (String)

    The name of the limits set



954
955
956
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 954

def set_limits_set(limits_set)
  System.limits_set = limits_set if System.limits_set != limits_set.to_s.upcase.intern
end

#set_tlm(*args) ⇒ Object

Set a telemetry item in a packet to a particular value and then verifies the value is within the acceptable limits. This method uses any conversions that apply to the item when setting the value.

Note: If this is done while COSMOS is currently receiving telemetry, this value could get overwritten at any time. Thus this capability is best used for testing or for telemetry items that are not received regularly through the target interface.

Accepts two different calling styles:

set_tlm("TGT PKT ITEM = 1.0")
set_tlm('TGT','PKT','ITEM', 10.0)

Favor the first syntax where possible as it is more succinct.

Parameters:

  • args

    The args must either be a string followed by a value or three strings followed by a value (see the calling style in the description).



527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 527

def set_tlm(*args)
  target_name, packet_name, item_name, value = set_tlm_process_args(args, 'set_tlm')
  if target_name == 'SYSTEM'.freeze and packet_name == 'META'.freeze
    raise "set_tlm not allowed on #{target_name} #{packet_name} #{item_name}" if ['PKTID', 'CONFIG'].include?(item_name)
  end
  System.telemetry.set_value(target_name, packet_name, item_name, value, :CONVERTED)
  if target_name == 'SYSTEM'.freeze and packet_name == 'META'.freeze
    tlm_packet = System.telemetry.packet('SYSTEM', 'META')
    cmd_packet = System.commands.packet('SYSTEM', 'META')
    cmd_packet.buffer = tlm_packet.buffer
  end
  System.telemetry.packet(target_name, packet_name).check_limits(System.limits_set, true)
  nil
end

#set_tlm_raw(*args) ⇒ Object

Set a telemetry item in a packet to a particular value and then verifies the value is within the acceptable limits. No conversions are applied.

Note: If this is done while COSMOS is currently receiving telemetry, this value could get overwritten at any time. Thus this capability is best used for testing or for telemetry items that are not received regularly through the target interface.

Accepts two different calling styles:

set_tlm_raw("TGT PKT ITEM = 1.0")
set_tlm_raw('TGT','PKT','ITEM', 10.0)

Favor the first syntax where possible as it is more succinct.

Parameters:

  • args

    The args must either be a string followed by a value or three strings followed by a value (see the calling style in the description).



559
560
561
562
563
564
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 559

def set_tlm_raw(*args)
  target_name, packet_name, item_name, value = set_tlm_process_args(args, 'set_tlm_raw')
  System.telemetry.set_value(target_name, packet_name, item_name, value, :RAW)
  System.telemetry.packet(target_name, packet_name).check_limits(System.limits_set, true)
  nil
end

#start_background_task(task_name) ⇒ Object

Start a background task



1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1326

def start_background_task(task_name)
  CmdTlmServer.background_tasks.all.each_with_index do |task, index|
    if task.name == task_name
      CmdTlmServer.background_tasks.start(index)
      break
    end
  end
end

#start_cmd_log(packet_log_writer_name = 'ALL', label = nil) ⇒ Object

Start command packet logging.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'ALL')

    The name of the packet log writer which is writing the command logs

  • label (String) (defaults to: nil)

    Optional label to apply to the command packet log filename



1401
1402
1403
1404
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1401

def start_cmd_log(packet_log_writer_name = 'ALL', label = nil)
  CmdTlmServer.packet_logging.start_cmd(packet_log_writer_name, label)
  nil
end

#start_logging(packet_log_writer_name = 'ALL', label = nil) ⇒ Object

Start both command and telemetry packet logging.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'ALL')

    The name of the packet log writer which is writing both the command and telemetry logs

  • label (String) (defaults to: nil)

    Optional label to apply to both the command and telemetry packet log filename



1381
1382
1383
1384
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1381

def start_logging(packet_log_writer_name = 'ALL', label = nil)
  CmdTlmServer.packet_logging.start(packet_log_writer_name, label)
  nil
end

#start_new_server_message_logObject

Starts a new server message log



1477
1478
1479
1480
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1477

def start_new_server_message_log
  CmdTlmServer.message_log.start if CmdTlmServer.message_log
  nil
end

#start_raw_logging_interface(interface_name = 'ALL') ⇒ Object

Starts raw logging for an interface

Parameters:

  • interface_name (String) (defaults to: 'ALL')

    The name of the interface



1438
1439
1440
1441
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1438

def start_raw_logging_interface(interface_name = 'ALL')
  CmdTlmServer.interfaces.start_raw_logging(interface_name)
  nil
end

#start_raw_logging_router(router_name = 'ALL') ⇒ Object

Starts raw logging for a router

Parameters:

  • router_name (String) (defaults to: 'ALL')

    The name of the router



1454
1455
1456
1457
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1454

def start_raw_logging_router(router_name = 'ALL')
  CmdTlmServer.routers.start_raw_logging(router_name)
  nil
end

#start_tlm_log(packet_log_writer_name = 'ALL', label = nil) ⇒ Object

Start telemetry packet logging.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'ALL')

    The name of the packet log writer which is writing the telemetry logs

  • label (String) (defaults to: nil)

    Optional label to apply to the telemetry packet log filename



1412
1413
1414
1415
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1412

def start_tlm_log(packet_log_writer_name = 'ALL', label = nil)
  CmdTlmServer.packet_logging.start_tlm(packet_log_writer_name, label)
  nil
end

#stop_background_task(task_name) ⇒ Object

Stop a background task



1336
1337
1338
1339
1340
1341
1342
1343
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1336

def stop_background_task(task_name)
  CmdTlmServer.background_tasks.all.each_with_index do |task, index|
    if task.name == task_name
      CmdTlmServer.background_tasks.stop(index)
      break
    end
  end
end

#stop_cmd_log(packet_log_writer_name = 'ALL') ⇒ Object

Stop command packet logging.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'ALL')

    The name of the packet log writer which is writing the command log



1421
1422
1423
1424
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1421

def stop_cmd_log(packet_log_writer_name = 'ALL')
  CmdTlmServer.packet_logging.stop_cmd(packet_log_writer_name)
  nil
end

#stop_logging(packet_log_writer_name = 'ALL') ⇒ Object

Stop both command and telemetry packet logging.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'ALL')

    The name of the packet log writer which is writing both the command and telemetry logs



1390
1391
1392
1393
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1390

def stop_logging(packet_log_writer_name = 'ALL')
  CmdTlmServer.packet_logging.stop(packet_log_writer_name)
  nil
end

#stop_raw_logging_interface(interface_name = 'ALL') ⇒ Object

Stop raw logging for an interface

Parameters:

  • interface_name (String) (defaults to: 'ALL')

    The name of the interface



1446
1447
1448
1449
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1446

def stop_raw_logging_interface(interface_name = 'ALL')
  CmdTlmServer.interfaces.stop_raw_logging(interface_name)
  nil
end

#stop_raw_logging_router(router_name = 'ALL') ⇒ Object

Stops raw logging for a router

Parameters:

  • router_name (String) (defaults to: 'ALL')

    The name of the router



1462
1463
1464
1465
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1462

def stop_raw_logging_router(router_name = 'ALL')
  CmdTlmServer.routers.stop_raw_logging(router_name)
  nil
end

#stop_tlm_log(packet_log_writer_name = 'ALL') ⇒ Object

Stop telemetry packet logging.

Parameters:

  • packet_log_writer_name (String) (defaults to: 'ALL')

    The name of the packet log writer which is writing the telemetry log



1430
1431
1432
1433
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1430

def stop_tlm_log(packet_log_writer_name = 'ALL')
  CmdTlmServer.packet_logging.stop_tlm(packet_log_writer_name)
  nil
end

#subscribe_limits_events(queue_size = CmdTlmServer::DEFAULT_LIMITS_EVENT_QUEUE_SIZE) ⇒ Object



979
980
981
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 979

def subscribe_limits_events(queue_size = CmdTlmServer::DEFAULT_LIMITS_EVENT_QUEUE_SIZE)
  CmdTlmServer.subscribe_limits_events(queue_size)
end

#subscribe_packet_data(packets, queue_size = CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE) ⇒ Object



994
995
996
997
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 994

def subscribe_packet_data(packets,
                          queue_size = CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE)
  CmdTlmServer.subscribe_packet_data(packets, queue_size)
end

#subscribe_server_messages(queue_size = CmdTlmServer::DEFAULT_SERVER_MESSAGES_QUEUE_SIZE) ⇒ Object



1010
1011
1012
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1010

def subscribe_server_messages(queue_size = CmdTlmServer::DEFAULT_SERVER_MESSAGES_QUEUE_SIZE)
  CmdTlmServer.subscribe_server_messages(queue_size)
end

#tlm(*args) ⇒ Numeric

Request a converted telemetry item from a packet.

Accepts two different calling styles:

tlm("TGT PKT ITEM")
tlm('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:

  • (Numeric)

    The converted telemetry value without formatting or units



439
440
441
442
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 439

def tlm(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'tlm')
  System.telemetry.value(target_name, packet_name, item_name, :CONVERTED)
end

#tlm_formatted(*args) ⇒ String

Request a formatted telemetry item from a packet.

Accepts two different calling styles:

tlm_formatted("TGT PKT ITEM")
tlm_formatted('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:

  • (String)

    The converted telemetry value with formatting but without units



471
472
473
474
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 471

def tlm_formatted(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'tlm_formatted')
  System.telemetry.value(target_name, packet_name, item_name, :FORMATTED)
end

#tlm_raw(*args) ⇒ Numeric

Request a raw telemetry item from a packet.

Accepts two different calling styles:

tlm_raw("TGT PKT ITEM")
tlm_raw('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:

  • (Numeric)

    The unconverted telemetry value without formatting or units



455
456
457
458
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 455

def tlm_raw(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'tlm_raw')
  System.telemetry.value(target_name, packet_name, item_name, :RAW)
end

#tlm_variable(*args) ⇒ Object

Request a telemetry item from a packet with the specified conversion applied. This method is equivalent to calling the other tlm_xxx methods.

Accepts two different calling styles:

tlm_variable("TGT PKT ITEM", :RAW)
tlm_variable('TGT','PKT','ITEM', :RAW)

Favor the first syntax where possible as it is more succinct.

Parameters:

  • args

    The args must either be a string followed by a symbol or three strings followed by a symbol (see the calling style in the description). The symbol must be one of Packet::VALUE_TYPES.

Returns:

  • (Object)

    The converted telemetry value



504
505
506
507
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 504

def tlm_variable(*args)
  target_name, packet_name, item_name, value_type = tlm_variable_process_args(args, 'tlm_variable')
  System.telemetry.value(target_name, packet_name, item_name, value_type)
end

#tlm_with_units(*args) ⇒ String

Request a telemetry item with units from a packet.

Accepts two different calling styles:

tlm_with_units("TGT PKT ITEM")
tlm_with_units('TGT','PKT','ITEM')

Favor the first syntax where possible as it is more succinct.

Parameters:

Returns:

  • (String)

    The converted, formatted telemetry value with units



486
487
488
489
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 486

def tlm_with_units(*args)
  target_name, packet_name, item_name = tlm_process_args(args, 'tlm_with_units')
  System.telemetry.value(target_name, packet_name, item_name, :WITH_UNITS)
end

#unsubscribe_limits_events(id) ⇒ Object



984
985
986
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 984

def unsubscribe_limits_events(id)
  CmdTlmServer.unsubscribe_limits_events(id)
end

#unsubscribe_packet_data(id) ⇒ Object



1000
1001
1002
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1000

def unsubscribe_packet_data(id)
  CmdTlmServer.unsubscribe_packet_data(id)
end

#unsubscribe_server_messages(id) ⇒ Object



1015
1016
1017
# File 'lib/cosmos/tools/cmd_tlm_server/api.rb', line 1015

def unsubscribe_server_messages(id)
  CmdTlmServer.unsubscribe_server_messages(id)
end