Skip to content

Net Standard 2.0 library to work with Rfid readers

Notifications You must be signed in to change notification settings

merc74/RfidDotNet

 
 

Repository files navigation

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);
}

About

Net Standard 2.0 library to work with Rfid readers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.5%
  • PowerShell 1.2%
  • Other 0.3%