In short: use SerialPortStream library and SerialPortStream.OpenDirect() method.
namespace Vurdalakov
{
using System;
using RJCP.IO.Ports;
class Program
{
static void Main(String[] args)
{
using (var serialPort = new SerialPortStream("COM1"))
{
serialPort.OpenDirect();
while (serialPort.IsOpen)
{
var ch = (Char)serialPort.ReadChar();
Console.Write(ch);
}
}
}
}
}
No comments:
Post a Comment