Class: Cosmos::CmdTlmServer

Inherits:
Object show all
Includes:
Api
Defined in:
lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb

Overview

Provides the interface for all applications to get the latest telemetry and to send commands.

Direct Known Subclasses

ReplayServer

Constant Summary collapse

DEFAULT_HOST =

The default host

'localhost'
DEFAULT_CONFIG_FILE =

The default configuration file name

'cmd_tlm_server.txt'
DEFAULT_LIMITS_EVENT_QUEUE_SIZE =

The maximum number of limits events that are queued. Used when subscribing to limits events.

1000
DEFAULT_PACKET_DATA_QUEUE_SIZE =

The maximum number of packets that are queued. Used when subscribing to packet data.

1000
@@instance =
nil
@@meta_callback =
nil

Constants included from Extract

Extract::SCANNING_REGULAR_EXPRESSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Api

#cmd, #cmd_no_checks, #cmd_no_hazardous_check, #cmd_no_range_check, #cmd_raw, #cmd_raw_no_checks, #cmd_raw_no_hazardous_check, #cmd_raw_no_range_check, #connect_interface, #connect_router, #disable_limits, #disable_limits_group, #disconnect_interface, #disconnect_router, #enable_limits, #enable_limits_group, #get_cmd_hazardous, #get_cmd_list, #get_cmd_log_filename, #get_cmd_param_list, #get_cmd_time, #get_cmd_value, #get_interface_names, #get_limits, #get_limits_event, #get_limits_groups, #get_limits_set, #get_limits_sets, #get_out_of_limits, #get_overall_limits_state, #get_packet_data, #get_router_names, #get_server_message_log_filename, #get_stale, #get_target_list, #get_tlm_details, #get_tlm_item_list, #get_tlm_list, #get_tlm_log_filename, #get_tlm_packet, #get_tlm_values, #interface_state, #limits_enabled?, #map_target_to_interface, #router_state, #send_raw, #set_limits, #set_limits_set, #set_tlm, #set_tlm_raw, #start_cmd_log, #start_logging, #start_new_server_message_log, #start_raw_logging_interface, #start_raw_logging_router, #start_tlm_log, #stop_cmd_log, #stop_logging, #stop_raw_logging_interface, #stop_raw_logging_router, #stop_tlm_log, #subscribe_limits_events, #subscribe_packet_data, #tlm, #tlm_formatted, #tlm_raw, #tlm_variable, #tlm_with_units, #unsubscribe_limits_events, #unsubscribe_packet_data

Constructor Details

#initialize(config_file = DEFAULT_CONFIG_FILE, production = false, disconnect = false, create_message_log = true) ⇒ CmdTlmServer

Constructor for a CmdTlmServer

Parameters:

  • config_file (String) (defaults to: DEFAULT_CONFIG_FILE)

    The name of the server configuration file which must be in the config/tools/cmd_tlm_server directory.

  • production (Boolean) (defaults to: false)

    Whether the server should be placed in 'production' mode which does various things to protect the server including disabling the ability to stop logging.

  • disconnect (Boolean) (defaults to: false)

    Whether to start the server in a disconnected stand-alone mode which does not actually use the interfaces to send and receive data. This is useful for testing scripts when actual hardware is not available.



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
145
146
147
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 108

def initialize(config_file = DEFAULT_CONFIG_FILE,
               production = false,
               disconnect = false,
               create_message_log = true)
  @@instance = self
  @packet_logging = nil # Removes warnings
  @message_log = MessageLog.new('server') if create_message_log

  super() # For Api

  Logger.info "COSMOS Version: #{COSMOS_VERSION}"

  @disconnect = disconnect

  @limits_event_queue_mutex = Mutex.new
  @limits_event_queues = {}
  @next_limits_event_queue_id = 1

  @packet_data_queue_mutex = Mutex.new
  @packet_data_queues = {}
  @next_packet_data_queue_id = 1

  # Process cmd_tlm_server.txt
  @config = CmdTlmServerConfig.new(File.join('config', 'tools', 'cmd_tlm_server', config_file))
  @background_tasks = BackgroundTasks.new(@config)
  @commanding = Commanding.new(@config)
  @interfaces = Interfaces.new(@config, method(:identified_packet_callback))
  @packet_logging = PacketLogging.new(@config)
  @routers = Routers.new(@config)
  @title = @config.title
  @stop_callback = nil

  # Set Threads to kill CTS if they throw an exception
  Thread.abort_on_exception = true

  # Don't start the DRb service or the telemetry monitoring thread
  # if we started the server in disconnect mode
  @json_drb = nil
  start(production) unless @disconnect
end

Instance Attribute Details

#limits_event_queue_mutexMutex (readonly)

Returns Synchronization object around limits events.

Returns:

  • (Mutex)

    Synchronization object around limits events



53
54
55
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 53

def limits_event_queue_mutex
  @limits_event_queue_mutex
end

#limits_event_queuesHash<Integer, Array<Queue, Integer>> (readonly)

Returns The limits event queues hashed by id. Returns an array containing the queue followed by the queue size.

Returns:

  • (Hash<Integer, Array<Queue, Integer>>)

    The limits event queues hashed by id. Returns an array containing the queue followed by the queue size.



57
58
59
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 57

def limits_event_queues
  @limits_event_queues
end

#next_limits_event_queue_idInteger

Returns The next limits event queue id when subscribe_limits_event is called. This ID must be used in the limits_event_queues hash to access the queue.

Returns:

  • (Integer)

    The next limits event queue id when subscribe_limits_event is called. This ID must be used in the limits_event_queues hash to access the queue.



61
62
63
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 61

def next_limits_event_queue_id
  @next_limits_event_queue_id
end

#next_packet_data_queue_idInteger

Returns The next packet data queue id when subscribe_packet_data is called. This ID must be used in the packet_data_queues hash to access the queue.

Returns:

  • (Integer)

    The next packet data queue id when subscribe_packet_data is called. This ID must be used in the packet_data_queues hash to access the queue.



71
72
73
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 71

def next_packet_data_queue_id
  @next_packet_data_queue_id
end

#packet_data_queue_mutexMutex (readonly)

Returns Synchronization object around packet data events.

Returns:

  • (Mutex)

    Synchronization object around packet data events



63
64
65
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 63

def packet_data_queue_mutex
  @packet_data_queue_mutex
end

#packet_data_queuesHash<Integer, Array<Queue, Integer>> (readonly)

Returns The packet data queues hashed by id. Returns an array containing the queue followed by the queue size.

Returns:

  • (Hash<Integer, Array<Queue, Integer>>)

    The packet data queues hashed by id. Returns an array containing the queue followed by the queue size.



67
68
69
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 67

def packet_data_queues
  @packet_data_queues
end

Class Method Details

.clear_countersObject

Calls clear_counters on the System, interfaces, routers, and sets the request_count on json_drb to 0.



494
495
496
497
498
499
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 494

def self.clear_counters
  System.clear_counters
  self.instance.interfaces.clear_counters
  self.instance.routers.clear_counters
  self.instance.json_drb.request_count = 0
end

.get_limits_event(id, non_block = false) ⇒ Object

Get a limits event from the queue created by Api#subscribe_limits_events.

Each limits event consists of an Array with two elements:

The Symbol name of the event and an Array of data

Parameters:

  • id (Integer)

    The queue ID received from calling Api#subscribe_limits_events

  • non_block (Boolean) (defaults to: false)

    Whether to wait on the queue for the next limits event before returning. Default is to block waiting for the next event. NOTE: If you pass true and there is no data on the queue, a ThreadError exception is raised.



369
370
371
372
373
374
375
376
377
378
379
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 369

def self.get_limits_event(id, non_block = false)
  queue = nil
  @@instance.limits_event_queue_mutex.synchronize do
    queue, _ = @@instance.limits_event_queues[id]
  end
  if queue
    return queue.pop(non_block)
  else
    raise "Limits event queue with id #{id} not found"
  end
end

.get_packet_data(id, non_block = false) ⇒ Object

Get packet data from the queue created by Api#subscribe_packet_data.

Each packet data consists of an Array with five elements: [buffer, target name, packet name, received time sec, received time us]

Parameters:

  • id (Integer)

    The queue ID received from calling Api#subscribe_packet_data

  • non_block (Boolean) (defaults to: false)

    Whether to wait on the queue for the next packet before returning. Default is to block waiting for the next packet. NOTE: If you pass true and there is no packet on the queue, a ThreadError exception is raised.



480
481
482
483
484
485
486
487
488
489
490
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 480

def self.get_packet_data(id, non_block = false)
  queue = nil
  @@instance.packet_data_queue_mutex.synchronize do
    queue, _, _ = @@instance.packet_data_queues[id]
  end
  if queue
    return queue.pop(non_block)
  else
    raise "Packet data queue with id #{id} not found"
  end
end

.instanceObject

Get the instance of the CmdTlmServer



88
89
90
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 88

def self.instance
  @@instance
end

.meta_callback=(meta_callback) ⇒ Object

Set the meta callback



93
94
95
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 93

def self.meta_callback= (meta_callback)
  @@meta_callback = meta_callback
end

.subscribe_limits_events(queue_size = DEFAULT_LIMITS_EVENT_QUEUE_SIZE) ⇒ Integer

Create a queue on the CmdTlmServer that gets populated with every limits event in the system. A limits event occurs when a telemetry item with limits changes state. Thus limits events occur on negative transitions (:GREEN to :YELLOW_LOW) and positive transitions (:YELLOW_HIGH to :GREEN).

Parameters:

  • queue_size (Integer) (defaults to: DEFAULT_LIMITS_EVENT_QUEUE_SIZE)

    The number of limit events to accumulate before the queue will be dropped due to inactivity.

Returns:



332
333
334
335
336
337
338
339
340
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 332

def self.subscribe_limits_events(queue_size = DEFAULT_LIMITS_EVENT_QUEUE_SIZE)
  id = nil
  @@instance.limits_event_queue_mutex.synchronize do
    id = @@instance.next_limits_event_queue_id
    @@instance.limits_event_queues[id] = [Queue.new, queue_size]
    @@instance.next_limits_event_queue_id += 1
  end
  return id
end

.subscribe_packet_data(packets, queue_size = CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE) ⇒ Integer

Subscribe to one or more telemetry packets.

Parameters:

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

    List of packets where the Strings are target name, packet name.

  • queue_size (Integer) (defaults to: CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE)

    The size of the queue to store packet data

Returns:



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 428

def self.subscribe_packet_data(packets,
                               queue_size = CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE)
  if !packets.is_a?(Array) || !packets[0].is_a?(Array)
    raise ArgumentError, "packets must be nested array: [['TGT','PKT'],...]"
  end

  id = nil
  upcase_packets = []

  # Upper case packet names
  packets.length.times do |index|
    upcase_packets << []
    upcase_packets[index][0] = packets[index][0].upcase
    upcase_packets[index][1] = packets[index][1].upcase
    # Get the packet to ensure it exists
    @@instance.get_tlm_packet(upcase_packets[index][0], upcase_packets[index][1])
  end

  @@instance.packet_data_queue_mutex.synchronize do
    id = @@instance.next_packet_data_queue_id
    @@instance.packet_data_queues[id] =
      [Queue.new, upcase_packets, queue_size]
    @@instance.next_packet_data_queue_id += 1
  end
  return id
end

.unsubscribe_limits_events(id) ⇒ Object

Unsubscribe from being notified for every limits event in the system. This deletes the queue and further calls to Api#get_limits_event will raise an exception.

Parameters:



348
349
350
351
352
353
354
355
356
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 348

def self.unsubscribe_limits_events(id)
  queue = nil
  @@instance.limits_event_queue_mutex.synchronize do
    # Remove the queue to stop servicing it.  Nil is added to unblock any client threads
    # that might otherwise be left blocking forever for something on the queue
    queue, queue_size = @@instance.limits_event_queues.delete(id)
    queue << nil if queue
  end
end

.unsubscribe_packet_data(id) ⇒ Object

Unsubscribe to telemetry packets.

Parameters:



459
460
461
462
463
464
465
466
467
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 459

def self.unsubscribe_packet_data(id)
  @@instance.packet_data_queue_mutex.synchronize do
    # Remove the queue to stop servicing it.  Nil is added to unblock any client threads
    # that might otherwise be left blocking forever for something on the queue
    queue, packets, queue_size = @@instance.packet_data_queues.delete(id)
    queue << nil if queue
  end
  return nil
end

Instance Method Details

#background_tasksBackgroundTasks

Returns Access to the background tasks.

Returns:



31
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 31

instance_attr_reader :background_tasks

#commandingCommanding

Returns Allows for sending commands to targets and interfaces.

Returns:

  • (Commanding)

    Allows for sending commands to targets and interfaces



34
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 34

instance_attr_reader :commanding

#graceful_killObject

Gracefully kill the staleness monitor thread



240
241
242
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 240

def graceful_kill
  @sleeper.cancel
end

#interfacesInterfaces

Returns Access to the interfaces.

Returns:



36
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 36

instance_attr_reader :interfaces

#json_drbJsonDRb

Returns Provides access to the server for all tools both internal and external.

Returns:

  • (JsonDRb)

    Provides access to the server for all tools both internal and external



45
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 45

instance_attr_accessor :json_drb

#limits_change_callback(packet, item, old_limits_state, value, log_change) ⇒ Object

Called when an item in any packet changes limits states.

Parameters:

  • packet (Packet)

    Packet which has had an item change limits state

  • item (PacketItem)

    The item which has changed limits state

  • old_limits_state (Symbol)

    The previous state of the item. See PacketItemLimits#state

  • value (Object)

    The current value of the item

  • log_change (Boolean)

    Whether to log this limits change event



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 252

def limits_change_callback(packet, item, old_limits_state, value, log_change)
  if log_change
    # Write to Server Messages that limits state has changed
    tgt_pkt_item_str = "#{packet.target_name} #{packet.packet_name} #{item.name} = #{value} is"
    case item.limits.state
    when :BLUE
      Logger.info "<B>#{tgt_pkt_item_str} #{item.limits.state}"
    when :GREEN, :GREEN_LOW, :GREEN_HIGH
      Logger.info "<G>#{tgt_pkt_item_str} #{item.limits.state}"
    when :YELLOW, :YELLOW_LOW, :YELLOW_HIGH
      Logger.warn "<Y>#{tgt_pkt_item_str} #{item.limits.state}"
    when :RED, :RED_LOW, :RED_HIGH
      Logger.error "<R>#{tgt_pkt_item_str} #{item.limits.state}"
    else
      Logger.error "#{tgt_pkt_item_str} UNKNOWN"
    end
  end

  post_limits_event(:LIMITS_CHANGE, [packet.target_name, packet.packet_name, item.name, old_limits_state, item.limits.state])

  if item.limits.response
    begin
      item.limits.response.call(packet, item, old_limits_state)
    rescue Exception => err
      Logger.error "#{packet.target_name} #{packet.packet_name} #{item.name} Limits Response Exception!"
      Logger.error "Called with old_state = #{old_limits_state}, new_state = #{item.limits.state}"
      Logger.error err.formatted
    end
  end
end

#message_logMessageLog

Returns Message log for the CmdTlmServer.

Returns:

  • (MessageLog)

    Message log for the CmdTlmServer



42
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 42

instance_attr_reader :message_log

#packet_loggingPacketLogging

Returns Access to the packet loggers.

Returns:



38
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 38

instance_attr_reader :packet_logging

#post_limits_event(event_type, event_data) ⇒ Object

Post a limits event to all subscribed limits event listeners.

Parameters:

  • event_type (Symbol)

    The type of limits event that occurred. Must be one of :LIMITS_SET which means the system limits set has changed, :LIMITS_CHANGE which means an individual item has changed limits state, :LIMITS_SETTINGS which means an individual item has new settings, or :STALE_PACKET which means a packet with limits has gone stale

  • event_data (Symbol|Array<String,String,String,Symbol,Symbol>)

    Returns the current limits set name for event_type == :LIMITS_SET. Returns an array containing the target name, packet name, item name, old limits state, and current limits state for event_type == :LIMITS_CHANGE.



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 295

def post_limits_event(event_type, event_data)
  if @limits_event_queues.length > 0
    queues_to_drop = []

    @limits_event_queue_mutex.synchronize do
      # Post event to active queues
      @limits_event_queues.each do |id, data|
        queue = data[0]
        queue_size = data[1]
        queue << [event_type, event_data]
        if queue.length > queue_size
          # Drop queue
          queues_to_drop << id
        end
      end

      # Drop queues which are not being serviced
      queues_to_drop.each do |id|
        # Remove the queue to stop servicing it.  Nil is added to unblock any client threads
        # that might otherwise be left blocking forever for something on the queue
        queue, queue_size = @limits_event_queues.delete(id)
        queue << nil if queue
      end
    end
  end
end

#post_packet(packet) ⇒ Object

Post packet data to all subscribed packet data listeners.

Parameters:



384
385
386
387
388
389
390
391
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
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 384

def post_packet(packet)
  if @packet_data_queues.length > 0
    queues_to_drop = []

    @packet_data_queue_mutex.synchronize do
      # Post event to active queues
      @packet_data_queues.each do |id, data|
        queue = data[0]
        packets = data[1]
        queue_size = data[2]

        packets.each do |target_name, packet_name|
          if packet.target_name == target_name and packet.packet_name == packet_name
            received_time = packet.received_time
            received_time ||= Time.now
            queue << [packet.buffer, target_name, packet_name,
              received_time.tv_sec, received_time.tv_usec, packet.received_count]
            if queue.length > queue_size
              # Drop queue
              queues_to_drop << id
            end
            break
          end
        end
      end

      # Drop queues which are not being serviced
      queues_to_drop.each do |id|
        # Remove the queue to stop servicing it.  Nil is added to unblock any client threads
        # that might otherwise be left blocking forever for something on the queue
        queue, packets, queue_size = @packet_data_queues.delete(id)
        queue << nil if queue
      end
    end
  end
end

#routersRouters

Returns Access to the routers.

Returns:

  • (Routers)

    Access to the routers



40
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 40

instance_attr_reader :routers

#start(production = false) ⇒ Object

Start up the system by starting the JSON-RPC server, interfaces, routers, and background tasks. Starts a thread to monitor all packets for staleness so other tools (such as Packet Viewer or Telemetry Viewer) can react accordingly.

Parameters:

  • production (Boolean) (defaults to: false)

    Whether the server should be placed in 'production' mode which does various things to protect the server including disabling the ability to stop logging.



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 155

def start(production = false)
  System.telemetry # Make sure definitions are loaded by starting anything
  return unless @json_drb.nil?

  @@meta_callback.call(@config.meta_target_name, @config.meta_packet_name) if @@meta_callback if @config.meta_target_name and @config.meta_packet_name

  # Start DRb with access control
  @json_drb = JsonDRb.new
  @json_drb.acl = System.acl if System.acl

  # In production we start logging and don't allow the user to stop it
  # We also disallow setting telemetry and disconnecting from interfaces
  if production
    @packet_logging.start
    @api_whitelist.delete('stop_logging')
    @api_whitelist.delete('stop_cmd_log')
    @api_whitelist.delete('stop_tlm_log')
    @interfaces.all.each do |name, interface|
      interface.disable_disconnect = true
    end
    @routers.all.each do |name, interface|
      interface.disable_disconnect = true
    end
  end
  @json_drb.method_whitelist = @api_whitelist
  begin
    @json_drb.start_service("localhost", System.ports['CTS_API'], self)
  rescue Exception
    # Call packet_logging shutdown here to explicitly kill the logging
    # threads since this CTS is not going to launch
    @packet_logging.shutdown
    raise FatalError.new("Error starting JsonDRb on port #{System.ports['CTS_API']}.\nPerhaps a Command and Telemetry Server is already running?")
  end

  @routers.add_preidentified('PREIDENTIFIED_ROUTER', System.instance.ports['CTS_PREIDENTIFIED'])
  System.telemetry.limits_change_callback = method(:limits_change_callback)
  @interfaces.start
  @routers.start
  @background_tasks.start

  # Start staleness monitor thread
  @sleeper = Sleeper.new
  @staleness_monitor_thread = Thread.new do
    begin
      while true
        stale = System.telemetry.check_stale
        stale.each do |packet|
          post_limits_event(:STALE_PACKET, [packet.target_name, packet.packet_name])
        end
        broken = @sleeper.sleep(10)
        break if broken
      end
    rescue Exception => err
      Logger.fatal "Staleness Monitor thread unexpectedly died"
      Cosmos.handle_fatal_exception(err)
    end
  end # end Thread.new
end

#stopObject

Properly shuts down the command and telemetry server by stoping the JSON-RPC server, background tasks, routers, and interfaces. Also kills the packet staleness monitor thread.



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 217

def stop
  # Shutdown DRb
  @json_drb.stop_service

  # Shutdown staleness monitor thread
  Cosmos.kill_thread(self, @staleness_monitor_thread)

  @background_tasks.stop
  @routers.stop
  @interfaces.stop
  @packet_logging.shutdown
  @stop_callback.call if @stop_callback
  @message_log.stop if @message_log

  @json_drb = nil
end

#stop_callback=(stop_callback) ⇒ Object

Set a stop callback



235
236
237
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 235

def stop_callback= (stop_callback)
  @stop_callback = stop_callback
end

#titleString

Returns CmdTlmServer title as set in the config file.

Returns:

  • (String)

    CmdTlmServer title as set in the config file



47
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb', line 47

instance_attr_accessor :title