Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)