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

            if (returnCode != ReturnMessage.Success)
            {
                info.ReturnValue = returnCode;
                return(info);
            }
            info.Size        = frame[3];
            info.ReturnValue = ReturnMessage.Success;
            return(info);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 选择指定UID的电子标签,返回该标签的容量标志。
        /// </summary>
        /// <param name="UID">指定的UID</param>
        /// <returns></returns>
        public async Task <SelectInfo> SelectAsync(byte[] UID)
        {
            byte[] frame = CreateSelectFrame(UID);
            CommunicationReturnInfo cri = await com.SendAsync(frame);

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

            SelectInfo info = HandleSelectFrame(cri.RecvByte);

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