ExampleThe example.cpp file is the primary source file for this IDL the custom driver example. It contains a simple, startup function called from main.cpp that provides the driver an opportunity to set up an interface device or port if required, as well as initialize anything necessary before the driver starts up. It also contains the sample thread code related to any background processing that a typical IDL custom driver might need to do. Finally, it contains the code for the callback functions originally registered with the IDL library and any protocoldriver-specific code associated with these callback events.
As seen in the following comments, example.cpp includes a stub function called IdiStart() that can be used to open a port or interface device and perhaps initialize any protocol-specific structures required to run the custom driver.
...
The remainder of example.cpp essentially contains the callback functions previously registered with the IDL library in main.cpp. These callback functions provide entry points for the custom driver to insert code to execute based on various events such as creating a new device using the protocol, provisioning a device, requests to read and write data points and so on. A complete list of available callback functions can be found in the IAP Driver Library (IDL). This example driver contains simple implementations of many of the common callback functions. These example callback functions output basic information to the console when called to assist in understanding the interaction between the IDL library and a custom driver and the basic parameters passed with these functions.
...