Didier9 Well-Known Member Licensed User Longtime User Jun 4, 2018 #1 I use this Code: Copy For Each s As String In Serial1.ListPorts Log(s) lvPorts.Items.Add( s ) Next to enumerate the serial ports that are currently installed. It only returns COM1, COM3 ... instead of the more useful driver names as displayed in the Device Manager. Is there a way to obtain the actual driver name like Windows displays in the Device Manager?
I use this Code: Copy For Each s As String In Serial1.ListPorts Log(s) lvPorts.Items.Add( s ) Next to enumerate the serial ports that are currently installed. It only returns COM1, COM3 ... instead of the more useful driver names as displayed in the Device Manager. Is there a way to obtain the actual driver name like Windows displays in the Device Manager?
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2018 #2 These names are not available with jSerial library. Upvote 0
Didier9 Well-Known Member Licensed User Longtime User Jun 5, 2018 #3 Erel said: These names are not available with jSerial library. Click to expand... That's what I was afraid of, thank you Erel. Upvote 0
Erel said: These names are not available with jSerial library. Click to expand... That's what I was afraid of, thank you Erel.
stevel05 Expert Licensed User Longtime User Jun 5, 2018 #4 I found some code here: https://stackoverflow.com/questions...ort-given-its-comx-name-under-windows-in-java That requires jna to access. Latest version is available here: https://github.com/java-native-access/jna You need to download the jna jar and the jna-platform jar and copy them to your additional libraries folder. The java code will only work for windows. You may need to change the references in the #AdditionalJar declarations in the main module if the jna download is a newer version. In the attached demo app the GetAll method returns a B4x Map, converted from the Hashmap returned by the java code and seems to contain connected devices, The Get method I left so you could try it, but it only appears to return registered devices and then only if it has a friendly name (which my COM1 doesn't) so I am not sure if it will be useful or not. Attachments ComPortFriendly.zip ComPortFriendly.zip 2.4 KB · Views: 805 Last edited: Mar 26, 2020 Upvote 0
I found some code here: https://stackoverflow.com/questions...ort-given-its-comx-name-under-windows-in-java That requires jna to access. Latest version is available here: https://github.com/java-native-access/jna You need to download the jna jar and the jna-platform jar and copy them to your additional libraries folder. The java code will only work for windows. You may need to change the references in the #AdditionalJar declarations in the main module if the jna download is a newer version. In the attached demo app the GetAll method returns a B4x Map, converted from the Hashmap returned by the java code and seems to contain connected devices, The Get method I left so you could try it, but it only appears to return registered devices and then only if it has a friendly name (which my COM1 doesn't) so I am not sure if it will be useful or not.