lib/cli/nodemcu-tool.js
async function getConnection(){
    // already connected ?
    if (_nodeMcuConnector.isConnected()){
        return;
    }

    // create new connector
    try{
        const msg = await _nodeMcuConnector.connect(_options.device, _options.baudrate, true, _options.connectionDelay);

        // status message
        _logger.log('Connected');
        _mculogger.log(msg);

    }catch(e){
        _logger.error('Unable to establish connection');
        throw e;
    }
}
async function getConnection(){
    // already connected ?
    if (_nodeMcuConnector.isConnected()){
        return;
    }

    // create new connector
    try{
        const msg = await _nodeMcuConnector.connect(_options.device, _options.baudrate, true, _options.connectionDelay);

        // status message
        _logger.log('Connected');
        _mculogger.log(msg);

    }catch(e){
        _logger.error('Unable to establish connection');
        throw e;
    }
}
async function getConnection ( ) { // already connected ? if ( _nodeMcuConnector . isConnected ( ) ) { return ; } // create new connector try { const msg = await _nodeMcuConnector . connect ( _options . device , _options . baudrate , true , _options . connectionDelay ) ; // status message _logger . log ( 'Connected' ) ; _mculogger . log ( msg ) ; } catch ( e ) { _logger . error ( 'Unable to establish connection' ) ; throw e ; } }
helper function to create a NodeMCU Tool Connection
helper function to create a NodeMCU Tool Connection