コード例 #1
0
        public PQEXCustomerInfo ReadCustomerInfo(out string error)
        {
            var result = this.ReadCustomerInfo((int)CodySystemTypeEnum.PQEX, out error);
            CodyPQEXRockeyArm codyPQEXRockeyArm = SmartSerializeHelper.DeserializeObject <CodyPQEXRockeyArm>(result.ObjDatas, CodyPQEXRockeyArm.LoadObj);

            return(new PQEXCustomerInfo()
            {
                CustomerKey = codyPQEXRockeyArm.CustomerKey,
                CustomerName = codyPQEXRockeyArm.CustomerName,
                CodySystemType = (int)CodySystemTypeEnum.PQEX,
                EmpowerDate = codyPQEXRockeyArm.EmpowerDate,
                HId = RockeyArmHelper.GetHIdStr(result.PDongleInfo)
            });
        }
コード例 #2
0
        public CertCustomerInfo ReadCustomerInfo(out string error)
        {
            var result = this.ReadCustomerInfo((int)CodySystemTypeEnum.Cert, out error);

            if (!string.IsNullOrEmpty(error))
            {
                return(null);
            }

            var rockeyArm = SmartSerializeHelper.DeserializeObject <CodyCertRockeyArm>(result.ObjDatas, CodyCertRockeyArm.LoadObj);

            return(new CertCustomerInfo()
            {
                CustomerKey = rockeyArm.CustomerKey,
                CustomerName = rockeyArm.CustomerName,
                CodySystemType = (int)CodySystemTypeEnum.Cert,
                EmpowerDate = rockeyArm.EmpowerDate,
                HId = RockeyArmHelper.GetHIdStr(result.PDongleInfo),
                OperatorLimit = rockeyArm.OperatorLimit
            });
        }
コード例 #3
0
        public string WriteCustomerInfo(int codySystemType, byte[] infoBytes, out string error)
        {
            //byte[] datas = SmartSerializeHelper.SerializeObject(obj, CodyPQRockeyArm.LoadBytes, false);
            List <byte> byteList = new List <byte>();

            byteList.AddRange(BitConverter.GetBytes(codySystemType));
            byteList.AddRange(BitConverter.GetBytes(infoBytes.Length));
            byteList.AddRange(infoBytes);

            try
            {
                DONGLE_INFO pDongleInfo = this.WriteData(byteList.ToArray());
                string      hId         = RockeyArmHelper.GetHIdStr(pDongleInfo);//回写设备Id

                error = string.Empty;
                return(hId);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(string.Empty);
            }
        }