Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SerialPortList.java #92

Open
wants to merge 2 commits into
base: 2.8.0
Choose a base branch
from
Open

Update SerialPortList.java #92

wants to merge 2 commits into from

Conversation

rukez
Copy link

@rukez rukez commented Apr 20, 2016

Hello! Thanks for excellent serial port lib!
This small change in code allows detection of custom-named ports when using persistent udev rules that include interface type in port's name. Persistent rules is a good practice (even in one-port system, because if you will replug converter while port is opened, without rule you will often get ttyUSB1 name instead of previous ttyUSB0), and even Chineese manufactures (like waveshare) include udev-rules in their linux distros to provide easy-readable names like RS-485-serialNumberOfChip for interface converters.
Regex amount and number modificators ([0-9]{1,3}) can also be safely dropped - in linux by default all devices starting with "ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|RS-485|RS485|RS-232|RS232" are serial ports, removing a/n moidifiers will allow to get ports that include different marks after type (chip serial number, chip manufacturer id and so on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant