Verified Telemetry
|
#include "nx_azure_iot_json_reader.h"
#include "nx_azure_iot_json_writer.h"
#include "nx_azure_iot_pnp_client.h"
#include "nx_vt_currentsense_component.h"
#include "nx_vt_fallcurve_component.h"
Go to the source code of this file.
Data Structures | |
union | NX_VT_SIGNATURE_COMPONENT_UNION_TAG |
struct | NX_VT_OBJECT_TAG |
struct | NX_VERIFIED_TELEMETRY_DB_TAG |
Macros | |
#define | VT_SIGNATURE_TYPE_FALLCURVE 0x01 |
#define | VT_SIGNATURE_TYPE_CURRENTSENSE 0x02 |
#define | VT_MINIMUM_BUFFER_SIZE_BYTES sizeof(VT_CURRENTSENSE_RAW_SIGNATURES_READER) |
Typedefs | |
typedef struct NX_VT_OBJECT_TAG | NX_VT_OBJECT |
typedef struct NX_VERIFIED_TELEMETRY_DB_TAG | NX_VERIFIED_TELEMETRY_DB |
Functions | |
UINT | nx_vt_init (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, UCHAR *component_name_ptr, bool enable_verified_telemetry, VT_DEVICE_DRIVER *device_driver, CHAR *scratch_buffer, UINT scratch_buffer_length) |
Initializes Global Verified Telemetry using platform specific device drivers. More... | |
UINT | nx_vt_signature_init (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_VT_OBJECT *handle, UCHAR *component_name_ptr, UINT signature_type, UCHAR *associated_telemetry, bool telemetry_status_auto_update, VT_SENSOR_HANDLE *sensor_handle) |
Initializes Verified Telemetry for a particular sensor data stream. More... | |
UINT | nx_vt_process_command (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr, UCHAR *component_name_ptr, UINT component_name_length, UCHAR *pnp_command_name_ptr, UINT pnp_command_name_length, NX_AZURE_IOT_JSON_READER *json_reader_ptr, NX_AZURE_IOT_JSON_WRITER *json_response_ptr, UINT *status_code) |
Processes all commands supported by VT Middleware. More... | |
UINT | nx_vt_process_property_update (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr, const UCHAR *component_name_ptr, UINT component_name_length, NX_AZURE_IOT_JSON_READER *name_value_reader_ptr, UINT version) |
Processes all desired property updates supported by vT Middleware. More... | |
UINT | nx_vt_properties (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr) |
Creates payloads and sends all reported properties supported by VT Middleware. More... | |
UINT | nx_vt_send_desired_property_after_boot (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr, UINT message_type) |
Updates Digital Twin with default desired property values when device is booted for the first time. More... | |
UINT | nx_vt_process_reported_property_sync (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr, const UCHAR *component_name_ptr, UINT component_name_length, NX_AZURE_IOT_JSON_READER *name_value_reader_ptr, UINT version) |
Synchronizes VT Settings stored in digital Twin as reported properties at startup. More... | |
UINT | nx_vt_verified_telemetry_message_create_send (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *pnp_client_ptr, const UCHAR *component_name_ptr, UINT component_name_length, UINT wait_option, const UCHAR *telemetry_data, UINT data_size) |
Creates and sends telemetry JSON with message properties containing telemetry status. More... | |
UINT | nx_vt_compute_evaluate_fingerprint_all_sensors (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB) |
Computes status of all telemetries which have been initialized to provide Verified Telemetry. More... | |
UINT | nx_vt_azure_iot_pnp_client_component_add (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, NX_AZURE_IOT_PNP_CLIENT *pnp_client_ptr) |
Adds VT Information Interfaces that are initialized to the nx_pnp_client object. More... | |
UINT | nx_vt_signature_read (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, UCHAR *associated_telemetry, UINT associated_telemetry_length, UINT mode) |
Starts reading VT signatures for the sensor mapped to the telemetry string passed. More... | |
UINT | nx_vt_signature_process (NX_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, UCHAR *associated_telemetry, UINT associated_telemetry_length) |
Processes the collected VT signatures for the sensor mapped to the telemetry string passed. More... | |
UINT nx_vt_azure_iot_pnp_client_component_add | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | pnp_client_ptr | ||
) |
Adds VT Information Interfaces that are initialized to the nx_pnp_client object.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | pnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_compute_evaluate_fingerprint_all_sensors | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB | ) |
Computes status of all telemetries which have been initialized to provide Verified Telemetry.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_init | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
UCHAR * | component_name_ptr, | ||
bool | enable_verified_telemetry, | ||
VT_DEVICE_DRIVER * | device_driver, | ||
CHAR * | scratch_buffer, | ||
UINT | scratch_buffer_length | ||
) |
Initializes Global Verified Telemetry using platform specific device drivers.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | component_name_ptr | Name of the PnP component. Example - "vTDevice" |
[in] | enableVerifiedTelemetry | User specified value to set Verified Telemetry active or inactive, can also be configured during runtime from a writable Digital Twin property. |
[in] | device_driver | The platform specific device driver components for interacting with the device hardware. |
[in] | scratch_buffer | Pointer to byte buffer passed from application layer, used for fingerprint calculation/storage. |
[in] | scratch_buffer_length | Length of byte buffer passed from application layer, used for fingerprint calculation/storage. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_process_command | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | iotpnp_client_ptr, | ||
UCHAR * | component_name_ptr, | ||
UINT | component_name_length, | ||
UCHAR * | pnp_command_name_ptr, | ||
UINT | pnp_command_name_length, | ||
NX_AZURE_IOT_JSON_READER * | json_reader_ptr, | ||
NX_AZURE_IOT_JSON_WRITER * | json_response_ptr, | ||
UINT * | status_code | ||
) |
Processes all commands supported by VT Middleware.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | iotpnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
[in] | component_name_ptr | Name of the component. |
[in] | component_name_length | Length of name of the component. |
[in] | pnp_command_name_ptr | Name of the command invoked. |
[in] | pnp_command_name_length | Length of name of the command invoked. |
[in] | json_reader_ptr | Pointer to read the JSON payload of command. |
[in] | json_response_ptr | Pointer to write response JSON payload. |
[out] | status_code | Status updated by function based on command execution. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_process_property_update | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | iotpnp_client_ptr, | ||
const UCHAR * | component_name_ptr, | ||
UINT | component_name_length, | ||
NX_AZURE_IOT_JSON_READER * | name_value_reader_ptr, | ||
UINT | version | ||
) |
Processes all desired property updates supported by vT Middleware.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | iotpnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
[in] | component_name_ptr | Name of the component. |
[in] | component_name_length | Length of name of the component. |
[in] | name_value_reader_ptr | Pointer to read the JSON payload of command. |
[in] | version | Property version stored in digital twin. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_process_reported_property_sync | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | iotpnp_client_ptr, | ||
const UCHAR * | component_name_ptr, | ||
UINT | component_name_length, | ||
NX_AZURE_IOT_JSON_READER * | name_value_reader_ptr, | ||
UINT | version | ||
) |
Synchronizes VT Settings stored in digital Twin as reported properties at startup.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | iotpnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
[in] | component_name_ptr | Name of the component. |
[in] | component_name_length | Length of name of the component. |
[in] | name_value_reader_ptr | Pointer to read the JSON payload of command. |
[in] | version | Property version stored in digital twin. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_properties | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | iotpnp_client_ptr | ||
) |
Creates payloads and sends all reported properties supported by VT Middleware.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | iotpnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_send_desired_property_after_boot | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | iotpnp_client_ptr, | ||
UINT | message_type | ||
) |
Updates Digital Twin with default desired property values when device is booted for the first time.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | iotpnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
[in] | message_type | Type of document, only valid value are NX_AZURE_IOT_PNP_DESIRED_PROPERTIES or NX_AZURE_IOT_PNP_PROPERTIES |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_signature_init | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_VT_OBJECT * | handle, | ||
UCHAR * | component_name_ptr, | ||
UINT | signature_type, | ||
UCHAR * | associated_telemetry, | ||
bool | telemetry_status_auto_update, | ||
VT_SENSOR_HANDLE * | sensor_handle | ||
) |
Initializes Verified Telemetry for a particular sensor data stream.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | handle | Pointer to variable of type NX_VT_OBJECT storing collection settings and configuration data for a particular sensor telemetry. |
[in] | component_name_ptr | Name of the sensor. Example - "accelerometer" This would be prepended with 'vT' by VT library |
[in] | signature_type | One of the defined signature types. Currently available types - VT_SIGNATURE_TYPE_FALLCURVE, VT_SIGNATURE_TYPE_CURRENTSENSE |
[in] | associated_telemetry | Telmetries associated with this sensor, separated by commas Example - "accelerometerX, accelerometerY, accelerometerZ" |
[in] | telemetry_status_auto_update | User specified value to control whether fingerprint computation for the sensor should be invoked when nx_vt_compute_evaluate_fingerprint_all_sensors is called |
[in] | sensor_handle | The sensor specific connection configuration for collecting VT signatures. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_signature_process | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
UCHAR * | associated_telemetry, | ||
UINT | associated_telemetry_length | ||
) |
Processes the collected VT signatures for the sensor mapped to the telemetry string passed.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | associated_telemetry | Name of the telemetry. |
[in] | associated_telemetry_length | Length of name of the telemetry. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_signature_read | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
UCHAR * | associated_telemetry, | ||
UINT | associated_telemetry_length, | ||
UINT | mode | ||
) |
Starts reading VT signatures for the sensor mapped to the telemetry string passed.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | associated_telemetry | Name of the telemetry. |
[in] | associated_telemetry_length | Length of name of the telemetry. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_verified_telemetry_message_create_send | ( | NX_VERIFIED_TELEMETRY_DB * | verified_telemetry_DB, |
NX_AZURE_IOT_PNP_CLIENT * | pnp_client_ptr, | ||
const UCHAR * | component_name_ptr, | ||
UINT | component_name_length, | ||
UINT | wait_option, | ||
const UCHAR * | telemetry_data, | ||
UINT | data_size | ||
) |
Creates and sends telemetry JSON with message properties containing telemetry status.
[in] | verified_telemetry_DB | Pointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data. |
[in] | pnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
[in] | component_name_ptr | Name of the component. |
[in] | component_name_length | Length of name of the component. |
[in] | wait_option | Ticks to wait if no packet is available. |
[in] | telemetry_data | Pointer to buffer containing telemetry data. |
[in] | data_size | Length of telemetry data passed in the buffer. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |