Custom Driver File Locations
Like internal applications, custom drivers must be installed under the /var/apollo/data/ directory within a unique directory name that matches the defined driver name. This aligns with the way any built-in resources for integrated drivers that use IDL are deployed and ensures that a custom driver installed onto a SmartServer will be preserved following an image update or upgrade. For the custom driver example, create example directories and copy the example files to the new directories as described in the following steps:
- Create a directory under the /var/apollo/data/ directory named ‘example’.
- Copy the following files to the /var/apollo/data/example directory:
- main.cpp
- example.cpp
- example.h
- makefile
- example-idl.conf
- Create a res directory underneath /var/apollo/data/example/. This resource directory, which is also defined in the example-idl.conf configuration file, specifies the location where device interface (XIF) definition files associated with this custom driver will be located. As described in Running a Custom Driver, the SmartServer CMS does not copy custom XIF files into this custom driver resource directory automatically when they are imported into the Device Types widget. 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 must be manually copied into the driver’s resource directory.
- Copy the following file to the /var/apollo/data/example/res/ directory:
- exampledevice.xpl
- exampledevice.xpl
- Copy the following file to the /etc/smartserverctl/conf.d directory to automatically run your custom driver as a service on start-up. For development and debugging, you can run your customer driver explicitly from a console window to view console output from the driver.
- example.conf