tinyg.js
function(r) {
    if (!seenConnectionBanner) {
      self.emit('connected', r);
      seenConnectionBanner = true;
      deferredSetup.resolve(r);
      return;
    }

    if (r.hasOwnProperty("rx") && self.serialPortData === null) {
      self.ignoredResponses--;
      if (!self.timedSendsOnly) {
        self.linesRequested = r.rx - 1;
      }
      // -1 is okay, that just means wait until we've sent two lines to send again
    } else if (self.ignoredResponses > 0) {
      self.ignoredResponses--;
      return;
    } else {
        if (!self.timedSendsOnly) {
          self.linesRequested++;
        }
    }

    self._sendLines();
  }
function(r) {
    if (!seenConnectionBanner) {
      self.emit('connected', r);
      seenConnectionBanner = true;
      deferredSetup.resolve(r);
      return;
    }

    if (r.hasOwnProperty("rx") && self.serialPortData === null) {
      self.ignoredResponses--;
      if (!self.timedSendsOnly) {
        self.linesRequested = r.rx - 1;
      }
      // -1 is okay, that just means wait until we've sent two lines to send again
    } else if (self.ignoredResponses > 0) {
      self.ignoredResponses--;
      return;
    } else {
        if (!self.timedSendsOnly) {
          self.linesRequested++;
        }
    }

    self._sendLines();
  }
function ( r ) { if ( ! seenConnectionBanner ) { self . emit ( 'connected' , r ) ; seenConnectionBanner = true ; deferredSetup . resolve ( r ) ; return ; } if ( r . hasOwnProperty ( "rx" ) && self . serialPortData === null ) { self . ignoredResponses -- ; if ( ! self . timedSendsOnly ) { self . linesRequested = r . rx - 1 ; } // -1 is okay, that just means wait until we've sent two lines to send again } else if ( self . ignoredResponses > 0 ) { self . ignoredResponses -- ; return ; } else { if ( ! self . timedSendsOnly ) { self . linesRequested ++ ; } } self . _sendLines ( ) ; }
Prepare the event listeners
Prepare the event listeners