lib/ftdiserial/device.js
function FtdiSerialDevice(deviceSettings, connectionSettings, Connection) {

  if (_.isString(deviceSettings) && (deviceSettings.indexOf('COM') === 0 || deviceSettings.indexOf('/') === 0)) {
    this.isSerialDevice = true;
    // call super class
    SerialDevice.call(this,
      deviceSettings,
      connectionSettings,
      Connection
    );
  } else {
    this.isFtdiDevice = true;
    // call super class
    FtdiDevice.call(this,
      deviceSettings,
      connectionSettings,
      Connection
    );
  }
}
function FtdiSerialDevice(deviceSettings, connectionSettings, Connection) {

  if (_.isString(deviceSettings) && (deviceSettings.indexOf('COM') === 0 || deviceSettings.indexOf('/') === 0)) {
    this.isSerialDevice = true;
    // call super class
    SerialDevice.call(this,
      deviceSettings,
      connectionSettings,
      Connection
    );
  } else {
    this.isFtdiDevice = true;
    // call super class
    FtdiDevice.call(this,
      deviceSettings,
      connectionSettings,
      Connection
    );
  }
}
function FtdiSerialDevice ( deviceSettings , connectionSettings , Connection ) { if ( _ . isString ( deviceSettings ) && ( deviceSettings . indexOf ( 'COM' ) === 0 || deviceSettings . indexOf ( '/' ) === 0 ) ) { this . isSerialDevice = true ; // call super class SerialDevice . call ( this , deviceSettings , connectionSettings , Connection ) ; } else { this . isFtdiDevice = true ; // call super class FtdiDevice . call ( this , deviceSettings , connectionSettings , Connection ) ; } }
FtdiSerialDevice represents your physical device.
Extends Device.
@param {Object} deviceSettings     The device settings (locationId, serial, index, description) or (portName).
@param {Object} connectionSettings The connection settings (baudrate, databits, stopbits, parity).
@param {Object} Connection         The constructor function of the connection.
FtdiSerialDevice represents your physical device . Extends Device .