Я хочу принять данные с COM порта, но он выдаёт такую ошибку:
IOException: Ошибка ввода/вывода
System.IO.Ports.SerialPortStream.ThrowIOException () (at <aa976c2104104b7ca9e1785715722c9d>:0)
System.IO.Ports.SerialPortStream..ctor (System.String portName, System.Int32 baudRate, System.Int32 dataBits, System.IO.Ports.Parity parity, System.IO.Ports.StopBits stopBits, System.Boolean dtrEnable, System.Boolean rtsEnable, System.IO.Ports.Handshake handshake, System.Int32 readTimeout, System.Int32 writeTimeout, System.Int32 readBufferSize, System.Int32 writeBufferSize) (at <aa976c2104104b7ca9e1785715722c9d>:0)
(wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream..ctor(string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
System.IO.Ports.SerialPort.Open () (at <aa976c2104104b7ca9e1785715722c9d>:0)
(wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort.Open()
COMPortsInput.RaW.ReadString () (at Assets/Script/COMPorts.cs:36)
PlayerController.Start () (at Assets/Script/Player/PlayerController.cs:20)
Ошибка в этих строках:
35: SerialPort port = new SerialPort(PortsConfig.SelectedPortID().ToString(), 9600);
36: port.Open();