更新 main.js
This commit is contained in:
parent
796d71524e
commit
78792de453
9
main.js
9
main.js
@ -32,17 +32,8 @@ adapter.on('message', function (obj) {
|
||||
switch (obj.command) {
|
||||
case 'listUart':
|
||||
if (obj.callback) {
|
||||
if (serialport) {
|
||||
// read all found serial ports
|
||||
serialport.list(function (err, ports) {
|
||||
listSerial(ports);
|
||||
adapter.log.info('List of port: ' + JSON.stringify(ports));
|
||||
adapter.sendTo(obj.from, obj.command, ports, obj.callback);
|
||||
});
|
||||
} else {
|
||||
adapter.log.warn('Module serialport is not available');
|
||||
adapter.sendTo(obj.from, obj.command, [{comName: 'Not available'}], obj.callback);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user