Exemplo n.º 1
0
        static public bool AnalyseGetTime(byte[] pBufRec, int iBufLen, ref DateTime dt)
        {
            byte bCmdType = GlareLedSysDefPub.GasCardDef.BT_CmdGetTime;

            if (pBufRec[0] != GlareLedSysDefPub.GasCardDef.BT_CmdStart &&
                pBufRec[1] != GlareLedSysDefPub.GasCardDef.BT_RecCmdStart &&
                pBufRec[GlareLedSysDefPub.GasCardDef.CmdOffsetOfTypeSection] != bCmdType &&
                pBufRec[pBufRec.Length - 1] != GlareLedSysDefPub.GasCardDef.BT_CmdEnd)
            {
                LogMgr.WriteErrorDefSys("命令码不对");
                return(false);
            }

            if (!GLLedProtocol.IsCheckSumCorrect(pBufRec, pBufRec[pBufRec.Length - 2]))
            {
                LogMgr.WriteErrorDefSys("校验错了");
                return(false);
            }

            return(true);
        }