// 接收流控制帧 private SendResult ReceiveFlowControlFrame() { byte flowControl = 0; if (DcmTpProtocalISO15765Receiver.Instance().ReceiveFlowControlFrame(ref flowControl, ref blockSize, ref stMin)) { FlowControlStateEnum flowControlState = (FlowControlStateEnum)flowControl; switch (flowControlState) { case FlowControlStateEnum.Wait: WorkState = WorkStateEnum.WaitFlowControlFrame; break; case FlowControlStateEnum.Overflow: return(SendFailed); case FlowControlStateEnum.Continue: stopwatch.Restart(); WorkState = WorkStateEnum.SendConsecutiveFrame; CurrentBlockSize = 0; break; } return(SendResult.Working); } return(SendResult.Working); }
public static DcmTpProtocalISO15765Receiver Instance() { if (instance == null) { lock (syncRoot) { if (instance == null) { instance = new DcmTpProtocalISO15765Receiver(); } } } return(instance); }