Пример #1
0
        /// <summary>
        /// 无线端打开播放语音
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static byte[] OpenTheDoorAndVoice(OpenTheDoorParam2 param)
        {
            List <byte> bylist = new List <byte>();

            bylist.AddRange(Encoding.Default.GetBytes(param.IcCardNumber.PadRight(8, '0')));
            bylist.AddRange(LincensePlateToByte(param.LicensePlateNumber));
            bylist.Add((byte)(48 + param.LicensePlateColor));
            bylist.AddRange(Encoding.Default.GetBytes(string.Format("{0:yyMMddHHmmss}", param.Time)));
            return(CombinatorialProtocol(2, 3, 67, param.DeviceAddress, 17, bylist.ToArray()));
        }
Пример #2
0
        /// <summary>
        /// 无线端打开播放语音
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static byte[] GetOpenDoor(OpenTheDoorParam2 param)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = param.DeviceAddress,
                FunctionAddress = 67,
                Command         = 17
            };
            List <byte> bylist = new List <byte>();

            bylist.AddRange(Encoding.Default.GetBytes(param.IcCardNumber.PadRight(8, '0')));
            bylist.AddRange(GetLincensePlateToByte(param.LicensePlateNumber));
            bylist.Add((byte)(48 + param.LicensePlateColor));
            bylist.AddRange(Encoding.Default.GetBytes(string.Format("{0:yyMMddHHmmss}", param.Time)));
            return(dh.Integration(bylist.ToArray()));
        }