Method: OpenC3::SerialInterface#initialize
- Defined in:
- lib/openc3/interfaces/serial_interface.rb
#initialize(write_port_name, read_port_name, baud_rate, parity, stop_bits, write_timeout, read_timeout, protocol_type = nil, *protocol_args) ⇒ SerialInterface
Creates a serial interface which uses the specified stream protocol.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/openc3/interfaces/serial_interface.rb', line 43 def initialize(write_port_name, read_port_name, baud_rate, parity, stop_bits, write_timeout, read_timeout, protocol_type = nil, *protocol_args) super(protocol_type, protocol_args) @write_port_name = ConfigParser.handle_nil(write_port_name) @read_port_name = ConfigParser.handle_nil(read_port_name) @baud_rate = baud_rate @parity = parity.to_s.intern @stop_bits = stop_bits @write_timeout = write_timeout @read_timeout = read_timeout @write_allowed = false unless @write_port_name @write_raw_allowed = false unless @write_port_name @read_allowed = false unless @read_port_name @flow_control = :NONE @data_bits = 8 end |