Verified Telemetry
Data Structures | Macros | Typedefs | Functions
FreeRTOS_verified_telemetry.h File Reference
#include "FreeRTOS_vt_fallcurve_component.h"
#include "FreeRTOS_vt_currentsense_component.h"
#include "vt_defs.h"

Go to the source code of this file.

Data Structures

union  FreeRTOS_VT_SIGNATURE_COMPONENT_UNION_TAG
 
struct  FreeRTOS_VT_OBJECT_TAG
 
struct  FreeRTOS_VERIFIED_TELEMETRY_DB_TAG
 

Macros

#define FREERTOS_AZURE_IOT_PNP_PROPERTIES   0x00000004
 
#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 FreeRTOS_VT_OBJECT_TAG FreeRTOS_VT_OBJECT
 
typedef struct FreeRTOS_VERIFIED_TELEMETRY_DB_TAG FreeRTOS_VERIFIED_TELEMETRY_DB
 

Functions

AzureIoTResult_t FreeRTOS_vt_init (FreeRTOS_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...
 
AzureIoTResult_t FreeRTOS_vt_signature_init (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, FreeRTOS_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...
 
AzureIoTResult_t FreeRTOS_vt_verified_telemetry_message_create_send (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, AzureIoTHubClient_t *xAzureIoTHubClient, const UCHAR *component_name_ptr, UINT component_name_length, const UCHAR *telemetry_data, UINT data_size)
 Creates and sends telemetry JSON with message properties containing telemetry status. More...
 
AzureIoTResult_t FreeRTOS_vt_process_command (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, AzureIoTHubClient_t *xAzureIoTHubClient, UCHAR *component_name_ptr, UINT component_name_length, UCHAR *pnp_command_name_ptr, UINT pnp_command_name_length, UINT *status_code)
 Processes all commands supported by VT Middleware. More...
 
AzureIoTResult_t FreeRTOS_vt_properties (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, AzureIoTHubClient_t *xAzureIoTHubClient)
 Updates Digital Twin with default desired property values when device is booted for the first time. More...
 
UINT MultiCalibration_store_cs_object (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, int32_t MultiCalibrationCount)
 Processes all desired property updates supported by vT Middleware. More...
 
AzureIoTResult_t FreeRTOS_vt_process_property_update (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, AzureIoTHubClient_t *xAzureIoTHubClient, const UCHAR *component_name_ptr, UINT component_name_length, AzureIoTJSONReader_t *xReader, UINT version)
 
AzureIoTResult_t FreeRTOS_vt_compute_evaluate_fingerprint_all_sensors (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB)
 Computes status of all telemetries which have been initialized to provide Verified Telemetry. More...
 
AzureIoTResult_t FreeRTOS_vt_send_desired_property_after_boot (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, AzureIoTHubClient_t *xAzureIoTHubClient, UINT message_type)
 Updates Digital Twin with default desired property values when device is booted for the first time. More...
 
AzureIoTResult_t FreeRTOS_vt_process_reported_property_sync (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, const UCHAR *component_name_ptr, UINT component_name_length, AzureIoTJSONReader_t *json_reader_ptr)
 Synchronizes VT Settings stored in digital Twin as reported properties at startup. More...
 
AzureIoTResult_t FreeRTOS_vt_signature_read (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, UCHAR *associated_telemetry, UINT associated_telemetry_length, UINT mode)
 
UINT FreeRTOS_vt_signature_process (FreeRTOS_VERIFIED_TELEMETRY_DB *verified_telemetry_DB, UCHAR *associated_telemetry, UINT associated_telemetry_length)
 

Function Documentation

◆ FreeRTOS_vt_compute_evaluate_fingerprint_all_sensors()

AzureIoTResult_t FreeRTOS_vt_compute_evaluate_fingerprint_all_sensors ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB)

Computes status of all telemetries which have been initialized to provide Verified Telemetry.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_init()

AzureIoTResult_t FreeRTOS_vt_init ( FreeRTOS_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.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]component_name_ptrName of the PnP component. Example - "vTDevice"
[in]enable_verified_telemetryUser specified value to set Verified Telemetry active or inactive, can also be configured during runtime from a writable Digital Twin property.
[in]device_driverThe platform specific device driver components for interacting with the device hardware.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_process_command()

AzureIoTResult_t FreeRTOS_vt_process_command ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
AzureIoTHubClient_t *  xAzureIoTHubClient,
UCHAR *  component_name_ptr,
UINT  component_name_length,
UCHAR *  pnp_command_name_ptr,
UINT  pnp_command_name_length,
UINT *  status_code 
)

Processes all commands supported by VT Middleware.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]xAzureIoTHubClientPointer to initialized Azure IoT PnP instance.
[in]component_name_ptrName of the component.
[in]component_name_lengthLength of name of the component.
[in]pnp_command_name_ptrName of the command invoked.
[in]pnp_command_name_lengthLength of name of the command invoked.
[out]status_codeStatus updated by function based on command execution.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_process_reported_property_sync()

AzureIoTResult_t FreeRTOS_vt_process_reported_property_sync ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
const UCHAR *  component_name_ptr,
UINT  component_name_length,
AzureIoTJSONReader_t *  json_reader_ptr 
)

Synchronizes VT Settings stored in digital Twin as reported properties at startup.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]component_name_ptrName of the component.
[in]component_name_lengthLength of name of the component.
[in]json_reader_ptrPointer to read the JSON payload of command.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_properties()

AzureIoTResult_t FreeRTOS_vt_properties ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
AzureIoTHubClient_t *  xAzureIoTHubClient 
)

Updates Digital Twin with default desired property values when device is booted for the first time.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]xAzureIoTHubClientPointer to initialized Azure IoT PnP instance.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_send_desired_property_after_boot()

AzureIoTResult_t FreeRTOS_vt_send_desired_property_after_boot ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
AzureIoTHubClient_t *  xAzureIoTHubClient,
UINT  message_type 
)

Updates Digital Twin with default desired property values when device is booted for the first time.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]xAzureIoTHubClientPointer to initialized Azure IoT PnP instance.
[in]message_typeType of document, only valid value are NX_AZURE_IOT_PNP_DESIRED_PROPERTIES or NX_AZURE_IOT_PNP_PROPERTIES
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_signature_init()

AzureIoTResult_t FreeRTOS_vt_signature_init ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
FreeRTOS_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.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]handlePointer to variable of type NX_VT_OBJECT storing collection settings and configuration data for a particular sensor telemetry.
[in]component_name_ptrName of the sensor. Example - "accelerometer" This would be prepended with 'vT' by VT library
[in]signature_typeOne of the defined signature types. Currently available types - VT_SIGNATURE_TYPE_FALLCURVE
[in]associated_telemetryTelmetries associated with this sensor, separated by commas Example - "accelerometerX, accelerometerY, accelerometerZ"
[in]telemetry_status_auto_updateUser 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_handleThe sensor specific connection configuration for collecting VT signatures.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ FreeRTOS_vt_verified_telemetry_message_create_send()

AzureIoTResult_t FreeRTOS_vt_verified_telemetry_message_create_send ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
AzureIoTHubClient_t *  xAzureIoTHubClient,
const UCHAR *  component_name_ptr,
UINT  component_name_length,
const UCHAR *  telemetry_data,
UINT  data_size 
)

Creates and sends telemetry JSON with message properties containing telemetry status.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]xAzureIoTHubClientPointer to initialized Azure IoT PnP instance.
[in]component_name_ptrName of the component.
[in]component_name_lengthLength of name of the component.
[in]telemetry_dataPointer to buffer containing telemetry data.
[in]data_sizeLength of telemetry data passed in the buffer.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ MultiCalibration_store_cs_object()

UINT MultiCalibration_store_cs_object ( FreeRTOS_VERIFIED_TELEMETRY_DB verified_telemetry_DB,
int32_t  MultiCalibrationCount 
)

Processes all desired property updates supported by vT Middleware.

Parameters
[in]verified_telemetry_DBPointer to variable of type VERIFIED_TELEMETRY_DB storing Verified Telemetry data.
[in]xAzureIoTHubClientPointer to initialized Azure IoT PnP instance.
[in]component_name_ptrName of the component.
[in]component_name_lengthLength of name of the component.
[in]xReaderPointer to read the JSON payload of command.
[in]versionProperty version stored in digital twin.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.