Ejemplo n.º 1
0
 /// <summary>
 /// DisconnectReader
 /// </summary>
 public override void DisconnectReader()
 {
     //rfid3.ReadingActive = false;
     if (rfid3 != null)
     {
         connected = false;
         rfid3.Dispose();
         rfid3 = null;
         System.Threading.Thread.Sleep(250);
     }
 }
Ejemplo n.º 2
0
    public void Run()
    {
        //Set the COM port to the appropriate one for your reader.
        ThinkifyReader Reader = new ThinkifyReader("COM3");

        //Connect the reader's TagReadEvent to our Event Handler.
        Reader.TagReadEvent += new TagReadEventHandler(ProcessTagReadEvent);

        //Connect the reader's extended read event to our Event Handler.
        Reader.TagXReadEvent += new TagXReadEventHandler(ProcessTagXReadEvent);


        //Say Hello.
        Console.WriteLine("-------------------------------------------");
        Console.WriteLine(" Welcome to The Thinkify TR200 RFID Reader ");
        Console.WriteLine("-------------------------------------------");
        Console.WriteLine("");

        //Put the reader back to factory default state.
        Reader.Reset();

        //We've got a couple of methods for common commands.
        Console.WriteLine("Firmware version is: \n{0}", Reader.Version);
        Console.WriteLine("RF Attenuation is: \n{0}", Reader.Attenuation);
        Console.WriteLine("");

        //You can also use a synchronous call (Reader.Execute) to get data from the reader.
        //You can send any command in the protocol spec.
        Console.WriteLine("Inventory Parameters are: \n{0}", Reader.Execute("i"));
        Console.WriteLine("");

        //Let's program a tag. -- Hold one up and It'll try to put this ID in it...
        Console.WriteLine("Program EPC Result: {0}", Reader.ProgramEPC("3333 4444 5555 5555 2222 2222"));
        Console.WriteLine("");

        //Reading uses asynchronous calls. We turn the reader on and wait for read events to come in
        //that we deal with in our event handler.
        Console.WriteLine("Let's Read for a bit...");
        Console.WriteLine();
        //Setting ReadingActive=True starts continuous polling. Whenever a tag is read, the assigned
        //TagReadEventHandler (In our case, ProcessTagReadEvent) will be called.

        Reader.ReadingActive = true;

        Thread.Sleep(1000);

        //Turn off continuous polling. -- Reader is now ready to accept synchronous commands again.
        Reader.ReadingActive = false;

        Console.WriteLine();
        Console.WriteLine("What did we see?");
        DumpTaglist(Reader);
        Console.WriteLine();

        Console.WriteLine("Try to Read the Tag's user memory...");
        Console.WriteLine(Reader.ReadUserMemory());
        Console.WriteLine();

        Console.WriteLine("Done!");


        Reader.Dispose();

        Console.ReadLine();
    }
Ejemplo n.º 3
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     Reader.Dispose();
 }