예제 #1
0
        private void Tag18K6CBlockErase(int radioHandle)
        {
            var program = new Rfiddler(options);

            BlockEraseParms blockEraseParms = new BlockEraseParms();

            logger.Information($"Starting basic block erase test, limiting of {options.PacketCount} MAC packets");

            blockEraseParms.common.tagStopCount = 0;
            blockEraseParms.common.callback     = program.PacketCallback;
            blockEraseParms.common.context      = IntPtr.Zero;
            blockEraseParms.common.callbackCode = IntPtr.Zero;

            blockEraseParms.blockEraseCmdParms.bank   = MemoryBank.RESERVED;
            blockEraseParms.blockEraseCmdParms.offset = 0;
            blockEraseParms.blockEraseCmdParms.count  = 4;

            blockEraseParms.accessPassword = 0x0;

            var result = link.Tag18K6CBlockErase(radioHandle, blockEraseParms, 0);

            logger.Information("link.Tag18K6CBlockErase => {Result}", result);
        }
예제 #2
0
            public void AccessThreadProc()
            {
                rfid.Constants.Result result = rfid.Constants.Result.NOT_INITIALIZED;

                byte flags = 0;

                StartEvent.WaitOne();

                switch (_tagAccessData.type)
                {
                    case TagAccessType.Read:
                        {
                            ReadParms parameters = new ReadParms();
                            BuildParams_ReadCmd(ref parameters.readCmdParms, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;
                           
                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagRead(parameters, flags);
                        }
                        break;
                    //Add LargeRead
                    case TagAccessType.LargeRead:
                        {
                            ReadParms parameters = new ReadParms();
                            BuildParams_ReadCmd(ref parameters.readCmdParms, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode = RadioOperationMode.NONCONTINUOUS;
                            parameters.readCmdParms.count = (byte)(_tagAccessReadSet.ReadWords);//籠筁count
                            //parameters.readCmdParms.offset = 0;
                            //□add loop
                            for (int ccnt = 0; ccnt < (_tagAccessReadSet.TotalReadWords /_tagAccessReadSet.ReadWords); ccnt++) // TotalReadWords/ReadWords
                            {
                                UInt16 choff = (UInt16)(_tagAccessReadSet.ReadWords);// readwords
                                result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagRead(parameters, flags);
                                parameters.readCmdParms.offset = (UInt16)(parameters.readCmdParms.offset + choff);
                                if (Stop) break;
                            }
                            //◆add loop  
                            //result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagRead(parameters, flags);
                        }
                        break;
                    case TagAccessType.Write:
                        {
                            WriteParms parameters = new WriteParms();
                            WriteSequentialParms writeParameters = new WriteSequentialParms();
                            BuildParams_WriteCmd(ref writeParameters, ref parameters.accessPassword);
                            parameters.writeParms = writeParameters;
                            parameters.writeType = WriteType.SEQUENTIAL;
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;

                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagWrite(parameters, flags);
                        }
                        break;
                    case TagAccessType.BlockWrite:
                        {
                            BlockWriteParms parameters = new BlockWriteParms();
                            BuildParams_BlockWriteCmd(ref parameters.blockWriteCmdParms, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;
                            
                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagBlockWrite(parameters, flags);
                        }
                        break;
                    case TagAccessType.BlockErase:
                        {
                            BlockEraseParms parameters = new BlockEraseParms();
                            BuildParams_BlockEraseCmd(ref parameters.blockEraseCmdParms, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;
                            
                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagBlockErase(parameters, flags);
                        }
                        break;
                    case TagAccessType.Lock:
                        {
                            LockParms parameters = new LockParms();
                            BuildParams_LockCmd(ref parameters.lockCmdParms, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;
                            
                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagLock(parameters, flags);
                        }
                        break;
                    case TagAccessType.Kill:
                        {
                            KillParms parameters = new KillParms();
                            BuildParams_KillCmd(ref parameters.killCmdParms, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;
                           
                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagKill(parameters, flags);
                        }
                        break;
                    case TagAccessType.QT_None:
                    case TagAccessType.QT_Read:
                    case TagAccessType.QT_Write:
                        {
                            QTParms parameters = new QTParms();
                            BuildParams_QT(ref parameters, ref parameters.accessPassword);
                            parameters.common.callback = new rfid.CallbackDelegate(this._reader.MyCallback);

                            //clark 2011.4.25 Set tag access flag to inventory structure
                            parameters.common.strcTagFlag.RetryCount    = _tagAccessData.strcTagFlag.RetryCount;
                            parameters.common.strcTagFlag.PostMatchFlag = _tagAccessData.strcTagFlag.PostMatchFlag;
                            parameters.common.strcTagFlag.SelectOpsFlag = _tagAccessData.strcTagFlag.SelectOpsFlag;
                            parameters.common.OpMode                    = RadioOperationMode.NONCONTINUOUS;

                            result = LakeChabotReader.MANAGED_ACCESS.API_l8K6CTagQT(parameters, flags);
                        }
                        break;
                    default:
                        System.Diagnostics.Debug.Assert(false, "Tag Acces Type");
                        break;
                }
            }