Skip to content

Add rfc2217 support #95

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add rfc2217 support #95

wants to merge 3 commits into from

Conversation

Andre0512
Copy link

Solution to #46 - support for rfc2217/ser2net connections.

The polling approach from windows worked so far, but I needed the self attribute to distinguish the platform/protocol, so I merged the two solutions.

@joncar
Copy link

joncar commented Dec 27, 2022

The same problem happens for other non-file-based serial implementations, such as anything custom registered using serial.protocol_handler_packages.append("test_handlers"). I wonder if a more universal approach would be to attempt the fileno() call during initialization: if successful go down the add_writer/add_reader path and if it throws an exception go down the polling path.

@joncar
Copy link

joncar commented Dec 29, 2022

Yup, that does seem to work great. I tweaked your change to make my test that uses a custom URL handler work: joncar@4903067. (I didn't test it on Windows or with rfc2217 though!)

@Andre0512
Copy link
Author

I like your solution, that's a much better approach. I added your commit to my pr, hope that's okay for you. I tested with rfc2217 and it works well.

@bluespider42
Copy link

Any chance this will be merged?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants