MindConnect Library – Agent Application¶
For an agent application to use MCL, first step would be to initialize core configuration data structure (mcl_core_configuration_t) and set the values of configuration parameters. See mcl_core_configuration.h for details.
Core configuration data structure is then used to initialize MCL core component. The core component instance (mcl_core_t) is later used to onboard the agent to Insights Hub, rotate keys when required and retrieve access token for connectivity services. The core component handle is also required to initialize MCL connectivity extension. See mcl_core.h for details.
To access to connectivity services, the agent must initialize MCL connectivity extension component. The connectivity extension instance (mcl_connectivity_t) is later used to exchange data with Insights Hub. See mcl_connectivity.h for details.
The agent can exchange predefined data types or any custom data type with MCL. The predefined data types are data source configuration, timeseries, event and file. See mcl_data_source_configuration.h, mcl_timeseries.h, mcl_event.h and mcl_file.h for details on how to create and exchange predefined data types with Insights Hub. For custom data type, see mcl_custom_data.h.
Note that, before exchanging timeseries data, data source configuration which describes the timeseries data has to be uploaded to Insights Hub first and then the data points in the data source configuration have to mapped to the corresponding properties of the asset. See mcl_mapping.h for data point mapping details.
Agents have the option to exchange each data item as a single or they have the option to exchange multiple data items independent of their types together in a store (mcl_store_t). See mcl_store.h for details.