Ejemplo n.º 1
0
        protected CheckReadProtectedInfo HandelCheckReadProtectedFrame(byte[] frame)
        {
            CheckReadProtectedInfo info       = new CheckReadProtectedInfo(frame);
            ReturnMessage          returnCode = CheckFrame(info);

            if (returnCode != ReturnMessage.Success)
            {
                info.ReturnValue = returnCode;
                return(info);
            }
            info.Protected = frame[4] == 0x00 ? false : true;

            info.ReturnValue = ReturnMessage.Success;
            return(info);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 这个命令不能测试标签是否支持读保护锁定命令,只能测试标签是否被读保护锁定。对于不支持读保护锁定的电子标签,一致认为没有被锁定。
        /// 这个命令只能对单张电子标签进行操作,确保天线有效范围内只存在一张电子标签。仅对NXP的UCODE EPC G2X标签有效。
        /// </summary>
        /// <returns></returns>
        public async Task <CheckReadProtectedInfo> CheckReadProtectedAsync()
        {
            byte[] frame = CreateCheckReadProtectedFrame();
            CommunicationReturnInfo cri = await com.SendAsync(frame);

            if (cri.ReturnValue != ReturnMessage.Success)
            {
                CheckReadProtectedInfo crpi = new CheckReadProtectedInfo();
                crpi.SendByte         = frame;
                crpi.ReturnValue      = cri.ReturnValue;
                crpi.ExceptionMessage = cri.ExceptionMessage;
                return(crpi);
            }

            CheckReadProtectedInfo info = HandelCheckReadProtectedFrame(cri.RecvByte);

            info.SendByte = frame;
            return(info);
        }