Class SensorDataReader
The SensorDataReader class sets up a connection to a SensThys reader and runs the algorithms for reading sensor tags.
The start(SensorDataReader.TemperatureReadingHandler, SensorDataReader.SensorCodeReadingHandler, SensorDataReader.NotificationHandler) method runs the sensor measurement algorithms in a thread and continues reading until the application calls the stop() method. Temperature and Sensor Code values are delivered to the application through the callbacks that are passed into the start method.
Inheritance
Inherited Members
Namespace: RFID.SensorTag
Assembly: SensorTag.dll
Syntax
public class SensorDataReader
Constructors
SensorDataReader(String, TagModel)
Constructor with only required parameters needed to connect to reader and perform reading
Declaration
public SensorDataReader(string IPAddress, TagModel tagTypeArg)
Parameters
Type | Name | Description |
---|---|---|
System.String | IPAddress | IP address of the reader that will be used to read sensor tags. |
TagModel | tagTypeArg | Tag type for reader to target, currently supported tags are Magnus 1, Magnus 2, and Magnus 3 tags |
SensorDataReader(String, TagModel, Double, Double, Int32[], Int32, Byte, Byte, Byte)
Constructor with all parameters that can be used to change how the reader scans for sensor code and/or temperature tags
Declaration
public SensorDataReader(string IPAddress, TagModel tagTypeArg, double minPowerArg, double maxPowerArg, int[] antennaSequenceArg, int antennaDwellTimeArg, byte minTSSIArg, byte maxTSSIArg, byte maxTempTssi = 255)
Parameters
Type | Name | Description |
---|---|---|
System.String | IPAddress | IP address of the reader to be used for reading the sensor tags |
TagModel | tagTypeArg | The model of the type of tags for the reader to read. |
System.Double | minPowerArg | Minimum power in scan range (12.0 to 33.0 dBm). |
System.Double | maxPowerArg | Maximum power in scan range (12.0 to 33.0 dBm). |
System.Int32[] | antennaSequenceArg | Array of antennas to be read sequentially. |
System.Int32 | antennaDwellTimeArg | Time spent reading on each antenna in the read sequence before moving on to reading on the next one in the sequence. |
System.Byte | minTSSIArg | Minimum on-tag received signal strength to allow for sensor code reading to be taken. |
System.Byte | maxTSSIArg | Maximum on-tag received signal strength to allow for sensor code reading to be taken. |
System.Byte | maxTempTssi | Maximum on-tag received signal strength to allow for temperature reading to be taken. The default allows for all values. In cases where the power level is too high, dropping this value to a somewhat lower value should improve the accuracy of the temperature readings. |
Fields
AntennaDwellTime
Declaration
public int AntennaDwellTime
Field Value
Type | Description |
---|---|
System.Int32 | Time spent reading on each antenna in the read sequence before moving on to reading on the next one in the sequence. |
AntennaSequence
Declaration
public int[] AntennaSequence
Field Value
Type | Description |
---|---|
System.Int32[] | Array of antennas to be read sequentially. |
LowTemperatureFilter
Declaration
public double LowTemperatureFilter
Field Value
Type | Description |
---|---|
System.Double | This value can be set to filter out bad Temperature readings. At low temperatures, read errors become more likely. The default for this setting is -40 degC. If you are experiencing misreads at somewhat higher temperatures or would like to try to read at lower temperatures, you can change this setting. |
MaxPower
Declaration
public double MaxPower
Field Value
Type | Description |
---|---|
System.Double | Maximum power in scan range (12.0 to 33.0 dBm). |
MaxScdeTssi
Declaration
public byte MaxScdeTssi
Field Value
Type | Description |
---|---|
System.Byte | Maximum on-tag received signal strength to allow for sensor code reading to be taken. |
MaxTempTssi
Declaration
public byte MaxTempTssi
Field Value
Type | Description |
---|---|
System.Byte | Maximum on-tag received signal strength to allow for temperature reading to be taken. The default allows for all values. In cases where the power level is too high, dropping this value to a somewhat lower value should improve the accuracy of the temperature readings. |
MinPower
Declaration
public double MinPower
Field Value
Type | Description |
---|---|
System.Double | Minimum power in scan range (12.0 to 33.0 dBm). |
MinScdeTssi
Declaration
public byte MinScdeTssi
Field Value
Type | Description |
---|---|
System.Byte | Minimum on-tag received signal strength to allow for sensor code reading to be taken. |
Reader
Declaration
public RFIDEngineeringReader Reader
Field Value
Type | Description |
---|---|
RFID.RFIDEngineeringReader.RFIDEngineeringReader | This field can be used to access the underlying RFIDEngineeringReader object directly. After the SensorDataReader class has been successfully instantiated, this object can be used to send queries and other commands directly to the reader. (Refer to the RFID SDK for more information). Note that you should be careful when sending commands to the reader. Once the start() method of the SensorDataReader instance has been called, the reader will not be able to process any command until the stop() method has been called. |
TagType
Declaration
public TagModel TagType
Field Value
Type | Description |
---|---|
TagModel | This field can be used to query the current model of tag being read or change the type after the SensorDataReader has been instantiated. |
Properties
ReadComplete
Declaration
public bool ReadComplete { get; }
Property Value
Type | Description |
---|---|
System.Boolean | During the tag read process, this field will be false. Once the stop() method is called, the underlying process your application should poll this field until it becomes true. At that point your application can safely make changes to the settings in this class and/or the reader setting of the reader. |
Methods
start(SensorDataReader.TemperatureReadingHandler, SensorDataReader.SensorCodeReadingHandler, SensorDataReader.NotificationHandler)
Starts the sensor tag reading process.
Declaration
public bool start(SensorDataReader.TemperatureReadingHandler temperatureReadingHandler = null, SensorDataReader.SensorCodeReadingHandler sensorCodeReadingHandler = null, SensorDataReader.NotificationHandler notificationHandler = null)
Parameters
Type | Name | Description |
---|---|---|
SensorDataReader.TemperatureReadingHandler | temperatureReadingHandler | Optional callback for temperature readings |
SensorDataReader.SensorCodeReadingHandler | sensorCodeReadingHandler | Optional callback for sensor code readings |
SensorDataReader.NotificationHandler | notificationHandler | Optional callback for notification information |
Returns
Type | Description |
---|---|
System.Boolean | This method returns true if one or both of the SCDE and Temperature callbacks have been specified. Otherwise, this method will return false and the read process will not be started. |
Remarks
Either the temperatureReadingHandler callback or the sensorCodeReadingHandler callback must be specified. If you want to only read temperature values you should pass in a temperatureReadingHandler callback and pass in null for the sensorCodeReadingHandler. Similarly if you only want to see sensor code data. Also, you can specify callbacks for both data streams if you want to read both temperatures and sensor codes.
Generally, you do not need to specify the notificationHandler callback.
stop()
This method should be called to stop the sensor tag read process. The application code should poll the ReadComplete data member of the SensorDataReader class to determine when it is safe to resume communicating with the reader.
Declaration
public void stop()