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); } }
private bool IsValidAck(TranMsg req, TranAckMsg resp) { return(resp.Received == req.LoadSize || resp.ID != req.ID); }