Example #1
0
        public void AttachDataReceived()
        {
            DGSerial serial1 = new DGSerial(_portName1, _baudRate1);
            DGSerial serial2 = new DGSerial(_portName2, _baudRate2);

            serial1.Open();
            serial2.Open();

            serial2.AttachDataReceived(WriteBytes_DataReceived);

            byte[] buffertx = DGSerialHelper.StringToBytes("Test1");
            serial1.WriteBytes(buffertx);

            serial1.Close();
            Thread.Sleep(1000);

            serial2.Close();
        }