Esempio n. 1
0
        /// <summary>
        /// 上位机执行该命令以获得电子标签的详细信息,这其中包括Information Flag,UID,DSFID,AFI,Memory,IC reference的信息。
        /// </summary>
        /// <returns></returns>
        public async Task <GetSystemInformationInfo> GetSystemInformationAsync()
        {
            byte[] frame = CreateGetSystemInformationFrame();
            CommunicationReturnInfo cri = await com.SendAsync(frame);

            if (cri.ReturnValue != ReturnMessage.Success)
            {
                GetSystemInformationInfo gii = new GetSystemInformationInfo();
                gii.SendByte         = frame;
                gii.ReturnValue      = cri.ReturnValue;
                gii.ExceptionMessage = cri.ExceptionMessage;
                return(gii);
            }
            GetSystemInformationInfo info = HandleGetSystemInformationFrame(cri.RecvByte);

            info.SendByte = frame;
            return(info);
        }
Esempio n. 2
0
        protected GetSystemInformationInfo HandleGetSystemInformationFrame(byte[] frame)
        {
            GetSystemInformationInfo info       = new GetSystemInformationInfo(frame);
            ReturnMessage            returnCode = CheckFrame(info);

            if (returnCode != ReturnMessage.Success)
            {
                info.ReturnValue = returnCode;
                return(info);
            }
            info.InformationFlag = frame[3];
            Array.Copy(frame, 4, info.UID, 0, 8); //拷贝UID
            info.DSFID = frame[12];               //拷贝 DSFID
            info.AFI   = frame[13];
            Array.Copy(frame, 14, info.MemorySize, 0, 2);
            info.ICReference = frame[16];
            info.ReturnValue = ReturnMessage.Success;
            return(info);
        }