Method: NickelSilver::Server::Interface::LocoBufferUSB#initialize
- Defined in:
- lib/LocoBufferUSB.rb
#initialize(serial_port) ⇒ LocoBufferUSB
Connect to a LocoBuffer-USB using the specified serial port.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/LocoBufferUSB.rb', line 31 def initialize( serial_port ) @locobuffer = SerialPort.new( serial_port, 57_600 ) # these may be modified at any time by the server @input_buffer = [] @output_buffer = [] # only make changes when locked using @io_mutex @io_mutex = @iomutex = Mutex.new end |