예제 #1
0
        /// <summary>
        /// 带AFI的Inventory-scan。
        /// 新询查命令:在运行询查命令前,读写器会自动运行“Close RF”和“Open RF”。
        /// 这样,处于感应场内的AFI相符的电子标签均能响应,读写器会把在
        /// InventoryScanTime溢出前得到的UID全部返回
        /// 继续询查命令:读写器不会对感应场进行操作,只有新进入感应场的AFI相符的电
        /// 子标签或前面的询查命令没有得到UID的AFI相符的电子标签才会响应,并把在
        /// InventoryScanTime溢出前得到的UID返回
        /// </summary>
        /// <param name="mode">0x07:新询查命令,0x03:继续询查命令</param>
        /// <param name="afi">类型识别码<</param>
        /// <returns></returns>
        protected byte[] CreateInventoryScanWithAFIFrame(InventoryScanWithAFIMode mode, byte afi)
        {
            FrameBase frame = new FrameBase(0x06, Com_adr);

            byte[] db = frame.DataBlock;
            db[2] = I15693Cmd.Inventory;
            db[3] = (byte)mode;
            db[4] = afi;
            frame.PushCRC();
            return(db);
        }
예제 #2
0
        /// <summary>
        /// 带AFI的Inventory-scan。
        /// 新询查命令:在运行询查命令前,读写器会自动运行“Close RF”和“Open RF”。
        /// 这样,处于感应场内的AFI相符的电子标签均能响应,读写器会把在
        /// InventoryScanTime溢出前得到的UID全部返回
        /// 继续询查命令:读写器不会对感应场进行操作,只有新进入感应场的AFI相符的电
        /// 子标签或前面的询查命令没有得到UID的AFI相符的电子标签才会响应,并把在
        /// InventoryScanTime溢出前得到的UID返回
        /// </summary>
        /// <param name="mode">0x07:新询查命令,0x03:继续询查命令</param>
        /// <param name="afi">类型识别码</param>
        /// <returns></returns>
        public async Task <InventoryScanInfo> InventoryScanWithAFIAsync(InventoryScanWithAFIMode mode, byte afi)
        {
            byte[] frame = CreateInventoryScanWithAFIFrame(mode, afi);
            CommunicationReturnInfo cri = await com.SendAsync(frame);

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

            InventoryScanInfo info = HandleInventoryScanFrame(cri.RecvByte);

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