Module: caf_iot/main

Main package module.

Source:

Methods

init(modulesopt, specopt, frameworkFileNameopt, cbopt)

Main initialization function for the IoT framework.

This is typically the last call in your iot_methods.js file.

It recursively loads and instatiates all the components described in iot.json. When all of them are active, it connects to its CA to receive instructions and upload sensor data.

Parameters:
Name Type Attributes Description
modules NodeJS.Module | Array.<NodeJS.Module> <optional>

An optional sequence of modules (or just one) to load descriptions and implementations.

spec specDeltaType <optional>

Extra configuration data that will be merged with the framework components description. For example, to override the default name of the top component using spec.name.

frameworkFileName string <optional>

An optional file name containing a description of the framework components. It defaults to iot.json.

cb cbType <optional>

An optional callback that will return an error or the context $ with the created top level component bound by its name.

Source:

setInitCallback(newCallback) → {cbType}

Sets a default callback for the init method.

Parameters:
Name Type Description
newCallback cbType

A default callback for the init method.

Source:
Returns:

The old value for the callback.

Type
cbType