Conf File

You use a conf file to specify details for a custom driver.  This file must contain a JSON object with the custom driver details.  The custom driver must specify the absolute path for the file in the IDL init call.  The following example shows a conf file.  The parameters are described below the example. 

Conf File
{
    "Protocol identifier": "example",
        "MQTT specific details": {
            "MQTT client ID": "example.0",
            "cleanSession": false
        },
        "xif_dir_absolute_path": "/var/apollo/data/idl-example/res",
        "isDiscoverySupported": true,
        "timeouts": {
            "Device create timeout ms": 120000,
            "Device provision timeout ms": 60000,
            "Device deprovision timeout ms": 10000,
            "Device replace timeout ms": 60000,
            "Device delete timeout ms": 60000,
            "Datapoint read timeout ms": 1000,
            "Datapoint write timeout ms": 1000,
            "Discovery start callback timeout ms": 15000,
            "Discovery step callback timeout ms": 30000,
            "Discovery stop callback timeout ms": 15000
        },
        "about object details": {
            "device max count": 127,
            "name": "Example protocol engine",
            "desc": "Example protocol engine for SmartServer IoT"
        }
}

Conf File Parameters

The following list describes the conf parameters.

Parameter                                                        

Description

Protocol identifier(Required)  Identifies the driver name to be used in any IAP/MQ topics referencing this custom driver.
MQTT specific details(Optional)  This section allows you to specify whether the MQTT client is persistent.
MQTT client ID(Optional)  A unique client ID.  Persistent clients must specify a unique MQTT client ID, and must re-use the same client ID in every session.   
cleanSession(Optional) Specifies whether the client is transient or persistent.  Set to FALSE to implement persistence.  Set to TRUE to for a transient client.
The default is True.
xif_dir_absolute_path(Required)  Specifies the location of the XIF files that are read by the protocol engine.
isDiscoverySupported(Optional)  Specifies whether the driver and protocol support device discovery and the associated device discovery APIs.
timeouts

(Optional) Specifies the timeouts to be used for each 

"Device create timeout ms": 120000,
"Device provision timeout ms": 60000,
"Device deprovision timeout ms": 10000,
"Device replace timeout ms": 60000,
"Device delete timeout ms": 60000,
"Datapoint read timeout ms": 1000,
"Datapoint write timeout ms": 1000,
"Discovery start callback timeout ms": 15000,
"Discovery step callback timeout ms": 30000,
"Discovery stop callback timeout ms": 15000

Device create timeout ms

(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver device create callback function (OnDevCreate) before timing out. If the IDI driver does not return a result through IdlDevCreateResult() within this timeout period, IDL reports an error that the device create action failed and deletes the incomplete device node.

Device provision timeout ms(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver device provision callback function (OnDevProvision) before timing out. If the IDI driver does not return a result through IdlDevProvisionResult() within this timeout period, IDL reports an error that the device provision action failed.
Device deprovision timeout ms

(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver device deprovision callback function (OnDevDeprovision) before timing out. If the custom driver does not return a result through IdlDevDeprovisionResult() within this timeout period, IDL reports an error that the device deprovision action failed.

Device replace timeout ms

(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver device replace callback function (OnDevReplace) before timing out. If the custom driver does not return a result through IdlDevReplaceResult() within this timeout period, IDL reports an error that the device replace action failed.

Device delete timeout ms

(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver device delete callback function (OnDevDelete) before timing out. If the custom driver does not return a result through IdlDevDeleteResult() within this timeout period, IDL reports an error that the device delete action failed.

Datapoint read timeout ms

(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver data point read callback function (DpRead) before timing out. If the custom driver does not return a result through IdlDpReadResult() within this timeout period, IDL reports an error that the data point read action failed.

Datapoint write timeout ms

(Optional)  Specifies the timeout value (in milliseconds) that IDL waits after calling the custom driver data point write callback function (DpWrite) before timing out. If the custom driver does not return a result through IdlDpWriteResult() within this timeout period, IDL reports an error that the data point write action failed.

Discovery start callback timeout ms

(Optional)  Specifies the timeout value (in milliseconds) during the start portion of device discovery for a protocol that supports discovery If this timeout is not defined in the conf file, it defaults to 15000 (15 seconds). IDL passes this timeout value to the custom driver through the callback function as driverInstanceContext. A custom driver can use this value to determine the timeout value to send back to IDL on the callback call.

Discovery step callback timeout ms

(Optional)  Specifies the timeout value (in milliseconds) during a step portion of device discovery for a protocol that supports discoveryIf this timeout is not defined in the conf file, it defaults to 30000 (30 seconds). IDL passes this timeout value to the custom driver through the callback function as driverInstanceContext. A custom driver can use this value to determine the timeout value to send back to IDL on the callback call.

Discovery stop callback timeout ms

(Optional)Specifies the timeout value (in milliseconds) during the stop portion of device discovery for a protocol that supports discovery. If this timeout is not defined in the conf file, it defaults to 15000 (15 seconds). IDL passes this timeout value to the custom driver through the callback function as driverInstanceContext. A custom driver can use this value to determine the timeout value to send back to IDL on the callback call.

about object details

(Optional) Contains attributes such as "device max count" and "name", which describe the information that the IDL publishes in the IAP/MQ about object, on topic glp/0/./=engine/{Edge_Protocol}/about .
device max count(Optional)  Specifies the maximum number of devices this driver supports.
name(Optional)  Provides the name of the protocol engine.
desc(Optional)  Provides a description of the protocol engine.