eventMonitor_example.c

This source file is an example of how to use NTAPI to monitor events. The example program runs in an infinite loop polling the event stream for events. When an event is received, it is printed on the screen. It also shows how to translate read sensor data into a text representation.

#include/nt.h - Applications/Tools only need to include nt.h to obtain prototypes, macros etc. from NTAPI.

NT_Init(NTAPI_VERSION) - Initialize the NTAPI library. NTAPI_VERSION is a define that describes the version of the API described in the header files included by nt.h. NT_Init() instructs the NTAPI library to convert returned data to the NTAPI_VERSION, if possible. This ensures that applications can run on NTAPI libraries of newer versions.

NT_EventOpen() - Open an event stream making it possible to receive events. When an event stream is opened, all events are stored on an event queue until they are read.

NT_EventRead() - Wait for either a timeout or for an event to arrive, then return a single event from the event queue. If no event arrives within the timeout period, a NT_STATUS_TIMEOUT is returned.