Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 1.84 KB

README.md

File metadata and controls

34 lines (30 loc) · 1.84 KB

RfidDotNet

Build status Net Standard 2.0 library to work with Rfid readers

Provides abstracted interface for reading tags. You simply get Observable<Tag>.

Supported protocols:

  • Alien Technology reader protocol over TCP with automatic reconnection support.
  • (Work in progress) Chinese binary protocol over serial port. Serial port code depends on SerialPortStream package. You have to build C driver to be able to work on linux, follow instruction on project page.

There are two API levels. High level is UniversalTagStreamFactory, it has only basic feature, but abstracts away driver details. You register drivers via extensions methods and create tag stream instance by supplying driver specific connection string:

var factory = new UniversalTagStreamFactory();
factory.UseSerialProtocol(); // protocol=Serial
factory.UseAlienProtocol();  // protocol=Alien
// Connection string sapmles:
// protocol=Serial;Serial=COM4
// protocol=Serial;Serial=/dev/ttyS0
// protocol=Alien;Network=10.0.1.41;RfPower=200;AntennaConfiguration=Antenna1

using (var stream = factory
  .CreateStream("protocol=Alien;Network=10.0.1.41;RfPower=200;AntennaConfiguration=Antenna1"))
{
    stream.Errors.Subscribe(e => errors +=  e.Message + "\r\n");
    stream.Tags.Subscribe(tag => Console.WriteLine(tag.TagId));
    stream.Start();
    Console.ReadLine();
    // It is possible to change QValue, Session, RFPower and AntennaConfiguration
    // on the fly, without reconnection.
    var previousAntenna = await stream.AntennaConfiguration();
    var newAntenna = await stream.AntennaConfiguration(
      AntennaConfiguration.Antenna2 | AntennaConfiguration.Antenna3);
}