public void RemoveErrorHandler(DelUartErrorHandler del) { if (del != null) { bpsErrorHandler -= del; } }
public void AddErrorHandler(DelUartErrorHandler del) { if (del != null) { bpsErrorHandler += del; } }
public BpsMng() { uartMngObj = UartMng.GetUartMngInstance(); // bpsRecvHandler = BPSRecvIdleHandler; bpsErrorHandler = BPSErrorIdleHandler; bpsSendDebugHandler = null; bpsRecvDebugHandler = null; serialDataReceivedEvent = new SerialDataReceivedEventHandler(UartDataeceivedCallback); uartMngObj.ReadCallbackAdd(serialDataReceivedEvent); serialErrorEvent = new SerialErrorReceivedEventHandler(UartErrorCallback); uartMngObj.ErrorCallbackAdd(serialErrorEvent); RecvBuffer = new List <byte>(); BpsHeaderClear(); enBPSParseStep = EnBPSParseStep.EN_BPS_PARSE_HEADER; remainLength = 0; }