Exemple #1
0
 private void axVSPortAx2_OnRxChar(object sender, AxVSPortLib._IVSPortAxEvents_OnRxCharEvent e)
 {
     byte[] Buff;
     Buff          = axVSPortAx2.ReadArray(e.count) as byte[];
     SentBytes     = SentBytes + axVSPortAx1.WriteArray(Buff);
     textSent.Text = Convert.ToString(SentBytes);
 }
Exemple #2
0
        private void axVSPortAx1_OnRxChar(object sender, AxVSPortLib._IVSPortAxEvents_OnRxCharEvent e)
        {
            byte[] Buff;
            int    ReceivedCnt;


            Buff        = axVSPortAx1.ReadArray(e.count) as byte[];
            ReceivedCnt = Buff.Length;
            if (ReceivedCnt != 0)
            {
                AddLog(Convert.ToString(ReceivedCnt) + " byte(s) read ");
                AddLogData(Buff, ReceivedCnt);
                RecvBytes     = RecvBytes + ReceivedCnt;
                textRecv.Text = Convert.ToString(RecvBytes);

                if (Redirect)
                {
                    axVSPortAx2.WriteArray(Buff);
                }
            }
        }