Beispiel #1
0
        /// <summary>
        /// 签退
        /// </summary>
        /// <returns></returns>
        static Dictionary <string, ResultData> signOut()
        {
            Dictionary <int, string> data = new Dictionary <int, string>();

            data.Add(3, "000000");
            data.Add(11, "000006");
            data.Add(12, getHHMMSS());
            data.Add(41, "pos00001");
            data.Add(42, "000000000000257");
            data.Add(60, "22000003000");
            data.Add(63, "01");
            byte[] sendData = EncryptWT.EncryptData("0820", "6000000000", EncryptWT.encryptLKL(data, calculateMac(data, "0400")));
            Console.WriteLine(BCDUtil.byteArrToString(sendData));
            AnalysisBaseWT lk = new AnalysisBaseWT();

            byte[] result = Client(LakalaIp, LakalaPort, sendData);
            if (result.Length > 0)
            {
                return(lk.analysis(result)); //发送数据
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// ZMK密钥下载
        /// </summary>
        /// <returns></returns>
        static void downKey()
        {
            Dictionary <int, string> data = new Dictionary <int, string>();

            data.Add(3, "060000");
            data.Add(11, "000002");
            data.Add(41, "pos00001");
            data.Add(42, "000000000000257");
            //data.Add(62, mackey);
            data.Add(63, "01");
            AnalysisBaseWT wt = new AnalysisBaseWT();

            byte[] result = Client(LakalaIp, LakalaPort, EncryptWT.EncryptData("0800", "6000000000", EncryptWT.encryptLKL(data, null))); //发送数据
            Dictionary <string, ResultData> rd = wt.analysis(result);

            sonKey = validateKey(rd["62"].value, matherKey);
            printInfo(rd);
        }