Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

example.conf

As mentioned in the described in Custom Driver File Locations section, the example.conf file is  is a configuration file that can be used to run an application or an IDL specifies the configuration for running the example customer driver as a service on the SmartServer IoT using Supervisorsmartserverctl, which is the SmartServer process manager.  The aforementioned section provides details on where this file should be located to run the example IDL driver as a service.  A configuration file for a program custom driver that’s going to be run as a service contains some basic elements.  This includes the program name and associated process name, and path statements to the actual application location and any associated log files.  The autostart and autorestart parameters also instruct Supervisor smartserverctl to run the application when the system boots and to restart it if it exits.

Code Block
languagecpp
[program:example]
command=/var/apollo/data/example/example
process_name=example
...
autostart=true
autorestart=true
...
stdout_logfile=/var/apollo/data/example/example.log

example-idl.conf

As also described in the IDL in Custom Driver File Locations section, the  example-idl.conf file is  is a configuration file that among other things, specifies the protocol driver name for this custom driver as it will be referenced in the CMS and IAP API, and it also provides the path to the resources sub- directory where device type files associated with this protocol are located.  The configuration file is passed to the IDL library in main.cpp when IdlInit() is called to start up the custom driver.  A complete description of the contents of a driver configuration file can be found in Conf File.

Code Block
languagecpp
{
"Protocol identifier": "example",
"MQTT specific details": {
   "MQTT client ID": "example.0",
   "cleanSession": false
   },
"xif_dir_absolute_path": "/var/apollo/data/example/res",
...
}

exampledevice.

...

xpl

As mentioned in Custom Driver File Locations, the SmartServer IoT’s CMS does not currently copy custom device interface definition files automatically into the custom driver resource directory if the file is imported into the CMS using the Device Types widget (LUM-7757).  This example device interface file , exampledevice.xpl,is a device interface (XIF) file that devices the network interface of an example device.  It includes the definition for a simulated device that contains four,simple counter data points.  There are certain data point property columns that are mandatory to include in a custom device interface file, which includes the DataPoint Name, IAP Type, Write Enable, & Address columns.  Details on these mandatory column properties can be found in Collecting or Creating Device Definitions.  Drivers to other protocols may need additional columns to define all of the necessary properties required to access data points using these custom protocols.  Custom columns can be added You can add custom columns to the definitions for datapoints in a device interface definition file as shown in the example below, however the SmartServer does not currently pass these custom parameters to the driver itself via the device create callback function (AP-7698).  For reference, see the *xif_dp_array parameter in the device create callback function described in Device Create Functions.

...