What inventory actually returns, see Inventory's summary.
public NurApiInventoryResponse Inventory(
int rounds,
int Q,
int session
)
/* 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.
}