コード例 #1
0
ファイル: SerialControl.cs プロジェクト: gzhangx/netcvreco
        public Task <SerialRes> WriteComm(byte[] buff, W32Serial.SerWriteInfoCmpareInfo ovInf = null)
        {
            TaskCompletionSource <SerialRes> ts = new TaskCompletionSource <SerialRes>();

            WriteComm(new W32Serial.SerWriteInfo
            {
                OverRideInfo = ovInf,
                buf          = buff,
                Done         = (stat, err) =>
                {
                    ts.SetResult(new SerialRes {
                        OK = stat, Err = err
                    });
                }
            });

            return(ts.Task);
        }
コード例 #2
0
ファイル: SimpleDriver.cs プロジェクト: gzhangx/netcvreco
 public bool canOverRide(W32Serial.SerWriteInfoCmpareInfo a)
 {
     return(Oper == ((SimpleDriveCompar)a).Oper);
 }
コード例 #3
0
ファイル: SerialControl.cs プロジェクト: gzhangx/netcvreco
 public Task <SerialRes> WriteComm(string s, W32Serial.SerWriteInfoCmpareInfo ovInf = null)
 {
     return(WriteComm(System.Text.ASCIIEncoding.ASCII.GetBytes(s), ovInf));
 }