Replies: 2 comments
-
While there is no trigger for an automatic update, calling the list() method after you have added or removed ports should display up to date info. The List method doesn't use cached data so whenever you run it you should see the latest data for the various ports |
Beta Was this translation helpful? Give feedback.
0 replies
-
Should work, but does not always. When I add or remove a virtual serial port (Eltima, Windows 10 and 11), this is not reflected in the list, even if I call list() again – I need to restart the application. Since I only need the port names (or paths), I built m own (asynchronous) list function which uses WMI on windows and the file system path on Linux and Darwin. I also replaced the open() method with really asynchronous version which returns a promise. The new operator with autoOpen flag and a callback argument to the constructor is really confusing. Creation should always be synchronous. If I want an open port (creation + initialization), I use an asynchronous factory method. This method checks for the existence of the port (via my list function) and fails if it does not exist or no baud rate is specified which amounts to a creation error. Then, if autoOpen is set, it tries to open the new SerialPort instance. If this fails, it fails with an open error.
Goetz Heller
Von: Gareth Hancock ***@***.***>
Gesendet: Sonntag, 4. September 2022 13:00
An: serialport/node-serialport ***@***.***>
Cc: hellerim ***@***.***>; Author ***@***.***>
Betreff: Re: [serialport/node-serialport] Refresh Serial Port List Automatically or Manually (Discussion #2532)
While there is no trigger for an automatic update, calling the list() method after you have added or removed ports should display up to date info. The List method doesn't use cached data so whenever you run it you should see the latest data for the various ports
—
Reply to this email directly, view it on GitHub <#2532 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAG2K5EP7JP24MFAICAPGXTV4R6M3ANCNFSM57BKLIQQ> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AAG2K5BQKTI7IJPCDLXJS63V4R6M3A5CNFSM57BKLIQ2YY3PNVWWK3TUL52HS4DFWFCGS43DOVZXG2LPNZBW63LNMVXHJKTDN5WW2ZLOORPWSZGOAA3CA4Y.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a possibility to get the list of available serial ports updated automatically or by hand when serial ports are added or removed (e.g. virtual serial ports or usb to serial port adapters)? This would be really nice because otherwise, we have to restart the application when this happens. At least, on Windows, I a cannot state that this is implemented behavior.
Beta Was this translation helpful? Give feedback.
All reactions