Example #1
0
        public bool SSend(TranMsg req, int timeout, out TranAckMsg resp)
        {
            DtuMsg msg = this._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);
            }
        }
Example #2
0
 private bool IsValidAck(TranMsg req, TranAckMsg resp)
 {
     return(resp.Received == req.LoadSize || resp.ID != req.ID);
 }