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.
More of a question than a PR. I have used the tool com0com-2.2.2.0 to create a pair of virtual com ports and do the loopback test provided in the tests module. Tomorrow I will test with a pair of FTDI USB adapters and report back.
I am currently working on a project that must run under Windows - I would love to help get this fully supported. I do not understand the note here since the tests pass:
pyserial-asyncio/serial_asyncio/__init__.py
Lines 13 to 16 in 6e1baf2
Perhaps this is a good place for me to start?
Regarding flush (in regular pyserial), I'm not sure that I understand this comment:
https://github.com/pyserial/pyserial/blob/31fa4807d73ed4eb9891a88a15817b439c4eea2d/serial/serialwin32.py#L345-L349
My reading of the documentation is that
lpEvtMask
is a 16-bit value so we could listen to all, for example 0xffff and in this function just mask for 0x0004 to check if the buffer is empty. I don't have much experience with these Windows APIs but my hope would be thatWaitCommEvent
blocks until an event occurs and that it would avoid the busy loop altogether.Regardless of the number of events listened for it would look something like:
Very excited to learn more!