Class: Dino::TxRx::Serial

Inherits:
Base
  • Object
show all
Defined in:
lib/dino/tx_rx/serial.rb

Constant Summary collapse

BAUD =
115200

Instance Method Summary collapse

Methods inherited from Base

#close_read, #flush_read, #gets, #read, #write

Constructor Details

#initialize(options = {}) ⇒ Serial

Returns a new instance of Serial.



8
9
10
11
12
# File 'lib/dino/tx_rx/serial.rb', line 8

def initialize(options={})
  @device = options[:device]
  @baud = options[:baud] || BAUD
  @first_write = true
end

Instance Method Details

#handshakeObject



18
19
20
21
22
23
24
# File 'lib/dino/tx_rx/serial.rb', line 18

def handshake
  if on_windows?
    io; sleep 3
  end
  
  super
end

#ioObject



14
15
16
# File 'lib/dino/tx_rx/serial.rb', line 14

def io
  @io ||= connect
end