NurApiInventory(Int32, Int32, Int32) Method

Perform single inventory using specified rounds, Q and session.

What inventory actually returns, see Inventory's summary.

Definition

Namespace: NurApiDotNet
Assembly: NordicID.NurApi.Net (in NordicID.NurApi.Net.dll) Version: 4.0.0
C#
public NurApiInventoryResponse Inventory(
	int rounds,
	int Q,
	int session
)

Parameters

rounds  Int32
Full query rounds to perform in inventory. Range 0 - 10. Value 0 means automatic round number. (see InventoryRounds property)
Q  Int32
The Q parameter. Range 0 - 15. Value 0 means automatic Q calculation. (see InventoryQ property)
session  Int32
The session parameter. Range 0 - 3.(see InventorySession property)

Return Value

NurApiInventoryResponse
Inventory result data as NurApiInventoryResponse

Example

C#
/* Inventory example */
private void DoInventory(bool useModuleSettings)
{
    /* In the application main class the NurApi ("hNur") object is create like hNur = new NurApi(); */
    // Where the response is stored to.
    InventoryResponse resp;
    NurApi.TagStorage theStorage;

    try
    {
        // We'll clean up first.
        hNur.ClearTagsEx();    // Will clear the API's storage as well as the module's memory.

        // Do single inventory using module stored rounds, Q, session settings
        if (useModuleSettings) {
            resp = hNur.Inventory();
        } else {
            // Do single inventory with 'rounds' number of inventories using 'Q' in session 'session':
            int rounds = 1;
            int Q = 5;
            int session = 0;
            resp = hNur.Inventory(rounds, Q, session);
        }
    }
    catch (NurApiException ex)
    {
        // For example.
        HandleInventoryError(ex.error);
        return;
    }

    // If there were no exceptions, it is safe to assume that the module found some tags, now download from module including the metadata:
    try
    {
        theTags = hNur.FetchTags(true);
    }
    catch (NurApiException ex)
    {
        // Should not happen at this point.
        HandleCriticalError(ex.error);
        return;
    }

    // Proceeed as necessary.
    foreach (NurApi.Tag tag in theStorage)
    {
        NotifyAboutTag(tag);
    }

    // Simple inventory is now done.
}

See Also