lib/cli/nodemcu-tool.js
async function devices(showAll, jsonOutput){
    
    try{
        const serialDevices = await _nodeMcuConnector.listDevices(showAll);

        if (jsonOutput){
            writeOutput(JSON.stringify(serialDevices));
        }else{
            // just show complete message
            if (serialDevices.length == 0){
                _mculogger.error('No Connected Devices found | Total: ' + serialDevices.length);

            }else{
                _mculogger.log('Connected Devices | Total: ' + serialDevices.length);
    
                // print fileinfo
                serialDevices.forEach(function(device){
                    _mculogger.log('- ' + device.comName + ' (' + device.manufacturer + ', ' + device.pnpId + ')');
                });
            }
        }
    }catch(e){
        _mculogger.alert('Cannot retrieve serial device list - ');
        _logger.debug(e);
    }
}
async function devices(showAll, jsonOutput){
    
    try{
        const serialDevices = await _nodeMcuConnector.listDevices(showAll);

        if (jsonOutput){
            writeOutput(JSON.stringify(serialDevices));
        }else{
            // just show complete message
            if (serialDevices.length == 0){
                _mculogger.error('No Connected Devices found | Total: ' + serialDevices.length);

            }else{
                _mculogger.log('Connected Devices | Total: ' + serialDevices.length);
    
                // print fileinfo
                serialDevices.forEach(function(device){
                    _mculogger.log('- ' + device.comName + ' (' + device.manufacturer + ', ' + device.pnpId + ')');
                });
            }
        }
    }catch(e){
        _mculogger.alert('Cannot retrieve serial device list - ');
        _logger.debug(e);
    }
}
async function devices ( showAll , jsonOutput ) { try { const serialDevices = await _nodeMcuConnector . listDevices ( showAll ) ; if ( jsonOutput ) { writeOutput ( JSON . stringify ( serialDevices ) ) ; } else { // just show complete message if ( serialDevices . length == 0 ) { _mculogger . error ( 'No Connected Devices found | Total: ' + serialDevices . length ) ; } else { _mculogger . log ( 'Connected Devices | Total: ' + serialDevices . length ) ; // print fileinfo serialDevices . forEach ( function ( device ) { _mculogger . log ( '- ' + device . comName + ' (' + device . manufacturer + ', ' + device . pnpId + ')' ) ; } ) ; } } } catch ( e ) { _mculogger . alert ( 'Cannot retrieve serial device list - ' ) ; _logger . debug ( e ) ; } }
show serial devices connected to the system
show serial devices connected to the system