IDL Driver File Locations

Like internal applications, IDL drivers should be installed under the /var/apollo/data/ directory within a unique subdirectory name that matches the defined protocol name.  This aligns with the way any built-in resources for integrated drivers that use IDL are deployed and also ensures that a custom driver installed onto a SmartServer IoT will be preserved following an image upgrade.

Since this example IDL driver is simply called example, a directory should be created under the /var/apollo/data/ directory named ‘example’.  The following files should be copied into this directory:

  • /var/apollo/data/example/
  • main.cppexample.cppexample.hmakefile, and example-idl.conf

In addition to the example directory itself, a subdirectory underneath /var/apollo/data/example/ named ‘res’ needs to be created.  This resource directory, which is also defined in the example-idl.conf configuration file, specifies the location where device interface definition files (XIF files) associated with this custom driver will be located.  As described in Running a Custom IDL Driver, the SmartServer IoT’s CMS does not currently copy custom driver device interface definition files (XIF files) into this custom driver resource directory automatically when they are imported into the Device Types Widget in the CMS (LUM-7757).  As such, any XIF files that will be used to create devices of the type that are managed by way of this custom IDL driver need to be manually copied into the driver’s resource directory.  This example driver includes a sample device interface file that should be copied into the driver’s resource directory in order to test the driver.  The following file should be copied into this directory:

  • /var/apollo/data/example/res/
  • exampledevice.xif

While an IDL driver can be run explicitly, in most real instances IDL drivers are configured to run as a service so they’re available on startup and whenever the SmartServer IoT operates.  However in this case, you might find it useful to run the driver explicitly in a console window because the example driver outputs information to the console when callback functions are called to provide feedback on the execution flow of a typical IDL driver.  To run an application or a driver as a service on the SmartServer IoT, a configuration file for the driver needs to be copied to the /etc/supervisor/conf.d/ directory on the SmartServer IoT.  Once the example IDL driver has been successfully compiled, you can run the driver as a service rather than explicitly by copying the following file into this directory and rebooting the SmartServer IoT.

  • /etc/supervisor/conf.d/
  • example.conf