code: function SerialPort(opts) {
  	stream.Duplex.call(this, {
  		//"allowHalfOpen": true
  	});
  	this.serialPort = opts.serialPort;
  	this.baudRate = opts.baudRate || 9600;
  	this.dataBits = opts.dataBits || 8;
  	this.stopBits = opts.stopBits || 1;
  	this.parity = opts.parity || 'none';
  	this.sttyPath = opts.sttyPath || "/bin/stty";
  	if(opts.initTimeout === undefined) {
  		opts.initTimeout = 10000;
  	}
  	this.initTimeout = opts.initTimeout;
  	this.sttyArgs = opts.sttyArgs || [];
  	this._fd = null;
  	this._readStream = null;
  	this._writeStream = null;
  }
docs: /* Implements a Duplex stream for reading from and writing to a serial port.
  
  This implementation uses `stty` to initialize the stream; then, it simply reads
  from or writes to the serial port using the "tty" Node.js library.
  
  The options object allows you to pass named options to the serial port during
  initialization. The valid attributes for the options object are the following:
  
  - serialPort - the serial port device name (required)
  - baudRate - Baud Rate (defaults to 9600)
  - dataBits - Data Bits - Must be one of: 8, 7, 6, or 5. (defaults to 8)
  - stopBits - Stop Bits - Must be one of: 1 or 2. (defaults to 1)
  - parity - Parity - Must be one of: 'none', 'odd', 'even',
  'mark', 'space' (defaults to 'none')
  - sttyPath - the path to the `stty` command (defaults to /bin/stty)
  - initTimeout - maximum initialization duration (defaults to 10 seconds);
  set to `null` to allow an infinite amount of time
  - sttyArgs - an array of additional arguments to pass to the `stty` command