Exemplo n.º 1
0
        private static void TestStrFilterReadPlansFunc(Reader rdr, ArgParser pargs)
        {
            Gen2.Select g2s = new Gen2.Select(false, Gen2.Bank.EPC, 16, 16, new byte[] { 0x12, 0x34 });
            Console.WriteLine(g2s);
            Gen2.Select notg2s = new Gen2.Select(true, Gen2.Bank.EPC, 16, 16, new byte[] { 0x12, 0x34 });
            Console.WriteLine(notg2s);
            Iso180006b.Select i6bs = new Iso180006b.Select(false, Iso180006b.SelectOp.EQUALS, 0, 0xC0, new byte[] { 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
            Console.WriteLine(i6bs);
            Iso180006b.Select noti6bs = new Iso180006b.Select(true, Iso180006b.SelectOp.EQUALS, 0, 0xC0, new byte[] { 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
            Console.WriteLine(noti6bs);
            TagData td = new TagData("1234567890ABCDEF");
            Console.WriteLine(td);
            MultiFilter mf = new MultiFilter(new TagFilter[] { g2s, i6bs, td });
            Console.WriteLine(mf);

            SimpleReadPlan srp1 = new SimpleReadPlan(null, TagProtocol.GEN2, g2s, 1000);
            Console.WriteLine(srp1);
            SimpleReadPlan srp2 = new SimpleReadPlan(new int[] { 1, 2 }, TagProtocol.ISO180006B, i6bs, 1000);
            Console.WriteLine(srp2);
            MultiReadPlan mrp = new MultiReadPlan(new ReadPlan[] { srp1, srp2 });
            Console.WriteLine(mrp);
        }
Exemplo n.º 2
0
        private static void TestMatchesFunc(Reader rdr, ArgParser pargs)
        {
            List<Gen2.TagData> list = new List<Gen2.TagData>();
            list.Add(MakeGen2TagData("3000", "0x044D00000000040005010064", "CEDA"));
            list.Add(MakeGen2TagData("3000", "044D00000000040007010070", "7107"));
            list.Add(MakeGen2TagData("3000", "044D0000000004000701006E", "82F8"));
            list.Add(MakeGen2TagData("3000", "044D0000000004000401006B", "4981"));
            list.Add(MakeGen2TagData("3000", "044D0000000004000E01006C", "51CD"));
            list.Add(MakeGen2TagData("3000", "044D0000000004000601006D", "C42F"));
            list.Add(MakeGen2TagData("3000", "3028354D8202000000001A6B", "1119"));
            list.Add(MakeGen2TagData("3000", "050000000000000000003E61", "5911"));
            list.Add(MakeGen2TagData("3000", "C8399E480126DC040101006B", "E90C"));
            list.Add(MakeGen2TagData("3000", "2B3A27B0A182AF350101005C", "3548"));
            list.Add(MakeGen2TagData("3000", "88C10D7556FFCAB801010085", "87E8"));
            list.Add(MakeGen2TagData("3000", "050000000000000000003E62", "6972"));
            list.Add(MakeGen2TagData("3000", "D54F973EB39959DC0101007B", "A9D7"));
            list.Add(MakeGen2TagData("3000", "017DD52B43277B3B0101006A", "5E15"));
            list.Add(MakeGen2TagData("3000", "050000000000000000003E63", "7953"));
            list.Add(MakeGen2TagData("3000", "B4759AAAE63B8777010100DC", "1D17"));
            list.Add(MakeGen2TagData("3000", "48C4A2C790E52858020100A3", "D4FB"));
            list.Add(MakeGen2TagData("3000", "A726B70BA4B0566501010055", "3C5D"));
            list.Add(MakeGen2TagData("3000", "EA37F41943C9897901010098", "D187"));
            list.Add(MakeGen2TagData("3000", "A969352F11405A8001010080", "B69B"));
            list.Add(MakeGen2TagData("3000", "12BF6BAB28F2122801010079", "7201"));
            list.Add(MakeGen2TagData("3000", "F0581C70A5E07DF7010100B3", "1B3C"));
            list.Add(MakeGen2TagData("3000", "FE911EEF7B009548010100C2", "059C"));
            list.Add(MakeGen2TagData("3000", "7CDAAD120A073CE90101007A", "64FB"));
            list.Add(MakeGen2TagData("3000", "F1AA7950D9DCA7D6010100AF", "5DEA"));
            list.Add(MakeGen2TagData("3000", "7062721836BE7E9C010100C8", "CBBE"));
            list.Add(MakeGen2TagData("3000", "7F38863B16B4DE5501010050", "27CB"));
            list.Add(MakeGen2TagData("3000", "2D6FB358C2ED07960201004F", "F803"));
            list.Add(MakeGen2TagData("3000", "CC3797853CA8DB8102010058", "F117"));
            list.Add(MakeGen2TagData("3000", "7AF713E5D9ECD647020100B2", "BD94"));
            list.Add(MakeGen2TagData("3000", "069B3ED79043CBCE0101009A", "B18F"));
            list.Add(MakeGen2TagData("3000", "300833B2DDD9014035050000", "42E7"));
            list.Add(MakeGen2TagData("3000", "6EECABF073C4FD980101007C", "C2AE"));
            list.Add(MakeGen2TagData("3000", "349D9427086A289002010056", "C57B"));
            list.Add(MakeGen2TagData("3000", "D4E8CFB7D2D51C7F010100AB", "1250"));
            list.Add(MakeGen2TagData("3000", "69AE2A765487268601010099", "F8B9"));

            TestFilter("No Filter", null, list);
            Gen2.Select startsWithC = new Gen2.Select(false, Gen2.Bank.EPC, 32, 4, new byte[] { 0xC0 });
            TestFilter("EPCs starting with C", startsWithC, list);
            Gen2.Select endsWith100xx = new Gen2.Select(false, Gen2.Bank.EPC, 32 + 96 - (5 * 4), 12, new byte[] { 0x10, 0x00 });
            TestFilter("EPCs ending in 100xx", endsWith100xx, list);
            Gen2.Select doesntEndWith100xx = new Gen2.Select(true, Gen2.Bank.EPC, 32 + 96 - (5 * 4), 12, new byte[] { 0x10, 0x00 });
            TestFilter("EPCs NOT ending in 100xx", doesntEndWith100xx, list);

            MultiFilter startsWithCAndEndsWith100xx = new MultiFilter(new TagFilter[] {
                startsWithC,
                endsWith100xx,
            });
            TestFilter("EPCs starting with C AND ending in 100xx", startsWithCAndEndsWith100xx, list);

            TagData specificTag = new TagData("A726B70BA4B0566501010055");
            TestFilter("Matches A726B70BA4B0566501010055", specificTag, list);
        }