将串口绑定到Windows Docker容器。
示例代码:
version: '3.7'
services:
app:
image: myimage
devices:
- \\.\COM1
# other container settings
using System.IO.Ports;
...
using(SerialPort port = new SerialPort("COM1"))
{
// configure serial port settings
port.Open();
// use serial port
}