コード例 #1
0
 public bool SendDataPacket(char[] senddata)
 {
     try
     {
         ByteMode = false;
         CurrentSerialPort.Write(senddata, 0, senddata.Length);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
         return(false);
     }
     return(true);
 }
コード例 #2
0
 public bool SendDataPacket(byte[] dataPackeg)
 {
     try
     {
         ByteMode = true;
         CurrentSerialPort.Write(dataPackeg, 0, dataPackeg.Length);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
         OnSerialPortMiss(new SerialPortMissingEventArgs("send exception"));
         return(false);
     }
     return(true);
 }
コード例 #3
0
ファイル: SerialPortManager.cs プロジェクト: KKotw/paysystem
 public bool SendDataPacket(byte[] dataPackeg)
 {
     try
     {
         CurrentSerialPort.DiscardInBuffer();//清接收缓存
         ByteMode = true;
         CurrentSerialPort.Write(dataPackeg, 0, dataPackeg.Length);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
         return(false);
     }
     return(true);
 }