Example #1
0
        public static byte[] GetCloseModule()
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 67,
                Command         = 210
            };

            return(dh.Integration());
        }
Example #2
0
        public static byte[] GetSearchHost(int number)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                FunctionAddress = 49,
                DeviceAddress   = number,
                Command         = 0
            };

            return(dh.Integration());
        }
Example #3
0
        public static byte[] GetReadTemporaryIC()
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                FunctionAddress = 66,
                DeviceAddress   = 0,
                Command         = 9
            };

            return(dh.Integration());
        }
Example #4
0
        public static byte[] SetIcCardContent(string content)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                FunctionAddress = 66,
                DeviceAddress   = 0,
                Command         = 2
            };

            return(dh.Integration(Encoding.Default.GetBytes(content)));
        }
Example #5
0
        public static byte[] GetSearchCard(string cardnumber)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes(string.Format("1500{0}00000000", cardnumber));
            return(dh.Integration(by));
        }
Example #6
0
        public static byte[] GetReadSomeCard(string cardnumber, int len)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes(string.Format("1A00{0}000100{1:X2}", cardnumber, len));
            return(dh.Integration(by));
        }
Example #7
0
        /// <summary>
        /// 开门不播报语言
        /// </summary>
        /// <param name="deviceaddress"></param>
        /// <returns></returns>
        public static byte[] GetOpenDoor(int deviceaddress)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = deviceaddress,
                Command         = 19,
                FunctionAddress = 67
            };

            byte[] by = Encoding.Default.GetBytes("123456");
            return(dh.Integration(by));
        }
Example #8
0
        public static byte[] GetSetModule(string content)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                FunctionAddress = 67,
                DeviceAddress   = 0,
                Command         = 208
            };

            byte[] by = Encoding.ASCII.GetBytes(content);
            return(dh.Integration(by));
        }
Example #9
0
        public static byte[] GetTemporaryEncryption(string pwd)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 66,
                Command         = 221
            };

            byte[] by = Encoding.ASCII.GetBytes("FFFF" + pwd);
            return(dh.Integration(by));
        }
Example #10
0
        public static byte[] SetModuleNumber(string strnumber)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 1,
                FunctionAddress = 50,
                Command         = 1
            };

            byte[] by = Encoding.ASCII.GetBytes(string.Format("1234{0}", strnumber.PadLeft(8, '0')));
            return(dh.Integration(by));
        }
Example #11
0
        public static byte[] GetDistanceEncryption(string pwd)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes(string.Format("A000010000009887{0}", pwd));
            return(dh.Integration(by));
        }
Example #12
0
        public static byte[] GetLossContent(string cardnumber, string content)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes(string.Format("1B00{0}000100{1:X2}{2}", cardnumber, content.Length / 2, content));
            return(dh.Integration(by));
        }
Example #13
0
        public static byte[] GetReadSomeCard(string cardnumber)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes("1A00" + cardnumber + "00010003");
            return(dh.Integration(by));
        }
Example #14
0
        public static byte[] GetDistanceContent(string cardnumber, int type, int start, string data)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes(string.Format("1B00{0}{1:X2}01{2:X2}{3:X2}{4}", cardnumber, type, start, data.Length / 2, data));
            return(dh.Integration(by));
        }
Example #15
0
        public static byte[] GetReadAllCard()
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 65,
                Command         = 0
            };

            byte[] by = Encoding.ASCII.GetBytes("0A8000000000010003");
            return(dh.Integration(by));
        }
Example #16
0
        public static byte[] GetClientNumber(int number)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 1,
                FunctionAddress = 51,
                Command         = 160
            };

            byte[] by = Encoding.Default.GetBytes("123456" + number.ToString().PadLeft(4, '0'));
            return(dh.Integration(by));
        }
Example #17
0
        public static byte[] GetOpenDoor(string content)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = 0,
                FunctionAddress = 67,
                Command         = 17
            };

            byte[] by = Encoding.Default.GetBytes(content);
            return(dh.Integration(by));
        }
Example #18
0
        public static byte[] GetVoice(VoiceParam param)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = param.DeviceAddress,
                FunctionAddress = 67,
                Command         = 18
            };
            List <byte> bylist = new List <byte>();

            bylist.AddRange(GetLincensePlateToByte(param.licensePlateNumber));
            bylist.Add((byte)param.LicensePlateColor);
            bylist.AddRange(Encoding.Default.GetBytes(string.Format("{0:X6}{1:X4}", param.Minute, (int)param.Money)));
            return(dh.Integration(bylist.ToArray()));
        }
Example #19
0
        /// <summary>
        /// 有线端开门播报语言
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static byte[] GetOpenDoor(OpenTheDoorParam param)
        {
            DealHandler dh = new DealHandler()
            {
                Head            = 2,
                End             = 3,
                DeviceAddress   = param.DeviceAddress,
                FunctionAddress = 67,
                Command         = 16
            };
            List <byte> bylist = new List <byte>();

            bylist.AddRange(GetLincensePlateToByte(param.licensePlateNumber));
            bylist.Add((byte)(48 + param.LicensePlateColor));
            bylist.AddRange(Encoding.Default.GetBytes(string.Format("{0:yyMMddHHmmss}{1:X2}", param.Time, param.Day)));
            return(dh.Integration(bylist.ToArray()));
        }