lib/transport/scriptable-serial-terminal.js
function getNextResponse(){
    if (_waitingForInput !== null){
        throw new Error('concurreny error - receive listener already in-queue');
    }

    return new Promise(function(resolve){
        // data received ?
        if (_inputbuffer.length > 0){
            resolve(_inputbuffer.shift());
        }else{
            // add as waiting instance (no concurrent!)
            _waitingForInput = resolve;
        }
    });
}
function getNextResponse(){
    if (_waitingForInput !== null){
        throw new Error('concurreny error - receive listener already in-queue');
    }

    return new Promise(function(resolve){
        // data received ?
        if (_inputbuffer.length > 0){
            resolve(_inputbuffer.shift());
        }else{
            // add as waiting instance (no concurrent!)
            _waitingForInput = resolve;
        }
    });
}
function getNextResponse ( ) { if ( _waitingForInput !== null ) { throw new Error ( 'concurreny error - receive listener already in-queue' ) ; } return new Promise ( function ( resolve ) { // data received ? if ( _inputbuffer . length > 0 ) { resolve ( _inputbuffer . shift ( ) ) ; } else { // add as waiting instance (no concurrent!) _waitingForInput = resolve ; } } ) ; }
wait for next echo + response line
wait for next echo + response line