コード例 #1
0
        /****************************************************************************************************************************
         * FunctionName:GetUDataFromDat
         * Parameters In:DataBuf
         * Parameters Out:PIN,SmsID
         * Return Value:void
         * Device Used:For both Black&White and TFT screen devices.udata.dat
         * Function:To parse the attendence logs byte arrays to independent parameters
         * Auther:Darcy
         * Date:Oct.23, 2009
         *****************************************************************************************************************************/
        public void GetUDataFromDat(byte[] DataBuf, out int PIN, out int SmsID)
        {
            UData udata = new UData();

            udata = (UData)Raw.RawDeserialize(DataBuf, typeof(UData));

            PIN   = udata.PIN;
            SmsID = udata.SmsID;
        }
コード例 #2
0
        /****************************************************************************************************************************
         * FunctionName:SetUDataToDat
         * Parameters In:PIN,SmsID
         * Parameters Out:DataBuf
         * Return Value:void
         * Device Used:For both Black&White and TFT screen devices. udata.dat
         * Function:To convert imported parameters to the byte array
         * Auther:Darcy
         * Date:Oct.23, 2009
         *****************************************************************************************************************************/
        public void SetUDataToDat(out byte[] DataBuf, int PIN, int SmsID)
        {
            DataBuf = new byte[4];

            UData udata = new UData();

            udata.PIN   = (ushort)PIN;
            udata.SmsID = (ushort)SmsID;
            Array.Copy(Raw.RawSerialize(udata), DataBuf, 4);
        }