Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

fix serialport list on ubuntu #1003

Merged
merged 2 commits into from
Mar 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/serialmonitor/serialportctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export class SerialPortCtrl {
return SerialPortCtrl._serialport;
}

public static list(): Promise<ISerialPortDetail[]> {
return new Promise((resolve, reject) => {
SerialPortCtrl.serialport.list().then(
(ports) => resolve(ports),
(err) => reject(err),
);
});
public static async list(): Promise<ISerialPortDetail[]> {
try {
const lists = SerialPortCtrl.serialport.list();
return lists;
} catch (err) {
throw err;
}
}

private static _serialport: any;
Expand Down