Verified Telemetry
nx_vt_currentsense_component.h
Go to the documentation of this file.
1 /* Copyright (c) Microsoft Corporation.
2  Licensed under the MIT License. */
3 
6 #ifndef NX_VT_CURRENTSENSE_COMPONENT_H
7 #define NX_VT_CURRENTSENSE_COMPONENT_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #include "nx_azure_iot_json_reader.h"
14 #include "nx_azure_iot_json_writer.h"
15 #include "nx_azure_iot_pnp_client.h"
16 
17 #include "vt_cs_api.h"
18 
20 {
21  /* Name of this component */
22  UCHAR component_name_ptr[30];
23 
24  /* Component Name Length */
25  UINT component_name_length;
26 
27  /* Telemetry associated with the currentsense signature component*/
28  UCHAR associated_telemetry[100];
29 
30  /* Currentsense Object */
31  VT_CURRENTSENSE_OBJECT cs_object;
32 
33  /* Status of reported properties sent */
34  UINT property_sent;
35 
37 
54  UCHAR* component_name_ptr,
55  VT_DEVICE_DRIVER* device_driver,
56  VT_SENSOR_HANDLE* sensor_handle,
57  UCHAR* associated_telemetry,
58  CHAR* shared_buffer,
59  UINT shared_buffer_size);
60 
74  NX_AZURE_IOT_PNP_CLIENT* iotpnp_client_ptr,
75  bool* device_status,
76  bool toggle_verified_telemetry);
77 
95  NX_AZURE_IOT_PNP_CLIENT* iotpnp_client_ptr,
96  UCHAR* component_name_ptr,
97  UINT component_name_length,
98  UCHAR* pnp_command_name_ptr,
99  UINT pnp_command_name_length,
100  NX_AZURE_IOT_JSON_READER* json_reader_ptr,
101  NX_AZURE_IOT_JSON_WRITER* json_response_ptr,
102  UINT* status_code);
103 
118  NX_AZURE_IOT_PNP_CLIENT* iotpnp_client_ptr,
119  const UCHAR* component_name_ptr,
120  UINT component_name_length,
121  NX_AZURE_IOT_JSON_READER* name_value_reader_ptr,
122  UINT version);
123 
136  UCHAR* associated_telemetry,
137  UINT associated_telemetry_length,
138  bool toggle_verified_telemetry,UINT mode);
139 
152  UCHAR* associated_telemetry,
153  UINT associated_telemetry_length,
154  bool toggle_verified_telemetry);
155 
165 bool nx_vt_currentsense_fetch_telemetry_status(NX_VT_CURRENTSENSE_COMPONENT* handle, bool toggle_verified_telemetry);
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 #endif /* NX_VT_CURRENTSENSE_COMPONENT_H */
nx_vt_currentsense_process_reported_property_sync
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.
nx_vt_currentsense_fetch_telemetry_status
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.
nx_vt_currentsense_reported_properties
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,...
nx_vt_currentsense_init
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.
nx_vt_currentsense_signature_read
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.
NX_VT_CURRENTSENSE_COMPONENT_TAG
Definition: nx_vt_currentsense_component.h:19
nx_vt_currentsense_process_command
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 ,...
nx_vt_currentsense_signature_process
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 ...