This section of the developer’s guide provides an outline for creating a custom IDL driver. It includes inline code references to some sample C++ code that implements a simple example IDL driver. This driver example demonstrates the general architecture and flow of an IDL driver and uses the primary IDL library calls. In place of communicating to actual third-party protocol devices, this example outputs information to the SmartServer IoT console to show you the general software flow for an IDL driver instance (IDI), and the data passed between a driver instance and the IDL library itself.
This example includes the following files.
- main.cpp – The software entry point for an IDL driver. main.cpp instantiates a new IDL driver instance (IDI), registers callback routines with the IDL library, defines any threads needed by the custom driver for its own operation, and kicks off the custom driver by initializing the driver instance itself.
- example.cpp – The primary source file for the custom IDL driver example. It contains the callback functions, as well as code associated with any custom driver threads instantiated in main.cpp.
- example.h – The header file for example.cpp.
- example.conf – The configuration file used to run the driver as a service.
- example-idl.conf – The configuration file used to start up the driver instance with the IDL library.
- exampledevice.xif – A sample device interface file to use with this driver.
- exampledevice.dtd – A sample device type definition file to use with this driver.
- makefile – A make file that can be used to simplify compiling the example driver.