# File lib/nxt_comm.rb, line 205
  def initialize(dev)
  
                @@mutex.synchronize do
            begin
                    @sp = SerialPort.new(dev, 57600, 8, 1, SerialPort::NONE)
                  
                    @sp.flow_control = SerialPort::HARD
                    @sp.read_timeout = 5000
            rescue Errno::EBUSY
              raise "Cannot connect to #{dev}. The serial port is busy or unavailable."
            end
                end
    
    if @sp.nil?
      $stderr.puts "Cannot connect to #{dev}"
    else
      puts "Connected to: #{dev}" if $DEBUG
    end
  end