예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bs"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        static public bool Parse(byte[] bs, out RainRequest result)
        {
            result = null;

            if (bs != null || bs.Length == 15)
            {
                if (bs[0] == 0x5b &&
                    bs[1] == 0x5b &&
                    bs[3] == 0x01 &&
                    bs[13] == 0x5d &&
                    bs[14] == 0x5d)
                {
                    byte     address = bs[2];
                    long     ticks   = BitConverter.ToInt64(bs, 5);
                    DateTime dt      = new DateTime(ticks);

                    result = new RainRequest(address, dt);
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
파일: Class1.cs 프로젝트: hkiaipc/lx
        /// <summary>
        /// 
        /// </summary>
        /// <param name="bs"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static bool Parse(byte[] bs, out RainRequest result)
        {
            result = null;

            if (bs != null || bs.Length == 15)
            {
                if (bs[0] == 0x5b &&
                    bs[1] == 0x5b &&
                    bs[3] == 0x01 &&
                    bs[13] == 0x5d &&
                    bs[14] == 0x5d)
                {
                    byte address = bs[2];
                    long ticks = BitConverter.ToInt64(bs, 5);
                    DateTime dt = new DateTime(ticks);

                    result = new RainRequest(address, dt);
                    return true;
                }
            }
            return false;
        }