lib/builder.js
function(config) {
    var transport;
    if (config.wifi) {
      transport = new WiFiTransport({
        configuration: config.wifi
      });
    } else if (config.ethernet) {
      transport = new EthernetTransport({
        configuration: config.ethernet
      });
    } else if (config.ble) {
      transport = new BLETransport({
        configuration: config.ble
      });
    } else if (config.serial) {
      transport = new SerialTransport({
        configuration: config.serial
      });
    } else {
      throw new Error("Must specify a valid connection type");
    }
    return transport;
  }
function(config) {
    var transport;
    if (config.wifi) {
      transport = new WiFiTransport({
        configuration: config.wifi
      });
    } else if (config.ethernet) {
      transport = new EthernetTransport({
        configuration: config.ethernet
      });
    } else if (config.ble) {
      transport = new BLETransport({
        configuration: config.ble
      });
    } else if (config.serial) {
      transport = new SerialTransport({
        configuration: config.serial
      });
    } else {
      throw new Error("Must specify a valid connection type");
    }
    return transport;
  }
function ( config ) { var transport ; if ( config . wifi ) { transport = new WiFiTransport ( { configuration : config . wifi } ) ; } else if ( config . ethernet ) { transport = new EthernetTransport ( { configuration : config . ethernet } ) ; } else if ( config . ble ) { transport = new BLETransport ( { configuration : config . ble } ) ; } else if ( config . serial ) { transport = new SerialTransport ( { configuration : config . serial } ) ; } else { throw new Error ( "Must specify a valid connection type" ) ; } return transport ; }
Create a transport object for the specified connection type.
Throws an error if no valid connection type was specified.
@param {Object} config The connection type object
@return {Object}
Create a transport object for the specified connection type . Throws an error if no valid connection type was specified .