// Constructor ( from reference held only ! )
 public Source_SingulationParametersDynamicQ(
     rfid.Structures.DynamicQParms from
 )
     : base()
 {
     this.nativeSingulationParms = from;
 }
예제 #2
0
 public Source_MacRegion(
     rfid.Constants.MacRegion r_macRegion
 )
     : base()
 {
     this.macRegion = r_macRegion;
 }
 public Source_RadioOperationMode(
     rfid.Constants.RadioOperationMode radioOperationMode  
 )
     : base()
 {
     this.radioOperationMode = radioOperationMode;
 }
예제 #4
0
        public Source_Version(
            rfid.Structures.Version version
        )
        {
            // Currently just reference copy ~ change to deep
            // copy later or ?

            this.version = version;
        }
예제 #5
0
        public Source_LinkProfile(
            rfid.Structures.RadioLinkProfile linkProfile
        )
        {
            // Currently just reference copy ~ change to deep
            // copy later or ?

            this.linkProfile = linkProfile;
        }
예제 #6
0
 public Source_GPIO(
     rfid.Constants.GpioPin nativePin,
     OpState                state
 )
     : base()
 {
     this.nativePin = nativePin;
     this.access    = OpAccess.SET;
     this.state     = state;
     this.status    = OpResult.FAILURE;
 }
예제 #7
0
        public Source_Antenna(
            byte                                          port,
            rfid.Constants.AntennaPortState state,
            UInt16                                          powerLevel,
            UInt16                                          dwellTime,
            UInt16                                          numberInventoryCycles,
            byte                                            physicalPort,
            UInt32                                          antennaSenseThreshold
        )
            : base()
        {
            this.port = port;
            this.antennaResult = new Source_AntennaResult( port );
            this.antennaConfig = new Source_AntennaConfig( port );

            this.State                 = state;
            this.PowerLevel            = powerLevel;
            this.DwellTime             = dwellTime;
            this.NumberInventoryCycles = numberInventoryCycles;
            this.PhysicalPort          = physicalPort;
            this.AntennaSenseThreshold = antennaSenseThreshold;
        }
예제 #8
0
 public rfid.Constants.Result load(
     rfid.Linkage transport,
     UInt32       readerHandle
 )
 {
     return transport.API_MacGetRegion(ref this.macRegion, ref this.macRegionSupport);
 }
예제 #9
0
 private TagAccessReads _tagAccessReadSet;//??把计??//Add LargeRead command
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ManagedAccess"></param>
 /// <param name="Handle"></param>
 /// <param name="MemoryBank"></param>
 /// <param name="?"></param>
 public ReaderInterfaceThreadClass(rfid.Linkage ManagedAccess, int Handle, TagAccessData tagAccessData, TagAccessReads tagAccessDataRead)//??把计??//Add LargeRead command
 {
     _access = ManagedAccess;
     _handle = Handle;
     _tagAccessData = tagAccessData;
     _tagAccessReadSet = tagAccessDataRead;//把计??
 }
예제 #10
0
        //public rfid.Constants.Result load
        //(
        //    rfid.Linkage transport,
        //    UInt32       readerHandle
        //)
        //{
        //    UInt32[ ] buffer = new UInt32[ OEMCFG_AREA_MAP_SIZE_WORDS ];
        //    uint length = (uint)buffer.Length;
        //    rfid.Constants.Result Result = transport.MacReadOemData
        //        (
        //            ( int ) readerHandle,
        //            0,
        //            ref length,
        //            buffer
        //        );
        //    if ( rfid.Constants.Result.OK == Result )
        //    {
        //        buffer.CopyTo( oemDataBuffer, 0 );
        //    }
        //    return Result;
        //}
        //clark 2011.3.23
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            UInt32[] tmpBuf = new UInt32[OEMCFG_AREA_MAP_SIZE_WORDS];
            rfid.Constants.Result Result = rfid.Constants.Result.OK;

            Array.Clear(tmpBuf, 0, tmpBuf.Length);

            //MacReadOemData only store one ome at one time. Store all ome to buf.
            for (ushort index = 0; index < OEMCFG_AREA_MAP_SIZE_WORDS; index++)
            {
                Result = transport.API_MacWriteOemData(index,
                                                       oemDataBuffer[index]);

                if (rfid.Constants.Result.OK != Result)
                    return Result;
            }

            return Result;
        }
예제 #11
0
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32                             readerHandle
        )
        {
            Result result;

            result = transport.API_l8K6CSetQueryTagGroup(this.nativeTagGroup);

            if (Result.OK != result)
            {
                return result;
            }

            SingulationAlgorithm algorithm;

            Type algoType = this.nativeSingulationParms.GetType();

            if (algoType == typeof(FixedQParms))
                algorithm = SingulationAlgorithm.FIXEDQ;
            else if (algoType == typeof(DynamicQParms))
                algorithm = SingulationAlgorithm.DYNAMICQ;
            else
                return Result.INVALID_PARAMETER;

            result = transport.API_l8K6CSetCurrentSingulationAlgorithm(algorithm);

            if (Result.OK != result)
            {
                return result;
            }

            result = transport.API_l8K6CSetSingulationAlgorithmParameters( algorithm,
                                                                           this.nativeSingulationParms );

            return result;
        }
예제 #12
0
        // This load for basic grab current fields on board
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            Result result;

            result = transport.API_l8K6CGetQueryTagGroup( ref this.nativeTagGroup);

            if (Result.OK != result)
            {
                return result;
            }

            SingulationAlgorithm algorithm = SingulationAlgorithm.UNKNOWN;

            result = transport.API_l8K6CGetCurrentSingulationAlgorithm(ref algorithm);

            if (Result.OK != result)
            {
                return result;
            }

            switch (algorithm)
            {
                case SingulationAlgorithm.FIXEDQ:
                    {
                        this.nativeSingulationParms = new FixedQParms();
                    }
                    break;
                case SingulationAlgorithm.DYNAMICQ:
                    {
                        this.nativeSingulationParms = new DynamicQParms();
                    }
                    break;
                //case SingulationAlgorithm.DYNAMICQ_ADJUST:
                //    {

                //    }
                //    break;
                //case SingulationAlgorithm.DYNAMICQ_THRESHOLD:
                //    {

                //    }
                //    break;

                default:
                    {
                        return Result.DRIVER_MISMATCH;
                    }
            }

            result = transport.API_l8K6CGetSingulationAlgorithmParameters
                (
                    algorithm,
                    ref this.nativeSingulationParms
                );

            if ( Result.OK == result )
            {

                Type algoType = this.nativeSingulationParms.GetType();

                if (algoType == typeof(rfid.Structures.FixedQParms))
                {
                    this.sourceParameters = new Source_SingulationParametersFixedQ
                        (
                            ( rfid.Structures.FixedQParms ) this.nativeSingulationParms
                        );
                }
                else if (algoType == typeof(rfid.Structures.DynamicQParms))
                {
                    this.sourceParameters = new Source_SingulationParametersDynamicQ
                        (
                            ( rfid.Structures.DynamicQParms ) this.nativeSingulationParms
                        );
                }
                 else
                 {
                    System.Windows.Forms.MessageBox.Show( "ERR : Algorithm.Copy( Source_QueryParms from )" );
                    Console.WriteLine( "ERR : Algorithm.Copy( Source_QueryParms from )" );
                 }
            }

            return result;
        }
예제 #13
0
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32 readerHandle
        )
        {
            // There is no save for the antennaPortStatus in lower library but
            // there is a set state so use that here!

            rfid.Constants.Result Result = transport.API_AntennaPortSetState(this.port,
                                                                             this.antennaPortStatus.state );

            if ( rfid.Constants.Result.OK != Result )
            {
                Console.WriteLine( "Error while saving antennaPortStatus.state" );
            }

            return Result;
        }
예제 #14
0
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            rfid.Constants.Result Result = transport.API_AntennaPortGetState( this.port,
                                                                              ref this.antennaPortStatus );

            return Result;
        }
예제 #15
0
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32                             readerHandle
        )
        {
            rfid.Constants.Result Result = transport.API_AntennaPortSetSenseThreshold
            (
                this.antennaPortConfig.antennaSenseThreshold
            );

            if ( rfid.Constants.Result.OK != Result )
            {
                Console.WriteLine("Error while storing global antenna sense threshold");
            }

            Result = transport.API_AntennaPortSetConfiguration
                (
                    port,
                    this.antennaPortConfig
                );

            if ( rfid.Constants.Result.OK != Result )
            {
                //Console.WriteLine( "Error while storing AntennaPortConfig" );  //clark 2011.2.16 Copied from R1000 Tracer
                Console.WriteLine("Error while storing AntennaPortConfig port:" + port);
            }

            return Result;
        }
        public bool Equals( rfid.Structures.FixedQParms rhs )
        {
            if ( null == ( System.Object ) rhs )
            {
                return false;
            }

            return
                   this.QValue            == rhs.qValue
                && this.RetryCount        == rhs.retryCount
                && this.ToggleTarget      == rhs.toggleTarget
                && this.RepeatUntilNoTags == rhs.repeatUntilNoTags;
        }
 // Constructor ( from reference held only ! )
 public Source_SingulationParametersFixedQ(
     rfid.Structures.FixedQParms from
 )
     : base()
 {
     base.nativeSingulationParms = from;
 }
        public bool Equals( rfid.Structures.DynamicQParms rhs )
        {
            if ( null == ( System.Object ) rhs )
            {
                return false;
            }

            return
                   this.StartQValue         == rhs.startQValue
                && this.MinQValue           == rhs.minQValue
                && this.MaxQValue           == rhs.maxQValue
                && this.RetryCount          == rhs.retryCount
                && this.ToggleTarget        == rhs.toggleTarget
                && this.ThresholdMultiplier == rhs.thresholdMultiplier;
        }
예제 #19
0
 public rfid.Constants.Result store(
     rfid.Linkage transport,
     UInt32       readerHandle
 )
 {
     return transport.API_MacSetRegion(this.macRegion);
 }
예제 #20
0
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32                             readerHandle
        )
        {
            rfid.Constants.Result Result = transport.API_AntennaPortGetConfiguration
                (
                        port,
                    ref this.antennaPortConfig
                );

            if (Result != rfid.Constants.Result.OK)
            {
                Console.WriteLine("Error while retrieving global antenna sense threshold");
                return Result;
            }

            Result = transport.API_AntennaPortGetSenseThreshold
                (
                     ref this.antennaPortConfig.antennaSenseThreshold
                );

            return Result;
        }
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32                             readerHandle
        )
        {
            rfid.Constants.Result Result = transport.API_ConfigSetOperationMode(this.radioOperationMode);

            return Result;
        }
예제 #22
0
        // Grabs the values on board for the specified algorithm but leaves
        // board in original state - warning - MANY POINTS OF FAILURE - you
        // have been warned.
        public rfid.Constants.Result loadForAlgorithm(
            rfid.Linkage                        transport,
            UInt32                              readerHandle,
            rfid.Constants.SingulationAlgorithm algorithm
        )
        {
            // Need to do lower level register manipulation for this one...

            UInt32 reg_0x0901 = 0;

            Result result = Result.OK;

            try
            {
                // Set the algo on the board ~ maintaining all other fields

                result = transport.API_ConfigReadRegister
                (
                    ( UInt16 ) 0x0901, ref reg_0x0901
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    throw new Exception( result.ToString( ) );
                }

                result = transport.API_ConfigWriteRegister
                (
                    ( UInt16 ) 0x0901, ( reg_0x0901 & 0xFFFFFFC0 ) | ( UInt32 ) algorithm
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    throw new Exception( result.ToString( ) );
                }

                // Set for the algo register bank on the board

                result = transport.API_ConfigWriteRegister
                (
                    ( UInt16 ) 0x0902, ( UInt32 ) algorithm
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    throw new Exception( result.ToString( ) );
                }

                result = this.load( transport, readerHandle );

                if ( rfid.Constants.Result.OK != result )
                {
                    throw new Exception( result.ToString( ) );
                }

                // Restore algo bank reg to original value

                result = transport.API_ConfigWriteRegister
                (
                    ( UInt16 ) 0x0901, reg_0x0901
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    throw new Exception( result.ToString( ) );
                }

            }
            catch ( Exception )
            {
                // NOP - let fall thru to result check & msg display
            }

            // If we did ok, our source for the underlying singulation
            // parameters must also now be changed here AND grabbed at
            // the gui level ...

            if ( Result.OK == result )
            {
                switch( algorithm )
                {
                    case SingulationAlgorithm.FIXEDQ:
                    {
                        sourceParameters = new Source_SingulationParametersFixedQ
                            (
                                ( rfid.Structures.FixedQParms ) this.nativeSingulationParms
                            );
                    }
                    break;

                    case SingulationAlgorithm.DYNAMICQ:
                    {
                        sourceParameters = new Source_SingulationParametersDynamicQ
                            (
                                ( rfid.Structures.DynamicQParms ) this.nativeSingulationParms
                            );
                    }
                    break;

                    default:
                        Console.WriteLine( "ERR : Algorithm.Copy( Source_QueryParms from )" );

                    break;
                };
            }

            return result;
        }
예제 #23
0
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32                             readerHandle
        )
        {
            UInt32 config    = ( UInt32 ) state;
            UInt32 multdiv   = ( UInt32 ) ( this.divider      << 16 ) | ( UInt32 ) this.multiplier;
            UInt32 pllcc     = ( UInt32 ) ( this.guardBand    << 24 ) |
                               ( UInt32 ) ( this.maxDACBand   << 16 ) |
                               ( UInt32 ) ( this.affinityBand << 8  ) |
                               ( UInt32 ) ( this.minDACBand         ) ;

            rfid.Constants.Result result = transport.API_ConfigWriteRegister
            (
                SELECTOR_ADDRESS,
                this.band
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            result = transport.API_ConfigWriteRegister
            (
                CONFIG_ADDRESS,
                config
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            result = transport.API_ConfigReadRegister
            (
                CONFIG_ADDRESS,
                ref config
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            if ( BandState.ENABLED == ( BandState ) config )
            {
                result = transport.API_ConfigWriteRegister
                (
                    MULTDIV_ADDRESS,
                    multdiv
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    return result;
                }

                result = transport.API_ConfigReadRegister
                (
                    MULTDIV_ADDRESS,
                    ref multdiv
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    return result;
                }

                result = transport.API_ConfigWriteRegister
                (
                    PLLCC_ADDRESS,
                    pllcc
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    return result;
                }

                result = transport.API_ConfigReadRegister
                (
                    PLLCC_ADDRESS,
                    ref pllcc
                );

                if ( rfid.Constants.Result.OK != result )
                {
                    return result;
                }

            }

            this.multiplier   = ( UInt16 ) ( ( multdiv >>  0 ) & 0xffff );
            this.divider      = ( UInt16 ) ( ( multdiv >> 16 ) & 0xff   );

            this.minDACBand   = ( UInt16 ) ( ( pllcc >>  0 ) & 0xff );
            this.affinityBand = ( UInt16 ) ( ( pllcc >>  8 ) & 0xff );
            this.maxDACBand   = ( UInt16 ) ( ( pllcc >> 16 ) & 0xff );
            this.guardBand    = ( UInt16 ) ( ( pllcc >> 24 ) & 0xff );

            return rfid.Constants.Result.OK;
        }
예제 #24
0
        //clark 2011.3.23
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            UInt32[ ] tmpBuf = new UInt32[ OEMCFG_AREA_MAP_SIZE_WORDS ];
            rfid.Constants.Result Result = rfid.Constants.Result.OK;

            Array.Clear(tmpBuf, 0, tmpBuf.Length);

            //MacReadOemData only load one ome at one time. load all ome to buf.
            for (ushort index = 0; index < OEMCFG_AREA_MAP_SIZE_WORDS; index++)
            {
                Result = transport.API_MacReadOemData(index,
                                                      ref tmpBuf[index]);

                if (rfid.Constants.Result.OK != Result)
                    return Result;
            }

            tmpBuf.CopyTo(oemDataBuffer, 0);

            return Result;
        }
예제 #25
0
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            // TODO : validate that when doin store the given pin has
            //        access flag in GET mode (?)

            // Configure pin to set mode

            rfid.Constants.Result result    = rfid.Constants.Result.OK;
            rfid.Constants.Result resultErr = rfid.Constants.Result.OK;
            uint uiCurError  = 0;
            uint uiLastError = 0;
            byte getValue    = 0;

            //Set access to "Get"
            result = transport.API_GpioSetPinsConfiguration( (byte)this.nativePin,
                                                          0                     );
            if (rfid.Constants.Result.OK != result)
            {

                //Get error
                resultErr = transport.API_MacGetError(ref uiCurError, ref uiLastError);

                //Can't get error
                if (resultErr != rfid.Constants.Result.OK)
                {
                    this.status = OpResult.FAILURE;
                    return resultErr;
                }

                //If error = 0x2B, it means doesn't support this pin
                if (uiCurError == 0x2B)
                {
                    this.status = OpResult.UNSUPPORTED;
                    return result;
                }
                else
                {
                    this.status = OpResult.FAILURE;
                    return result;
                }

            }

            //Get GPIO Status
            result = transport.API_GpioReadPins( (byte)this.nativePin,
                                                  ref  getValue        );

            if ( rfid.Constants.Result.OK == result )
            {
                this.state  = ( ( UInt32 ) this.nativePin & getValue ) == 0 ? OpState.LO : OpState.HI;
                this.status = OpResult.SUCCESS;
            }
            else
            {
                this.state  = OpState.FAILURE;
                this.status = OpResult.FAILURE;
            }

            return result;
        }
예제 #26
0
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32                             readerHandle
        )
        {
            // Err msgs emitted thru antennaResult & antennaConfig store( )

            rfid.Constants.Result Result = this.antennaResult.store( transport, readerHandle );

            if ( rfid.Constants.Result.OK != Result )
            {
                return Result;
            }

            return this.antennaConfig.store( transport, readerHandle );
        }
예제 #27
0
        public rfid.Constants.Result store(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            // TODO : validate that when doin store the given pin has
            //        access flag in SET mode (?)

            // Configure pin to set mode

            rfid.Constants.Result result = rfid.Constants.Result.OK;

            result = transport.API_GpioSetPinsConfiguration( (byte)this.nativePin,
                                                             (byte)this.nativePin  );

            if ( rfid.Constants.Result.OK != result )
            {
                this.status = OpResult.FAILURE;

                return result;
            }

            //2011.12.30 check state
            if(this.state != OpState.HI && this.state != OpState.LO)
            {
                this.status = OpResult.FAILURE;

                return rfid.Constants.Result.INVALID_ANTENNA;
            }

            //Set state
            result = transport.API_GpioWritePins
                                ( (byte)this.nativePin,
                                  (byte)(OpState.LO == this.state ? 0 : this.nativePin) );

            if ( rfid.Constants.Result.OK != result )
            {
                this.status = OpResult.FAILURE;
            }
            else
            {
                this.status = OpResult.SUCCESS;
            }

            return result;
        }
예제 #28
0
        // Load frequency info, actually does Nx calls - any
        // of which may fail and cause an error return
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            UInt32 config            = 0;
            UInt32 multdiv           = 0;
            UInt32 pllcc             = 0;

            rfid.Constants.Result result = transport.API_ConfigWriteRegister
            (
                SELECTOR_ADDRESS,
                this.band
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            result = transport.API_ConfigReadRegister
            (
                CONFIG_ADDRESS,
                ref config
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            result = transport.API_ConfigReadRegister
            (
                MULTDIV_ADDRESS,
                ref multdiv
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            result = transport.API_ConfigReadRegister
            (
                PLLCC_ADDRESS,
                ref pllcc
            );

            if ( rfid.Constants.Result.OK != result )
            {
                return result;
            }

            try
            {
                this.state = ( BandState ) ( config == 0 ? 0 : 1 );
            }
            catch ( Exception )
            {
                this.state = BandState.UNKNOWN;
            }

            this.multiplier   = ( UInt16 ) ( ( multdiv >> 0  ) & 0xffff );
            this.divider      = ( UInt16 ) ( ( multdiv >> 16 ) & 0xff   );

            this.minDACBand   = ( UInt16 ) ( ( pllcc >> 0  ) & 0xff );
            this.affinityBand = ( UInt16 ) ( ( pllcc >> 8  ) & 0xff );
            this.maxDACBand   = ( UInt16 ) ( ( pllcc >> 16 ) & 0xff );
            this.guardBand    = ( UInt16 ) ( ( pllcc >> 24 ) & 0xff );

            return rfid.Constants.Result.OK;
        }
예제 #29
0
            /// <summary>
            /// Constructor for Inventory
            /// </summary>
            /// <param name="ManagedAccess"></param>
            /// <param name="Handle"></param>
            /// <param name="WantSinglePackets"></param>
            /// <param name="runCount"></param>
            public ReaderInterfaceThreadClass(rfid.Linkage ManagedAccess, int Handle, bool WantSinglePackets, RadioOperationMode r_OpMode, TagAccessFlag r_strcTagFlag)
            {
                if (r_OpMode == RadioOperationMode.UNKNOWN)
                {
                    throw new ArgumentOutOfRangeException("OpMode", "OpMode must be CONTINUE or NON_CONTINUE");
                }

                _strcTagFlag = r_strcTagFlag;
                _OpMode = r_OpMode;
                _access = ManagedAccess;
                _handle = Handle;
                _singlePackets = WantSinglePackets;
                _stopRequest = false;
            }