Ejemplo n.º 1
0
        private void OnSearchReaderTimer(object source, ElapsedEventArgs e)
        {
            lock (myLock)
            {
                if (startSearch)
                {
                    if (srchIndex >= rdrStatusList.Count)
                    {
                        if (counter >= MAX_TRY)
                        {
                            startSearch = false;
                            srchIndex   = 0;
                            ProcessSrchList();
                            return;
                        }

                        srchIndex = 0;
                        counter  += 1;
                    }

                    readerStatStruct rdrStat = new readerStatStruct(0);                     //create an readerStatStruct object with temp rdr id

                    for (int n = srchIndex; n < rdrStatusList.Count; n++)
                    {
                        rdrStat = (readerStatStruct)rdrStatusList[n];

                        if (rdrStat.GetSearchReader())
                        {
                            if (rdrStat.GetCounter() < MAX_TRY)
                            {
                                if (!rdrStat.GetSrchStatus())                                 //tagFound
                                {
                                    Console.WriteLine("OnSearchTimer(TagSearchClass) send Query Cmd time:" + DateTime.Now.ToString());
                                    int ret = communication.QueryTag(rdrStat.rdrID, srchTagID, "AST");
                                    return;
                                }
                            }
                        }

                        srchIndex += 1;
                    }
                }        //if (startSearch)
            }            //lock
        }