lib/lifx/client.js
function Client() {
  EventEmitter.call(this);

  this.debug = false;
  this.socket = dgram.createSocket('udp4');
  this.isSocketBound = false;
  this.devices = {};
  this.port = null;
  this.messagesQueue = [];
  this.sendTimer = null;
  this.discoveryTimer = null;
  this.discoveryPacketSequence = 0;
  this.messageHandlers = [{
    type: 'stateService',
    callback: this.processDiscoveryPacket.bind(this)
  }, {
    type: 'stateLabel',
    callback: this.processLabelPacket.bind(this)
  }, {
    type: 'stateLight',
    callback: this.processLabelPacket.bind(this)
  }];
  this.sequenceNumber = 0;
  this.lightOfflineTolerance = 3;
  this.messageHandlerTimeout = 45000; // 45 sec
  this.resendPacketDelay = 150;
  this.resendMaxTimes = 5;
  this.source = utils.getRandomHexString(8);
  this.broadcastAddress = '255.255.255.255';
}
function Client() {
  EventEmitter.call(this);

  this.debug = false;
  this.socket = dgram.createSocket('udp4');
  this.isSocketBound = false;
  this.devices = {};
  this.port = null;
  this.messagesQueue = [];
  this.sendTimer = null;
  this.discoveryTimer = null;
  this.discoveryPacketSequence = 0;
  this.messageHandlers = [{
    type: 'stateService',
    callback: this.processDiscoveryPacket.bind(this)
  }, {
    type: 'stateLabel',
    callback: this.processLabelPacket.bind(this)
  }, {
    type: 'stateLight',
    callback: this.processLabelPacket.bind(this)
  }];
  this.sequenceNumber = 0;
  this.lightOfflineTolerance = 3;
  this.messageHandlerTimeout = 45000; // 45 sec
  this.resendPacketDelay = 150;
  this.resendMaxTimes = 5;
  this.source = utils.getRandomHexString(8);
  this.broadcastAddress = '255.255.255.255';
}
function Client ( ) { EventEmitter . call ( this ) ; this . debug = false ; this . socket = dgram . createSocket ( 'udp4' ) ; this . isSocketBound = false ; this . devices = { } ; this . port = null ; this . messagesQueue = [ ] ; this . sendTimer = null ; this . discoveryTimer = null ; this . discoveryPacketSequence = 0 ; this . messageHandlers = [ { type : 'stateService' , callback : this . processDiscoveryPacket . bind ( this ) } , { type : 'stateLabel' , callback : this . processLabelPacket . bind ( this ) } , { type : 'stateLight' , callback : this . processLabelPacket . bind ( this ) } ] ; this . sequenceNumber = 0 ; this . lightOfflineTolerance = 3 ; this . messageHandlerTimeout = 45000 ; // 45 sec this . resendPacketDelay = 150 ; this . resendMaxTimes = 5 ; this . source = utils . getRandomHexString ( 8 ) ; this . broadcastAddress = '255.255.255.255' ; }
Creates a lifx client
@extends EventEmitter
Creates a lifx client