Implements a serial port with a Trio Stream
interface on Windows.
See trio-serial for the equivalent functionality on Linux and MacOS.
Example usage (assuming a looped back serial connection):
import trio
import trio_serial_windows
async def main():
async with trio_serial_windows.SerialStream("COM5", baudrate=115200) as port:
await port.send_all(b"Hello, World!")
await trio.sleep(0.2)
print(await port.receive_some())
trio.run(main)