Verified Telemetry
|
#include "nx_azure_iot_json_reader.h"
#include "nx_azure_iot_json_writer.h"
#include "nx_azure_iot_pnp_client.h"
#include "vt_cs_api.h"
Go to the source code of this file.
Data Structures | |
struct | NX_VT_CURRENTSENSE_COMPONENT_TAG |
Typedefs | |
typedef struct NX_VT_CURRENTSENSE_COMPONENT_TAG | NX_VT_CURRENTSENSE_COMPONENT |
Functions | |
UINT | nx_vt_currentsense_init (NX_VT_CURRENTSENSE_COMPONENT *handle, UCHAR *component_name_ptr, VT_DEVICE_DRIVER *device_driver, VT_SENSOR_HANDLE *sensor_handle, UCHAR *associated_telemetry, CHAR *shared_buffer, UINT shared_buffer_size) |
Initializes an instance of Verified Telemetry Information Interface for currentsense component. More... | |
UINT | nx_vt_currentsense_reported_properties (NX_VT_CURRENTSENSE_COMPONENT *handle, NX_AZURE_IOT_PNP_CLIENT *iotpnp_client_ptr, bool *device_status, bool toggle_verified_telemetry) |
Send read-only properties of the currentsense component like telemetryStatus, fingerprintType, fingerprintTemplate, fingerprintTemplateConfidenceMetric to IoT Hub. More... | |
UINT | nx_vt_currentsense_process_command (NX_VT_CURRENTSENSE_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 currentsense component eg. setResetFingerprintTemplate , retrainFingerprintTemplate. More... | |
UINT | nx_vt_currentsense_process_reported_property_sync (NX_VT_CURRENTSENSE_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 currentsense template database from the digital twin upon startup. More... | |
UINT | nx_vt_currentsense_signature_read (NX_VT_CURRENTSENSE_COMPONENT *handle, UCHAR *associated_telemetry, UINT associated_telemetry_length, bool toggle_verified_telemetry, UINT mode) |
Start reading current on the device. Call this function just before reading sensor data. More... | |
UINT | nx_vt_currentsense_signature_process (NX_VT_CURRENTSENSE_COMPONENT *handle, UCHAR *associated_telemetry, UINT associated_telemetry_length, bool toggle_verified_telemetry) |
Process the raw current data stored. Get status in normal operation, calibrate and recalibrate based on commands. More... | |
bool | nx_vt_currentsense_fetch_telemetry_status (NX_VT_CURRENTSENSE_COMPONENT *handle, bool toggle_verified_telemetry) |
Get status of the sensor related to this currentsense component. More... | |
bool nx_vt_currentsense_fetch_telemetry_status | ( | NX_VT_CURRENTSENSE_COMPONENT * | handle, |
bool | toggle_verified_telemetry | ||
) |
Get status of the sensor related to this currentsense component.
[in] | handle | The currentsense handle created by a call to the initialization function. |
[in] | toggle_verified_telemetry | Bool value to enable VT for this component or not. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_currentsense_init | ( | NX_VT_CURRENTSENSE_COMPONENT * | handle, |
UCHAR * | component_name_ptr, | ||
VT_DEVICE_DRIVER * | device_driver, | ||
VT_SENSOR_HANDLE * | sensor_handle, | ||
UCHAR * | associated_telemetry, | ||
CHAR * | shared_buffer, | ||
UINT | shared_buffer_size | ||
) |
Initializes an instance of Verified Telemetry Information Interface for currentsense component.
[in] | handle | The handle created by a call to the initialization function. |
[in] | component_name_ptr | Name of the PNP component eg. vTsoilMoistureExternal1. |
[in] | device_driver | The platform driver functions for interacting with the device hardware. |
[in] | sensor_handle | The platform driver references for interacting with the particular sensor connected to device hardware. |
[in] | associated_telemetry | Name of the telemetry associated with this component. |
[in] | shared_buffer | Pointer to byte buffer passed from application layer, used for fingerprint calculation/storage. |
[in] | shared_buffer_length | Length of byte buffer passed from application layer, used for fingerprint calculation/storage. |
VT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_currentsense_process_command | ( | NX_VT_CURRENTSENSE_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 currentsense component eg. setResetFingerprintTemplate , retrainFingerprintTemplate.
[in] | handle | The currentsense handle created by a call to the initialization function. |
[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_currentsense_process_reported_property_sync | ( | NX_VT_CURRENTSENSE_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 currentsense template database from the digital twin upon startup.
[in] | handle | The currentsense handle created by a call to the initialization function. |
[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_currentsense_reported_properties | ( | NX_VT_CURRENTSENSE_COMPONENT * | handle, |
NX_AZURE_IOT_PNP_CLIENT * | iotpnp_client_ptr, | ||
bool * | device_status, | ||
bool | toggle_verified_telemetry | ||
) |
Send read-only properties of the currentsense component like telemetryStatus, fingerprintType, fingerprintTemplate, fingerprintTemplateConfidenceMetric to IoT Hub.
[in] | handle | The currentsense handle created by a call to the initialization function. |
[in] | iotpnp_client_ptr | Pointer to initialized Azure IoT PnP instance. |
[out] | device_status | Pointer to update the global bool showing if all devices are working or not. |
[in] | toggle_verified_telemetry | Bool value to enable VT for this component or not. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_currentsense_signature_process | ( | NX_VT_CURRENTSENSE_COMPONENT * | handle, |
UCHAR * | associated_telemetry, | ||
UINT | associated_telemetry_length, | ||
bool | toggle_verified_telemetry | ||
) |
Process the raw current data stored. Get status in normal operation, calibrate and recalibrate based on commands.
[in] | handle | The currentsense handle created by a call to the initialization function. |
[in] | associated_telemetry | Name of the telemetry associated with this component. |
[in] | associated_telemetry_length | Length of the name of the telemetry associated with this component. |
[in] | toggle_verified_telemetry | Bool value to enable VT for this component or not. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |
UINT nx_vt_currentsense_signature_read | ( | NX_VT_CURRENTSENSE_COMPONENT * | handle, |
UCHAR * | associated_telemetry, | ||
UINT | associated_telemetry_length, | ||
bool | toggle_verified_telemetry, | ||
UINT | mode | ||
) |
Start reading current on the device. Call this function just before reading sensor data.
[in] | handle | The currentsense handle created by a call to the initialization function. |
[in] | associated_telemetry | Name of the telemetry associated with this component. |
[in] | associated_telemetry_length | Length of the name of the telemetry associated with this component. |
[in] | toggle_verified_telemetry | Bool value to enable VT for this component or not. |
NX_AZURE_IOT_SUCCESS | upon success or an error code upon failure. |