示例#1
0
        public bool SSend(TranMsg req, int timeout, out TranAckMsg resp)
        {
            DtuMsg msg = _dtuConnection.Ssend(req.Marshall(), timeout);

            resp = new TranAckMsg();
            if (msg.IsOK())
            {
                resp.Unmarshall(msg.Databuffer);
                return(true);
            }
            else
            {
                resp.ErrorMsg  = msg.ErrorMsg;
                resp.ErrorCode = msg.ErrorCode;
                return(false);
            }
        }
示例#2
0
 private bool IsValidAck(TranMsg req, TranAckMsg resp)
 {
     return(resp.Received == req.LoadSize || resp.ID != req.ID);
 }