Verified Telemetry
Data Structures | Typedefs | Functions
nx_vt_fallcurve_component.h File Reference
#include "nx_azure_iot_json_reader.h"
#include "nx_azure_iot_json_writer.h"
#include "nx_azure_iot_pnp_client.h"
#include "vt_fc_api.h"

Go to the source code of this file.

Data Structures

struct  NX_VT_FALLCURVE_COMPONENT_TAG
 

Typedefs

typedef struct NX_VT_FALLCURVE_COMPONENT_TAG NX_VT_FALLCURVE_COMPONENT
 

Functions

UINT nx_vt_fallcurve_init (NX_VT_FALLCURVE_COMPONENT *handle, UCHAR *component_name_ptr, VT_DEVICE_DRIVER *device_driver, VT_SENSOR_HANDLE *sensor_handle, UCHAR *associated_telemetry, bool telemetry_status_auto_update)
 Initializes an instance of Verified Telemetry Information Interface for fallcurve component. More...
 
UINT nx_vt_fallcurve_telemetry_status_property (NX_VT_FALLCURVE_COMPONENT *handle, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr, bool *device_status)
 Send "telemetryStatus" read-only property to IoT Hub. More...
 
UINT nx_vt_fallcurve_fingerprint_type_property (NX_VT_FALLCURVE_COMPONENT *handle, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr)
 Send "fingerprintType" read-only property to IoT Hub. More...
 
UINT nx_vt_fallcurve_process_command (NX_VT_FALLCURVE_COMPONENT *handle, 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)
 Process commands related to fallcurve component eg. setResetFingerprintTemplate , retrainFingerprintTemplate. More...
 
UINT nx_vt_fallcurve_process_reported_property_sync (NX_VT_FALLCURVE_COMPONENT *handle, 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 on-device fallcurve template database from the digital twin upon startup. More...
 
UINT nx_vt_fallcurve_compute_sensor_status_global (NX_VT_FALLCURVE_COMPONENT *handle, bool toggle_verified_telemetry)
 Get status of the sensor related to this fallcurve component. More...
 

Function Documentation

◆ nx_vt_fallcurve_compute_sensor_status_global()

UINT nx_vt_fallcurve_compute_sensor_status_global ( NX_VT_FALLCURVE_COMPONENT handle,
bool  toggle_verified_telemetry 
)

Get status of the sensor related to this fallcurve component.

Parameters
[in]handleThe currentsense handle created by a call to the initialization function.
[in]toggle_verified_telemetryBool value to enable VT for this component or not.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ nx_vt_fallcurve_fingerprint_type_property()

UINT nx_vt_fallcurve_fingerprint_type_property ( NX_VT_FALLCURVE_COMPONENT handle,
NX_AZURE_IOT_PNP_CLIENT *  iotpnp_client_ptr 
)

Send "fingerprintType" read-only property to IoT Hub.

Parameters
[in]handleThe currentsense handle created by a call to the initialization function.
[in]iotpnp_client_ptrPointer to initialized Azure IoT PnP instance.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ nx_vt_fallcurve_init()

UINT nx_vt_fallcurve_init ( NX_VT_FALLCURVE_COMPONENT handle,
UCHAR *  component_name_ptr,
VT_DEVICE_DRIVER *  device_driver,
VT_SENSOR_HANDLE *  sensor_handle,
UCHAR *  associated_telemetry,
bool  telemetry_status_auto_update 
)

Initializes an instance of Verified Telemetry Information Interface for fallcurve component.

Parameters
[in]handleThe handle created by a call to the initialization function.
[in]component_name_ptrName of the PNP component.
[in]device_driverThe platform driver functions for interacting with the device hardware.
[in]sensor_handleThe platform driver references for interacting with the device hardware.
[in]associated_telemetryName of the telemetry associated with this component.
[in]telemetry_status_auto_updateBool to compute sensor status when a global command is issued.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ nx_vt_fallcurve_process_command()

UINT nx_vt_fallcurve_process_command ( NX_VT_FALLCURVE_COMPONENT handle,
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 
)

Process commands related to fallcurve component eg. setResetFingerprintTemplate , retrainFingerprintTemplate.

Parameters
[in]handleThe currentsense handle created by a call to the initialization function.
[in]iotpnp_client_ptrPointer 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.
[in]json_reader_ptrPointer to read the JSON payload of command.
[in]json_response_ptrPointer to write response JSON payload.
[out]status_codeStatus updated by function based on command execution.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.

◆ nx_vt_fallcurve_process_reported_property_sync()

UINT nx_vt_fallcurve_process_reported_property_sync ( NX_VT_FALLCURVE_COMPONENT handle,
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 on-device fallcurve template database from the digital twin upon startup.

Parameters
[in]handleThe currentsense handle created by a call to the initialization function.
[in]iotpnp_client_ptrPointer to initialized Azure IoT PnP instance.
[in]component_name_ptrName of the component.
[in]component_name_lengthLength of name of the component.
[in]name_value_reader_ptrPointer 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.

◆ nx_vt_fallcurve_telemetry_status_property()

UINT nx_vt_fallcurve_telemetry_status_property ( NX_VT_FALLCURVE_COMPONENT handle,
NX_AZURE_IOT_PNP_CLIENT *  iotpnp_client_ptr,
bool *  device_status 
)

Send "telemetryStatus" read-only property to IoT Hub.

Parameters
[in]handleThe currentsense handle created by a call to the initialization function.
[in]iotpnp_client_ptrPointer to initialized Azure IoT PnP instance.
[out]device_statusPointer to update the global bool showing if all devices are working or not.
Return values
NX_AZURE_IOT_SUCCESSupon success or an error code upon failure.