# NordicID.NurApi.Utils — API Reference

> Generated: 2026-05-06 07:29 UTC  
> Package version: `5.1.0`  
> Source XML: `NordicID.NurApi.Utils.xml`

Single-file reference for the `NordicID.NurApi.Utils` library. The API Reference section enumerates every public type and member documented in the XML doc file. Headings are predictable and greppable — search for `Type \`X\``, `Method: \`Y\``, etc.

## Guide

## Overview

`NordicID.NurApi.Utils` is a cross-platform helper library that sits on top of
the core `NordicID.NurApi.Net` package. It provides higher-level building
blocks for common UHF RFID tasks that would otherwise require significant
boilerplate code.

Install it from NuGet:

```
dotnet add package NordicID.NurApi.Utils
```

### Key features

| Feature | Main class | Description |
|---|---|---|
| **Tag locating** | `LocateTag` | Continuously trace a single tag by EPC and report proximity (0–100 %). Automatically selects the best antenna on readers with CrossDipole / Circular / Proximity antennas. |
| **Tag locating with LED blink** | `LocateTagBlink` | Same as `LocateTag`, but also blinks the tag's LED when it is a LedTag. |
| **Seek nearest tag** | `SeekNearestTag` | Find the tag with the strongest RSSI in the reader field. Supports blacklists, ignore lists, EPC prefix filters, and tag-type filtering. |
| **Seek nearest tag (stream)** | `SeekNearestTagStream` | Streaming variant of `SeekNearestTag` — collects RSSI samples over a configurable window and publishes the best average. |
| **TID parsing** | `TagInformation`, `TIDUtils` | Decode the TID memory bank into manufacturer, chip model, XTID serial number, MCS, and more. Uses embedded GS1 + Nordic ID tag databases. |

### Prerequisites

All classes in this library operate on an already-connected `NurApi` instance.
Make sure you have established a connection before calling any Utils API. See
the [NurApi.Net Connecting](../NordicID.NurApi.Net/03-connecting.md) article.

### Namespace

Everything lives under a single namespace:

```csharp
using NordicID.NurApi.Utils;
```

### Initializing the TID database

If you plan to use `TIDUtils` or `TagInformation`, call `TIDUtils.Init()` once
at application startup. This loads the embedded GS1 and Nordic ID tag-model
databases:

```csharp
TIDUtils.Init(customJsonFilePath: null);
```

Optionally pass the path to your own JSON file to extend the built-in database
with custom tag models.

### What to read next

| Article | Topic |
|---|---|
| [Locating a Tag](02-locating-tag.md) | Trace a specific tag and show proximity feedback. |
| [TID Parsing](03-tid-parsing.md) | Identify the chip vendor, model, and serial from TID. |
| [Seeking the Nearest Tag](04-seeking-nearest-tag.md) | Pick the closest tag from a population. |

## Locating a Tag

`LocateTag` lets you continuously track a single tag and receive a proximity
percentage (0–100 %) via events. This is the basis for "find-the-tag" screens
in warehouse and retail apps.

On readers equipped with CrossDipole, Circular, or Proximity antennas (such as
Nordic ID handheld devices), `LocateTag` automatically selects and adjusts the
best antenna for locating. On readers without those special antennas, the
current antenna configuration is used as-is.

### Basic usage

```csharp
using NurApiDotNet;
using NordicID.NurApi.Utils;

var api = new NurApi();
api.Connect(new Uri("tcp://192.168.1.100:4333"));

var locator = new LocateTag(api);

locator.LocateTagEvent += (sender, e) =>
{
    Console.WriteLine($"Proximity: {e.scaledRssi}%  RSSI: {e.rssi} dBm");
};

// Start locating by EPC (hex string)
locator.Start("E200001122334455");

// Let it run...
Console.ReadLine();

locator.Stop();
api.Disconnect();
```

### Starting by EPC byte array

If you already have the EPC as a byte array (for example from an earlier
inventory), pass it directly:

```csharp
byte[] epc = tag.GetEpcBytes();
locator.Start(epc);
```

### Checking state

```csharp
if (locator.IsLocating)
    Console.WriteLine($"Tracking EPC: {NurApi.BinToHexString(locator.LocateEpc)}");
```

### Event arguments

The `LocateTagEventArgs` delivered to `LocateTagEvent` contains:

| Field | Type | Description |
|---|---|---|
| `scaledRssi` | `int` | Averaged proximity percentage (0 = not seen, 100 = very close). |
| `rssi` | `int` | Averaged RSSI in dBm (−127 = not seen). |
| `timestamp` | `int` | Milliseconds since NurApi was initialized. |
| `data` | `NurApi.TraceTagEventArgs` | Raw trace data from the last NurApi trace event. |

### LocateTagBlink — with LED feedback

`LocateTagBlink` works like `LocateTag` but additionally blinks the tag's LED
when the tag is a LedTag. It does **not** adjust antennas — it uses full TX
level on all enabled antennas instead.

```csharp
var blinker = new LocateTagBlink(api);

blinker.LocateTagBlinkEvent += (sender, e) =>
{
    Console.Write($"  Proximity: {e.scaledRssi}%");
    if (e.isBlinked) Console.Write("  [LED blinked]");
    if (e.doBeep)    Console.Write("  *beep*");
    Console.WriteLine();
};

blinker.Start("E200001122334455");

Console.ReadLine();
await blinker.Stop();
```

Note that `LocateTagBlink.Stop()` is `async Task` (unlike `LocateTag.Stop()`,
which is synchronous) — always `await` it.

The `LocateTagBlinkEventArgs` adds two booleans on top of the proximity value:

| Field | Type | Description |
|---|---|---|
| `scaledRssi` | `int` | Proximity (note: this is 1.7 × the raw tag scaledRssi). |
| `isBlinked` | `bool` | `true` if the tag is a LedTag and was successfully blinked. |
| `doBeep` | `bool` | `true` when the UI should play a short beep. |

### Error handling

If the EPC does not match any tag in the field, the events continue to fire
with `scaledRssi = 0`. No exception is thrown — the locate simply reports
"not seen" until the tag enters the field.

```csharp
locator.LocateTagEvent += (sender, e) =>
{
    if (e.scaledRssi == 0)
        Console.WriteLine("Tag not in range");
};
```

Use `LocateTagBlink.LastError` to inspect the last exception if something
went wrong internally:

```csharp
if (blinker.LastError != null)
    Console.WriteLine($"Error: {blinker.LastError.Message}");
```

## TID Parsing

Every Gen2 UHF RFID tag carries a **TID** (Tag Identification) memory bank
that encodes the chip manufacturer, model number, and optionally an extended
serial number (XTID). `NordicID.NurApi.Utils` can decode this data into
human-readable information through the `TIDUtils` and `TagInformation` classes.

### Initializing the tag database

Before parsing any TID data, call `TIDUtils.Init()` once at startup. This
loads the embedded GS1 and Nordic ID tag-model JSON databases:

```csharp
using NordicID.NurApi.Utils;

// At application startup:
TIDUtils.Init(customJsonFilePath: null);
```

To extend the built-in database with your own chip definitions, pass the path
to an external JSON file:

```csharp
TIDUtils.Init(@"C:\config\custom_tags.json");
```

You can also load custom data at a later point:

```csharp
TIDUtils.LoadCustomTagModelData(@"C:\config\extra_tags.json");
```

### Reading and parsing TID from a connected reader

The easiest approach is `TIDUtils.GetTagInfo`, which reads the TID memory from
the tag over the air and decodes it in one step:

```csharp
using NurApiDotNet;
using NordicID.NurApi.Utils;

var api = new NurApi();
api.Connect(new Uri("tcp://192.168.1.100:4333"));

TIDUtils.Init(null);

// By EPC string
TagInformation info = TIDUtils.GetTagInfo(api, "E200001122334455");

Console.WriteLine($"Company:   {info.Company}");
Console.WriteLine($"Tag model: {info.TagModel}");
Console.WriteLine($"MCS:       {info.MCS}");

if (info.XTID_SerialPresent)
    Console.WriteLine($"Serial:    {NurApi.BinToHexString(info.XTID_Serial)}");
```

#### Overloads

| Method | Input |
|---|---|
| `GetTagInfo(NurApi, string)` | Target EPC as hex string |
| `GetTagInfo(NurApi, byte[])` | Target EPC as byte array |
| `GetTagInfo(NurApi, NurApi.Tag)` | A `Tag` object from inventory results |
| `GetTagInfo(NurApi, byte[], byte[])` | EPC + pre-read TID header (avoids an extra read if you already have the header from InventoryRead) |

#### Header-only read

If you only need the manufacturer and model and want to minimize air time,
`GetTagHeader` reads just the first 4 bytes of TID:

```csharp
TagInformation header = TIDUtils.GetTagHeader(api, tag);
Console.WriteLine($"{header.Company} — {header.TagModel}");
```

### Parsing TID data offline

If you have the raw TID bytes already (for example from InventoryRead or a
database), parse them without a reader connection:

```csharp
byte[] tidBytes = NurApi.HexStringToBin("E2801100200072DF...");

var info = new TagInformation(tidBytes);
Console.WriteLine($"Company:   {info.Company}");
Console.WriteLine($"Tag model: {info.TagModel}");
```

Or use the two-step approach:

```csharp
var info = new TagInformation();
info.ParseTID(tidBytes);
```

For header-only bytes use the static helper:

```csharp
TagInformation info = TIDUtils.GetTagInformationFromHeader(headerBytes);
```

### Decoded fields

`TagInformation` exposes the following after a successful parse:

| Property / Field | Type | Description |
|---|---|---|
| `Header_valid` | `bool` | `true` if the TID header was decoded successfully. |
| `Company` | `string` | Chip manufacturer name (e.g. "Impinj", "NXP"). |
| `TagModel` | `string` | Chip model name (e.g. "Monza R6", "UCODE 8"). |
| `MDID` | `int` | Mask Designer Identifier (manufacturer ID). |
| `TMN` | `int` | Tag Model Number. |
| `MCS` | `string` | Maximum Code Size information. |
| `XTID_valid` | `bool` | `true` if extended TID data is present. |
| `XTID_SerialPresent` | `bool` | `true` if the XTID contains a serial number. |
| `XTID_Serial` | `byte[]` | XTID serial bytes (throws if not present). |
| `XTID_SerialBitLength` | `int` | Bit length of the XTID serial. |
| `ProductUrl` | `string` | Product information URL (when available). |
| `FullTIDMemory` | `byte[]` | Complete raw TID bytes that were parsed. |

#### NXP-specific serial numbers

NXP G2i and G2X chips store serial numbers in a vendor-specific format.
Dedicated properties extract them:

```csharp
if (info.Has_G2i_Serial)
    Console.WriteLine($"G2i serial: {info.NXP_G2i_Serial}");

if (info.Has_G2X_Serial)
    Console.WriteLine($"G2X serial: {info.NXP_G2X_Serial}");
```

These properties throw `EPCTagEngineException` if the chip is not a matching
NXP variant or lacks a valid XTID field.

### Checking whether to read more TID

After an InventoryRead that returned only the first 4 bytes (2 words) of TID,
call `TIDValidForMoreData()` to determine whether a full read is worthwhile:

```csharp
var info = new TagInformation(shortTid);
if (info.TIDValidForMoreData())
{
    // Read the remaining TID from the tag
    TagInformation full = TIDUtils.GetTagInfo(api, epc);
}
```

## Seeking the Nearest Tag

`SeekNearestTag` and `SeekNearestTagStream` find the tag with the strongest
signal in the reader field. This is useful for one-at-a-time association
workflows — for example, picking up a product and associating it with an order
by reading whichever tag is closest.

### SeekNearestTag — polling variant

`SeekNearestTag` performs single inventories and reports status changes through
the `OnStatusChanged` event.

```csharp
using NurApiDotNet;
using NordicID.NurApi.Utils;

var api = new NurApi();
api.Connect(new Uri("tcp://192.168.1.100:4333"));

var seeker = new SeekNearestTag(api);

seeker.OnStatusChanged += (sender, e) =>
{
    switch (e.seekStatus)
    {
        case SeekNearestTag.SeekStatus.TagChanged:
            Console.WriteLine($"Nearest tag: {e.tagSeen.GetEpcString()}");
            break;
        case SeekNearestTag.SeekStatus.NoTags:
            Console.WriteLine("No tags in range");
            break;
        case SeekNearestTag.SeekStatus.TooManyTags:
            Console.WriteLine("Too many tags — bring the reader closer to one tag");
            break;
    }
};

seeker.Start();

Console.ReadLine();
seeker.Stop();
```

#### Status values

The `SeekStatus` enum covers every state the seeker can be in:

| Value | Meaning |
|---|---|
| `Started` | Seeking has started. |
| `TagChanged` | A new nearest tag was detected — check `e.tagSeen`. |
| `NoTags` | No tags are visible. |
| `TooManyTags` | Multiple tags compete; cannot pick a clear winner. |
| `TagInBlackList` | The nearest tag was previously blacklisted. |
| `TargetNotSupported` | Tag type does not match `AllowTagTypes` filter. |
| `Error` | An error occurred — call `GetLastError` for details. |
| `Stopped` | Seeking was stopped. |

#### Tuning parameters

```csharp
// Only accept tags with at least 30 % signal strength:
seeker.MinRssi = 30;

// Require the tag to be seen 3 consecutive rounds before accepting:
seeker.MustSeenCountBeforeAcceptBest = 3;

// Wait 8 rounds with no valid tag before reporting NoTags:
seeker.NoValidTagSeenCount = 8;

// Require exactly one tag in the field:
seeker.SingleTagOnly = true;
```

#### Filtering by EPC prefix

Only accept tags whose EPC starts with a specific hex string:

```csharp
seeker.AllowEpcStartWith = "E200";
```

#### Filtering by tag type

Restrict to specific chip models (comma-separated list of model names from
the TID database):

```csharp
seeker.AllowTagTypes = "Monza R6,UCODE 8";
```

#### Blacklists and ignore lists

After successfully associating a tag, add it to the blacklist so it won't be
picked again:

```csharp
seeker.AddTagToBlackList(epc);
```

If a `TagInBlackList` status fires, `e.msg` contains the EPC.

To permanently hide a tag from results (without a blacklist notification):

```csharp
seeker.AddTagToIgnoreList(epc);
```

Clear the blacklist by passing an empty string:

```csharp
seeker.AddTagToBlackList("");
```

Check membership:

```csharp
bool inBlack  = seeker.IsTagInBlackList(epc);
bool inIgnore = seeker.IsTagInIgnoreList(epc);
```

### SeekNearestTagStream — streaming variant

`SeekNearestTagStream` uses inventory streaming instead of single-shot reads.
It collects RSSI samples over a configurable time window and publishes the tag
with the best average. This gives smoother, more responsive results at the cost
of slightly higher CPU usage.

```csharp
var streamer = new SeekNearestTagStream();

streamer.OnStatusChanged += (sender, e) =>
{
    if (e.seekStatus == SeekNearestTag.SeekStatus.TagChanged)
        Console.WriteLine($"Best tag: {e.tagSeen.GetEpcString()}");
};

streamer.CollectTimeMs = 500; // sample window in milliseconds (default 700)
streamer.Start();

Console.ReadLine();
streamer.Stop();
```

#### Additional properties

| Property | Default | Description |
|---|---|---|
| `CollectTimeMs` | 700 | RSSI collection window in milliseconds. |
| `BestEpc` | — | The EPC currently considered nearest. |
| `ReadTagInfo` | `false` | When `true`, reads IrData so `TagInformation` is available. |
| `RssiMin` | — | Minimum RSSI filter; readings below this are discarded. |
| `ShowIfTagInBlacklist` | — | When `true`, still finds the best tag and reports if it is blacklisted. |
| `ShowTooManyTags` | — | When `true`, fires `TooManyTags` when a single clear winner cannot be picked. |

#### EPC filters

Set prefix filters with a comma-separated list of hex prefixes:

```csharp
streamer.SetEPCFilters("E200,3008");

// Check a specific EPC against the current filters:
bool valid = streamer.EpcFilterCheck("E200001122334455");
```

Blacklist and ignore list methods (`AddTagToBlackList`, `AddTagToIgnoreList`,
etc.) work identically to `SeekNearestTag`.

### Which variant to choose?

| Use `SeekNearestTag` when… | Use `SeekNearestTagStream` when… |
|---|---|
| You want simple, low-frequency polling. | You need fast, responsive nearest-tag detection. |
| Reader CPU resources are limited. | Smooth RSSI averaging is more important than CPU. |
| `SingleTagOnly` enforcement is needed. | You want configurable collection windows. |

## API Reference

### Namespace `NordicID.NurApi.Utils`

#### Type `LocateTag`

Full name: `NordicID.NurApi.Utils.LocateTag`

LocateTag provides simple interface for locating single tag in reader field.  

Used antenna is adjusted automatically when used in reader (handheld) with CrossDipole, Circular and/orf Proximity antennas.  

If reader does not have special antennas for locating tag, current antenna settings are used.  

Averaged locate info (0 - 100%) will be received via `LocateTag.LocateTagEvent` event.

##### Constructors

###### Constructor: `LocateTag(NurApi)`

Constructor. `LocateTag.Start`, `LocateTag.Start`

**Parameters**

| Name | Description |
|---|---|
| `nurApi` | NurApi instance. `NurApi` |

##### Methods

###### Method: `Start(byte[])`

Start locating tag by EPC.  

Locate events received in `LocateTag.LocateTagEvent`
`LocateTag.Start`, `LocateTag.Stop`

**Parameters**

| Name | Description |
|---|---|
| `epc` | EPC of tag to locate as byte array. |

###### Method: `Start(string)`

Start locating tag by EPC.  

Locate events received in `LocateTag.LocateTagEvent`
`LocateTag.Start`, `LocateTag.Stop`

**Parameters**

| Name | Description |
|---|---|
| `epc` | EPC of tag to locate as (HEX) string. |

###### Method: `Stop()`

Stop Locating tag. `LocateTag.Start`

##### Properties

###### Property: `IsLocating`

Returns true if tag locating is currently running.

###### Property: `LocateEpc`

Get currently locating EPC byte array.
null if locate not running

##### Events

###### Event: `LocateTagEvent`

Locate tag event. Continuosly generated event of currently locating tag.
`LocateTagEventArgs`

###### Event: `OnLocateTag`

Locate tag event. Use `LocateTag.LocateTagEvent` instead

#### Type `LocateTagBlink`

Full name: `NordicID.NurApi.Utils.LocateTagBlink`

Locate tag and blink it if LedTag

##### Constructors

###### Constructor: `LocateTagBlink(NurApi)`

LocateTagBlink provides simple interface for locating single tag in reader field.  

No antenna adjustements. Full TxLevel used for all enabled antennas.  

If located tag is LedTag, blinking performed when seen.

**Parameters**

| Name | Description |
|---|---|
| `nurApi` | NurApi handle |

##### Methods

###### Method: `Start(byte[])`

Start locate

**Parameters**

| Name | Description |
|---|---|
| `epc` |  |

###### Method: `Start(string)`

Start Locate

**Parameters**

| Name | Description |
|---|---|
| `epc` |  |

###### Method: `Stop()`

Stop Locating tag. `LocateTagBlink.Start`

##### Properties

###### Property: `IsLocating`

return true if still locating pending

###### Property: `LastError`

Last error

###### Property: `LocateEpc`

Get currently locating EPC byte array.
null if locate not running

##### Events

###### Event: `LocateTagBlinkEvent`

Event fired for the locating results

#### Type `LocateTagBlinkEventArgs`

Full name: `NordicID.NurApi.Utils.LocateTagBlinkEventArgs`

##### Constructors

###### Constructor: `LocateTagBlinkEventArgs(int, bool, bool)`

Locate tag event arguments

##### Properties

###### Property: `doBeep`

It's time to give beep while locating. Keep sound Wav short and no delay at start nor end

###### Property: `isBlinked`

True if tag is LedTag and blinked

###### Property: `scaledRssi`

Locate result. Note: Not traditional tag scaledRssi. This value is 1.7*tag.scaledRssi

#### Type `LocateTagEventArgs`

Full name: `NordicID.NurApi.Utils.LocateTagEventArgs`

Locate tag event arguments

##### Constructors

###### Constructor: `LocateTagEventArgs(NurApi.TraceTagEventArgs, int, int)`

Locate tag event arguments

##### Properties

###### Property: `pros`

See `LocateTagEventArgs.scaledRssi`

##### Fields

| Name | Description |
|---|---|
| `timestamp` | Milliseconds after NurApi initialized |
| `scaledRssi` | Averaged scaledRssi value in percentage how near tag is. 0% not seen. |
| `rssi` | Averaged rssi value in dBm how near tag is. -127 not seen. |
| `data` | Raw TraceTagData from last NurApi trace event |

#### Type `NearestTagChangeEventArgs`

Full name: `NordicID.NurApi.Utils.NearestTagChangeEventArgs`

Event arguments

##### Constructors

###### Constructor: `NearestTagChangeEventArgs(NordicID.NurApi.Utils.SeekNearestTag.SeekStatus, NurApi.Tag, string)`

Status changed

**Parameters**

| Name | Description |
|---|---|
| `seekStatus` | New status. `SeekStatus` |
| `tagSeen` | Nearest tag detected when status = SeekNearestTag.SeekStatus.TagChanged. Otherwise null/> |
| `msg` | If status=TagInBlacklist, msg contains epc of tag. |

##### Fields

| Name | Description |
|---|---|
| `tagSeen` | Tag object when tag changed. Otherwise null. |
| `seekStatus` | SeekStatus |
| `msg` | Generic message based on status |

#### Type `SeekNearestTag`

Full name: `NordicID.NurApi.Utils.SeekNearestTag`

SeekNearestTag allow search nearest tag based on rssi. Not very accurate. No reader adjustements.
Using SingleTagOnly seeks only single tag in reading area.
Throw SeekStatus events while seeking process running.  

NOTE: This class is subject to change in future!

##### Constructors

###### Constructor: `SeekNearestTag(NurApi)`

Constructor  

NOTE: This class is subject to change in future!

**Parameters**

| Name | Description |
|---|---|
| `reader` | NurApi handle |

##### Methods

###### Method: `AddTagToBlackList(string)`

Add epc of tag to blacklist. Next time when trying to seek nearest tag, this tag is ignored. 
Used for prevent reassosiation for same tag.

**Parameters**

| Name | Description |
|---|---|
| `epc` | EPC of tag ignored from future reading results. Empty string clear current blacklist |

###### Method: `AddTagToIgnoreList(string)`

Add epc to ignorelist. This tag just ignored when seen in future

**Parameters**

| Name | Description |
|---|---|
| `epc` |  |

###### Method: `IsTagInBlackList(string)`

Can be used for check if epc or sku or whatever string is in blacklist

**Parameters**

| Name | Description |
|---|---|
| `epc` | item string to check |

**Returns:** true if item found from black list

###### Method: `IsTagInIgnoreList(string)`

If epc found from ignorelist, return true

**Parameters**

| Name | Description |
|---|---|
| `epc` | epc |

**Returns:** true if found

###### Method: `Start()`

Start seeking nearest tag

###### Method: `Stop()`

Stop seeking.

##### Properties

###### Property: `AllowEpcStartWith`

If seeking EPC start with specific string, it allowed to be seek as nearst. Others will be rejected.
If empty, all tags allowed to seek (default)

###### Property: `AllowTagTypes`

Specific tag types are allowed to select. Comma separate field of Tag model name like: "Monza 3,Monza 4QT"

###### Property: `GetLastError`

Get description about last error

###### Property: `GetSeekStatus`

Get current seek status

###### Property: `IsRunning`

Return true if seeking running

###### Property: `MinRssi`

Minimum scaled rssi value (0-100) allowing tag to compete for the title of nearest tag

###### Property: `MustSeenCountBeforeAcceptBest`

Nearest tag will be detected when it has been seen this amount of times in row. Default 2.

###### Property: `NoValidTagSeenCount`

Count of rounds need to go until detecting that there is no more valid tags seen. Default 5.

###### Property: `SingleTagOnly`

Force to allow only single tag in reading area. Otherwise TooManyTags status event fired.

##### Events

###### Event: `OnStatusChanged`

Nearest tag event. `NearestTagChangeEventArgs`

##### Fields

| Name | Description |
|---|---|
| `TooManyEpcList` | List of epc found when "toomany" tags seen |

##### Nested types

##### Type `SeekStatus`

Full name: `NordicID.NurApi.Utils.SeekNearestTag.SeekStatus`

SeekStatus enums

###### Fields

| Name | Description |
|---|---|
| `NoTags` | No tags seen! |
| `TagChanged` | Nearset tag changed. |
| `TooManyTags` | Too many tags in reading area |
| `TagInBlackList` | Tag found is in black list |
| `Stopped` | Seek nearest task stopped |
| `Started` | Seek nearest tag started. |
| `Error` | Error ocurred. use GetLastError() |
| `TargetNotSupported` | Tag type is not supported |

#### Type `SeekNearestTagStream`

Full name: `NordicID.NurApi.Utils.SeekNearestTagStream`

SeekNearestTagStream allow search nearest tag based on rssi.
Inventory streaming and collecting rssi values 700 ms and publish best avarage EPC consider as nearest    
Throw SeekStatus events while seeking process running.

##### Methods

###### Method: `AddTagToBlackList(string)`

Add epc of tag to blacklist. Next time when trying to seek nearest tag, this tag is ignored. 
Used for prevent reassosiation for same tag.

**Parameters**

| Name | Description |
|---|---|
| `epc` | EPC of tag ignored from future reading results. Empty string clear current blacklist |

###### Method: `AddTagToIgnoreList(string)`

Add epc to ignorelist. This tag just ignored when seen in future

**Parameters**

| Name | Description |
|---|---|
| `epc` |  |

###### Method: `EpcFilterCheck(string)`

EPC filter. return true if valid EPC

**Parameters**

| Name | Description |
|---|---|
| `tag` | EPC of tag |

**Returns:** true if valid tag

###### Method: `IsTagInBlackList(string)`

Can be used for check if epc or sku or whatever string is in blacklist

**Parameters**

| Name | Description |
|---|---|
| `epc` | item string to check |

**Returns:** true if item found from black list

###### Method: `IsTagInIgnoreList(string)`

If epc found from ignorelist, return true

**Parameters**

| Name | Description |
|---|---|
| `epc` | epc |

**Returns:** true if found

###### Method: `SetEPCFilters(string)`

Set EPC filters. Comma separated list of EPC starting with specified hex string

**Parameters**

| Name | Description |
|---|---|
| `filter` | comma separated list of hex string |

###### Method: `Start()`

Start seeking nearest tag

###### Method: `Stop()`

Stop seeking.

##### Properties

###### Property: `BestEpc`

Current nearest EPC

###### Property: `CollectTimeMs`

How long collecting rssi values before calc average and publishing nearest tag. default 700 ms

###### Property: `GetLastError`

Get description about last error

###### Property: `GetSeekStatus`

Get current seek status

###### Property: `IsRunning`

Return true if seeking running

###### Property: `ReadTagInfo`

Set true if nearest tag should contain IrData allowing to read TagInfo

###### Property: `RssiMin`

Min Rssi filter value. Ignore read values lower than this

###### Property: `ShowIfTagInBlacklist`

If true, seek best (rssi) tag from area and show if alredy in blacklist.

###### Property: `ShowTooManyTags`

If true, report "too many tags" seen if need to pick single clearly alone tag.

##### Events

###### Event: `OnStatusChanged`

Nearest tag event. `NearestTagChangeEventArgs`

#### Type `TagInformation`

Full name: `NordicID.NurApi.Utils.TagInformation`

TagInformation decoded from TID data

##### Constructors

###### Constructor: `TagInformation()`

Constructor

###### Constructor: `TagInformation(byte[])`

Constructor

**Parameters**

| Name | Description |
|---|---|
| `tidData` | byte array of TID data to parse |

##### Methods

###### Method: `Clear()`

Clear Tag information

###### Method: `ParseTID(byte[])`

Parse TagInformation from byte array

**Parameters**

| Name | Description |
|---|---|
| `tidData` | array of TID data |

###### Method: `TIDValidForMoreData()`

To check whether we should read more bytes from the TID(assuming that InventoryRead is done with just 32bits)

**Returns:** True when more data should be read, false when no

##### Properties

###### Property: `Company`

Get company name

###### Property: `Has_G2i_Serial`

Check if valid G2i_serial available

###### Property: `Has_G2X_Serial`

Check if valid G2X_serial available

###### Property: `MCS`

Get MCS

###### Property: `NXP_G2i_Serial`

get NXP_G2i_Serial

**Exceptions**

- `EPCTagEngineException`: if the NXP G2i chips do not have a valid XTID field or Not a NXP G2i chip

###### Property: `NXP_G2X_Serial`

NXP G2X chipset specific serial number

**Exceptions**

- `EPCTagEngineException`: if the NXP G2X chips do not have a valid XTID field. or Not a NXP G2X chip

###### Property: `ProductUrl`

Get product URL

###### Property: `TagModel`

Get tag model

###### Property: `XTID_BlkWriteEraseSegPresent`

Check if XTID_BlkWrite Erase Seg Present

###### Property: `XTID_OptCmdSupportSegPresent`

Check if XTID OptCmd Support Seg Present

###### Property: `XTID_Serial`

Get byte array of XTID_Serial

**Exceptions**

- `EPCTagEngineException`: if the XTID is not valid or not present.

###### Property: `XTID_SerialBitLength`

Get XTID serial bit length

###### Property: `XTID_SerialPresent`

Check if XTID Serial Present

###### Property: `XTID_UserMemBlkAndPermaLockPresent`

Check if XTID UserMem BlkAndPermaLock present

##### Fields

| Name | Description |
|---|---|
| `FullTIDMemory` | Full TID memory content |
| `Header_valid` | true if TID header decoded successfully |
| `Header` | TID header |
| `MDID_valid` | True if MDID decoded successfully |
| `MDID` | Mask Designer Identifier (MDID) |
| `TMN_valid` | True if Tag Model Number (TMN) decoded successfully |
| `TMN` | Tag Model Number (TMN) |
| `XTID_valid` | True if extended ID (XTID) available |
| `XTID` | XTID |
| `MCS_valid` | True if MCS decoded successfully |

#### Type `TIDUtils`

Full name: `NordicID.NurApi.Utils.TIDUtils`

Tag information (TID) utilities.

##### Methods

###### Method: `GetMCS(int, int, TagCodec.EPCBitArray)`

Gets the MCS value for a tag using the provided MDID, TMN, and TID data.

**Parameters**

| Name | Description |
|---|---|
| `mdid` | Manufacturer ID parsed from TID. |
| `tmn` | Tag Model Number parsed from TID. |
| `tid` | Raw TID content. |

**Returns:** MCS

###### Method: `GetTagHeader(NurApi, NurApi.Tag)`

Read TID memory header from Tag and decode

**Parameters**

| Name | Description |
|---|---|
| `nurHandle` | NurApi handle |
| `targetTag` | Target tag to read TID |

**Returns:** Tag information

**Exceptions**

- `Exception`: Error reading tag info

###### Method: `GetTagInfo(NurApi, byte[])`

Read TID memory content from Tag and decode

**Parameters**

| Name | Description |
|---|---|
| `nurHandle` | NurApi handle |
| `targetEpc` | Target EPC to read TID |

**Returns:** Tag information

**Exceptions**

- `Exception`: Error reading tag info

###### Method: `GetTagInfo(NurApi, string)`

Read TID memory content from Tag and decode

**Parameters**

| Name | Description |
|---|---|
| `nurHandle` | NurApi handle |
| `targetEpc` | Target EPC to read TID |

**Returns:** Tag information

**Exceptions**

- `Exception`: Error reading tag info

###### Method: `GetTagInfo(NurApi, NurApi.Tag)`

Read TID memory content from Tag and decode

**Parameters**

| Name | Description |
|---|---|
| `nurHandle` | NurApi handle |
| `targetTag` | Target EPC to read TID |

**Returns:** Tag information

**Exceptions**

- `Exception`: Error reading tag info

###### Method: `GetTagInfo(NurApi, byte[], byte[])`

Read TID memory content from Tag and decode

**Parameters**

| Name | Description |
|---|---|
| `nur` | NurApi handle |
| `targetEPC` | Byte array of target EPC |
| `tidHeader` | Byte array of TID header |

**Returns:** TagInformation if read success. Otherwise null

###### Method: `GetTagInformationFromHeader(byte[])`

Parse TagInformation from TID header

**Parameters**

| Name | Description |
|---|---|
| `hdr` | byte array of TID header |

**Returns:** TagInformation

###### Method: `Init(string)`

Initializes the tag model data using the embedded GS1 JSON, Nordic ID JSON and optionally an external custom JSON file.

**Parameters**

| Name | Description |
|---|---|
| `customJsonFilePath` | Optional path to an external JSON file for custom tag model data. |

###### Method: `InitTagModelData()`

Initializes the embedded JSON resources (GS1 and Nordic ID).

###### Method: `LoadCustomTagModelData(string)`

Loads a external custom tag model from either a file path or a raw JSON string.

###### Method: `LoadEmbeddedJson(string)`

Loads an embedded JSON resource by name.
