コード例 #1
0
ファイル: MainActivity.cs プロジェクト: NDZL/IDP2018_forSEs
        void IRfidEventsListener.EventReadNotify(RfidReadEvents p0)
        {
            TagData[] myTags = Reader.Actions.GetReadTags(100);

            if (myTags != null)
            {
                Log.Debug(TAG, "Read Notification: size=" + myTags.Length);
                for (int index = 0; index < myTags.Length; index++)

                {
                    Log.Debug(TAG, "Tag ID " + myTags[index].TagID);
                    String tagID   = "id:" + myTags[index].TagID;
                    String tagRSSI = "rssi:" + myTags[index].PeakRSSI;

                    ////SINGULATION
                    if (!tagListDict.Contains(tagID) && myTags[index].PeakRSSI >= RSSI_THRESHOLD)
                    {
                        tagListDict.Add(tagID);
                        PrintOnScreen(tagID + " " + tagRSSI);
                    }

                    PrintStatus("Distinct tags seen: #" + tagListDict.Count);

                    //if (myTags[index].OpCode == ACCESS_OPERATION_CODE.AccessOperationRead &&
                    //    myTags[index].OpStatus == ACCESS_OPERATION_STATUS.AccessSuccess)
                    //{
                    //    if (myTags[index].MemoryBankData.Length > 0)
                    //    {
                    //        Log.Debug(TAG, " Mem Bank Data " + myTags[index].MemoryBankData);
                    //    }
                    //}
                }
            }
        }
コード例 #2
0
        // Read Event Notification
        public void EventReadNotify(RfidReadEvents e)
        {
            // Recommended to use new method getReadTagsEx for better performance in case of large tag population

            //TagData[] myTags = Reader.Actions.GetReadTags(100);

            //myTags = Reader.Actions.GetReadTags(100);

            //if (myTags != null)
            //{
            //   for (int index = 0; index < myTags.Length; index++)
            //   {
            //Log.Debug(TAG, "Tag ID " + myTags[index].TagID);
            //if (myTags[index].OpCode == ACCESS_OPERATION_CODE.AccessOperationRead && myTags[index].OpStatus == ACCESS_OPERATION_STATUS.AccessSuccess)
            //{
            //    if (myTags[index].MemoryBankData.Length > 0)
            //    {
            //        Log.Debug(TAG, " Mem Bank Data " + myTags[index].MemoryBankData);
            //    }
            //}



            //if (myTags[index].TagID == "305401B5F00134800000432800000032")
            //{
            //    //Reader.Config.DPOState = DYNAMIC_POWER_OPTIMIZATION.Disable;
            //    String tagId = "305401B5F00134800000432800000032";
            //    TagAccess tagAccess = new TagAccess();
            //    TagAccess.ReadAccessParams readAccessParams = new
            //    TagAccess.ReadAccessParams(tagAccess);
            //    TagData readAccessTag;
            //    readAccessParams.AccessPassword = 0;
            //    readAccessParams.Count = 4; // read 4 words
            //    readAccessParams.MemoryBank = MEMORY_BANK.MemoryBankUser;
            //    readAccessParams.Offset = 0; // start reading from word offset 0
            //    readAccessTag = Reader.Actions.TagAccess.ReadWait(tagId, readAccessParams, null);


            //    //Reader.Config.DPOState = DYNAMIC_POWER_OPTIMIZATION.Enable;
            //    int x = 0;
            //}

            //   }
            //}
        }