NurApiTagTraceTag Method

Trace this tag by its EPC contents.

Definition

Namespace: NurApiDotNet
Assembly: NordicID.NurApi.Net (in NordicID.NurApi.Net.dll) Version: 4.0.0
C#
public NurApiTraceTagData TraceTag(
	int flags
)

Parameters

flags  Int32
0 for normal operation i.e. the trace is run once and the reponse NurApiTraceTagData is returned immediately.

Continuous operation flags: TRACETAG_START_CONTINUOUS, TRACETAG_STOP_CONTINUOUS

Return Value

NurApiTraceTagData
Data from traced tag as NurApiTraceTagData. Only valid for normal operation.

Example

Adding a trace event handler:

C#
hNur.TraceTagEvent += new EventHandler<NurApi.TraceTagEventArgs>(hNur_TraceTagEvent);
Example of a simple trace event handler:

C#
// Handle incoming tag trace event.
void hNur_TraceTagEvent(object sender, NurApi.TraceTagEventArgs e)
{
    // Example: void HandlePercentageGaugeDisplay(int antenna, int percentage) { }
    // e.scaledRSSI = 0...100%.
    HandlePercentageGaugeDisplay(e.antennaID, e.scaledRssi);
    // Other members:
    // e.rssi (dBm)
    // e.epc = EPC contents (if NurApi.TRACETAG_NO_EPC was not used when started)
    // e.epcLen = actual number of bytes in the EPC.
}

Trace tag at index. This is merely an example and as such does not really reflect real world situation; usually the tag to be traced is retrieved from some background system.

For generic trace in the API, see TraceTagByEPC(Byte, Int32) or TraceTag(Byte, UInt32, Int32, Byte, Int32).

C#
try
{
    aTag.TraceTag(NurApi.TRACETAG_START_CONTINUOUS);
}
catch (NurApiException e)
{
    HandleTraceStartError(e.error);
}

// If OK, the trace events will now start to occur in the receiving control.

See Also