Method: OpenC3::TemplateProtocol#read_data

Defined in:
lib/openc3/interfaces/protocols/template_protocol.rb

#read_data(data, extra = nil) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/openc3/interfaces/protocols/template_protocol.rb', line 111

def read_data(data, extra = nil)
  return super(data, extra) if data.length <= 0

  # Drop all data until the initial_read_delay is complete.
  # This gets rid of unused welcome messages,
  # prompts, and other junk on initial connections
  if @initial_read_delay and @initial_read_delay_needed and @connect_complete_time
    return :STOP if Time.now < @connect_complete_time

    @initial_read_delay_needed = false
  end
  return super(data, extra)
end