AsyncIO
AsyncIO copied to clipboard
asynchronous serial port
how use AsyncIO operation serial port communication
I've never done serial port communication on Windows, but from what I've read I think you should be able to use the AsyncFileStream more or less as-is, just with the special COM port filenames (ie '\\.\COM5'), as well as fcOpenExisting and fsNone flags. See CreateFile for details.
You can then use the streams Handle property for the serial-specific calls (setting baud rate etc).
Of course ideally I'd make a wrapper for this, and it's something I'd like to do since I recently got an Arduino which I could use for testing.