|
tvcmiclient
|
#include <stdint.h>#include <time.h>Go to the source code of this file.
Data Structures | |
| struct | TVCMI_CreatedMetricTag |
| Created metric information. Used in TVCMI_CreatedMetrics. More... | |
| struct | TVCMI_CreatedMetricsTag |
| Created metrics information. More... | |
| struct | TVCMI_MetricInfoTag |
| Metric information. Used in TVCMI_SensorInfo. More... | |
| struct | TVCMI_PluginParameterTag |
| Plugin parameters information. Used in TVCMI_SensorMetadata. More... | |
| struct | TVCMI_SensorMetadataTag |
| Sensor information. Used in TVCMI_SensorsInfo. More... | |
| struct | TVCMI_SensorsInfoTag |
| Sensors information. More... | |
| struct | TVCMI_MetricMetadataTag |
| Metric information. More... | |
Macros | |
| #define | IOTTVCMI_API |
| #define | ApiVersion "v1.0" |
| The version of the TeamViewer IOT Agent API. | |
Typedefs | |
| typedef enum TVCMI_ApiErrorTag | TVCMI_ApiError |
| Gateway errors. | |
| typedef enum TVCMI_ErrorTag | TVCMI_Error |
| Error values. | |
| typedef enum TVCMI_ValueUnitTag | TVCMI_ValueUnit |
| Metric value units. | |
| typedef enum TVCMI_ValueTypeTag | TVCMI_ValueType |
| Metric value types. | |
| typedef struct TVCMI_CreatedMetricTag | TVCMI_CreatedMetric |
| Created metric information. Used in TVCMI_CreatedMetrics. | |
| typedef struct TVCMI_CreatedMetricsTag | TVCMI_CreatedMetrics |
| Created metrics information. | |
| typedef struct TVCMI_MetricInfoTag | TVCMI_MetricInfo |
| Metric information. Used in TVCMI_SensorInfo. | |
| typedef enum TVCMI_SensorTypeTag | TVCMI_SensorType |
| Sensor types. | |
| typedef struct TVCMI_PluginParameterTag | TVCMI_PluginParameter |
| Plugin parameters information. Used in TVCMI_SensorMetadata. | |
| typedef struct TVCMI_SensorMetadataTag | TVCMI_SensorMetadata |
| Sensor information. Used in TVCMI_SensorsInfo. | |
| typedef struct TVCMI_SensorsInfoTag | TVCMI_SensorsInfo |
| Sensors information. | |
| typedef struct TVCMI_MetricMetadataTag | TVCMI_MetricMetadata |
| Metric information. | |
| typedef struct TVCMI_MetricSchemaContainerTag | TVCMI_MetricSchemaContainer |
| A container for creating metrics. | |
| typedef struct TVCMI_MetricValueContainerTag | TVCMI_MetricValueContainer |
| A container for sending metric values. | |
| typedef struct TVCMI_ClientTag | TVCMI_Client |
| A client object. | |
Enumerations | |
| enum | TVCMI_ApiErrorTag { TVCMI_ApiError_NoError = -1, TVCMI_ApiError_UnknownError = 0, TVCMI_ApiError_NoBackendConnection = 1, TVCMI_ApiError_NoLicence = 2, TVCMI_ApiError_InternalError = 3, TVCMI_ApiError_InvalidJson = 4, TVCMI_ApiError_JsonIsNotAnObject = 5, TVCMI_ApiError_MissingParameter = 6, TVCMI_ApiError_ParameterIsNotAString = 7, TVCMI_ApiError_ParameterIsNotANumber = 8, TVCMI_ApiError_ParameterIsNotABool = 9, TVCMI_ApiError_ParameterIsNotAnArray = 10, TVCMI_ApiError_ParameterIsNotAnInteger = 11, TVCMI_ApiError_UnknownValueUnit = 12, TVCMI_ApiError_UnknownMetricType = 13, TVCMI_ApiError_ValueUnitOrValueTypeHasToBeProvided = 14, TVCMI_ApiError_UnknownSensorId = 15, TVCMI_ApiError_UnknownMetricId = 16, TVCMI_ApiError_NoMetricsUpdated = 17, TVCMI_ApiError_ForbiddendAccess = 18, TVCMI_ApiError_OutOfRange = 19, TVCMI_ApiError_CertificateFormatError = 20, TVCMI_ApiError_CertificateIsEmptyError = 21, TVCMI_ApiError_CertificateWithoutCommonName = 22, TVCMI_ApiError_DeleteMetricsFailed = 23, TVCMI_ApiError_ChangeMetricsFailed = 24, TVCMI_ApiError_InvalidClientName = 25, TVCMI_ApiError_CreateMetricsFailed = 26, TVCMI_ApiError_PushValuesFailed = 27 } |
| Gateway errors. | |
| enum | TVCMI_ErrorTag { TVCMI_Error_Unknown = -1, TVCMI_Error_Success = 0, TVCMI_Error_WrongApiVersion = 1, TVCMI_Error_WrongConfigName = 2, TVCMI_Error_ConfigReadFailed = 3, TVCMI_Error_WrongConfigParams = 4, TVCMI_Error_NoMemory = 5, TVCMI_Error_InvalidArguments = 6, TVCMI_Error_NoResource = 7, TVCMI_Error_ConnectionFailed = 8, TVCMI_Error_WrongProtocol = 9, TVCMI_Error_WrongIdentifier = 10, TVCMI_Error_ServerUnavailable = 11, TVCMI_Error_UnexpectedDisconnect = 12, TVCMI_Error_NoConnectionToServer = 13, TVCMI_Error_PayloadSize = 14, TVCMI_Error_WrongReply = 15, TVCMI_Error_Busy = 16, TVCMI_Error_CreateCertificate = 17, TVCMI_Error_CreateProvisionCertificate = 18, TVCMI_Error_CreatePrivateKey = 19, TVCMI_Error_GetClientId = 20, TVCMI_Error_TlsSetFailed = 21, TVCMI_Error_ClientProvision = 22, TVCMI_Error_ModifySensor = 23, TVCMI_Error_DeleteSensor = 24, TVCMI_Error_DeleteMetrics = 25, TVCMI_Error_RemoveCertificates = 26, TVCMI_Error_TlsConnection = 27, TVCMI_Error_Errno = 28, TVCMI_Error_ComposeJson = 29, TVCMI_Error_NoThreadSupport = 30, TVCMI_Error_ReadCertificateCN = 31, TVCMI_Error_CertificateRequestPath = 32, TVCMI_Error_CertifcateFolderPath = 33, TVCMI_Error_AlreadyProvisioned = 34, TVCMI_Error_WritingToCertificateFile = 35, TVCMI_Error_WrongCertificateFile = 36, TVCMI_Error_ThreadCreate = 37, TVCMI_Error_NoBackendConnection = 38, TVCMI_Error_CertificateRequest = 39 } |
| Error values. | |
| enum | TVCMI_ValueUnitTag { TVCMI_ValueUnit_NoUnit, TVCMI_ValueUnit_SIAmpere, TVCMI_ValueUnit_SIBit, TVCMI_ValueUnit_SICandela, TVCMI_ValueUnit_SICelsius, TVCMI_ValueUnit_SIFarad, TVCMI_ValueUnit_SIKilogram, TVCMI_ValueUnit_SIHertz, TVCMI_ValueUnit_SIJoule, TVCMI_ValueUnit_SIMeter, TVCMI_ValueUnit_SIMetersPerSecond, TVCMI_ValueUnit_SIMetersPerSquareSecond, TVCMI_ValueUnit_SIMole, TVCMI_ValueUnit_SINewtone, TVCMI_ValueUnit_SIOhm, TVCMI_ValueUnit_SIPascal, TVCMI_ValueUnit_SIRadian, TVCMI_ValueUnit_SISecond, TVCMI_ValueUnit_SISquareMeter, TVCMI_ValueUnit_SIVolt, TVCMI_ValueUnit_SIWatt, TVCMI_ValueUnit_NoSIDecibel, TVCMI_ValueUnit_NoSIPercent } |
| Metric value units. | |
| enum | TVCMI_ValueTypeTag { TVCMI_ValueType_NoType, TVCMI_ValueType_Integer, TVCMI_ValueType_Double, TVCMI_ValueType_Bool, TVCMI_ValueType_String } |
| Metric value types. | |
| enum | TVCMI_SensorTypeTag { TVCMI_SensorType_None, TVCMI_SensorType_Standard, TVCMI_SensorType_Plugin } |
| Sensor types. | |
Functions | |
| IOTTVCMI_API TVCMI_Error | TVCMI_LibInit () |
| Initializes the library. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_LibCleanup () |
| Call TVCMI_LibCleanup to free resources associated with the library. More... | |
| IOTTVCMI_API TVCMI_Client * | TVCMI_NewClient (const char *confFile, void *callbackParameter, TVCMI_Error *err) |
| Create a client object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeleteClient (TVCMI_Client *client) |
| Use to free the memory associated with a TVCMI_Client instance. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ProvisionClient (TVCMI_Client *client) |
| Provision the client. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_Connect (TVCMI_Client *client) |
| Connect to the TeamViewer IOT Agent. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_Disconnect (TVCMI_Client *client) |
| Disconnect from the TeamViewer IOT Agent. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CreateSensor (TVCMI_Client *client, const char *name) |
| Create sensor by name. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_UpdateSensor (TVCMI_Client *client, const char *sensorId, const char *sensorName) |
| Update sensor meta data. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeleteSensor (TVCMI_Client *client, const char *sensorId) |
| Delete sensor. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CreateMetrics (TVCMI_Client *client, const char *sensorId, TVCMI_MetricSchemaContainer *container) |
| Create metrics of a sensor. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_UpdateMetrics (TVCMI_Client *client, const char *sensorId, TVCMI_MetricSchemaContainer *container) |
| Update metrics. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_PushMetricValues (TVCMI_Client *client, const char *sensorId, TVCMI_MetricValueContainer *container) |
| Send values of metrics of a client to the TeamViewer IOT Agent. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeleteMetrics (TVCMI_Client *client, const char *sensorId, char **metricIds, int metricsCount) |
| Delete metrics. More... | |
| IOTTVCMI_API TVCMI_MetricSchemaContainer * | TVCMI_CreateMetricSchemaContainer () |
| Create a TVCMI_MetricSchemaContainer object and returns it's pointer. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DestroyMetricSchemaContainer (TVCMI_MetricSchemaContainer *container) |
| Destroy container object created by function TVCMI_CreateMetricSchemaContainer(). More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddStandardMetricSchema (TVCMI_MetricSchemaContainer *container, const char *matchingId, const char *name, TVCMI_ValueUnit valueUnit) |
| Add a metric with standard ValueUnit type of value unit. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddCustomMetricSchema (TVCMI_MetricSchemaContainer *container, const char *matchingId, const char *name, TVCMI_ValueType valueType, const char *valueAnnotation) |
| Add a metric with custom type of value unit. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddMetricUpdateSchema (TVCMI_MetricSchemaContainer *container, const char *metricId, const char *name, const char *valueAnnotation) |
| Add metrics to change name and/or valueAnnotation. More... | |
| IOTTVCMI_API TVCMI_MetricValueContainer * | TVCMI_CreateMetricValueContainer () |
| Create a TVCMI_MetricValueContainer object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DestroyMetricValueContainer (TVCMI_MetricValueContainer *container) |
| Destroy container object created by function TVCMI_CreateMetricValueContainer(). More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddIntegerMetricValue (TVCMI_MetricValueContainer *container, int64_t value, const char *metricId) |
| Add a value of type int64_t to the container object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddBoolMetricValue (TVCMI_MetricValueContainer *container, int value, const char *metricId) |
| Add a value of boolean type to the container object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddDoubleMetricValue (TVCMI_MetricValueContainer *container, double value, const char *metricId) |
| Add a value of type double to the container object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddStringMetricValue (TVCMI_MetricValueContainer *container, const char *value, const char *metricId) |
| Add a value of type string to the container object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_AddEpochTimeStamp (TVCMI_MetricValueContainer *container, uint64_t epochTimestamp) |
| Add a timestamp to the container object. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ListSensors (TVCMI_Client *client) |
| Get information about sensors, including its metrics. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DescribeMetric (TVCMI_Client *client, const char *sensorId, const char *metricId) |
| Get information about certain metric. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ReportClientError (TVCMI_Client *client, int error, const char *errMessage) |
| Send error message about a client. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ReportSensorError (TVCMI_Client *client, const char *sensorId, int error, const char *errMessage) |
| Send error message about a sensor. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ReportMetricError (TVCMI_Client *client, const char *sensorId, const char *metricId, int error, const char *errMessage) |
| Send error message about a metric. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ProvisionClientCallbackSet (TVCMI_Client *client, void(*TVCMI_OnProvisionClient)(TVCMI_Client *client, void *callbackParameter, TVCMI_Error err)) |
| Set TVCMI_OnProvisionClient callback to get an event about client being provisioned. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ConnectCallbackSet (TVCMI_Client *client, void(*TVCMI_OnConnect)(TVCMI_Client *client, void *callbackParameter, TVCMI_Error err)) |
| Set TVCMI_OnConnect callback to get an event about client being connected. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DisconnectCallbackSet (TVCMI_Client *client, void(*TVCMI_OnDisconnect)(TVCMI_Client *client, void *callbackParameter, TVCMI_Error err)) |
| Set TVCMI_OnDisconnect callback to get an event about client being disconnected. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CreateSensorCallbackSet (TVCMI_Client *client, void(*TVCMI_OnCreateSensor)(TVCMI_Client *client, void *callbackParameter, const char *sensorName, const char *sensorId, TVCMI_ApiError err)) |
| Set TVCMI_OnCreateSensor callback to get a response about sensor creation. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_UpdateSensorCallbackSet (TVCMI_Client *client, void(*TVCMI_OnUpdateSensor)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err)) |
| Set TVCMI_OnUpdateSensor callback to get a response about sensor meta data change. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeleteSensorCallbackSet (TVCMI_Client *client, void(*TVCMI_OnDeleteSensor)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err)) |
| Set TVCMI_OnDeleteSensor callback to get a response about sensor deletion. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CreateMetricsCallbackSet (TVCMI_Client *client, void(*TVCMI_OnCreateMetrics)(TVCMI_Client *client, void *callbackParameter, TVCMI_CreatedMetrics *createdMetrics, TVCMI_ApiError err)) |
| Set TVCMI_OnCreateMetrics callback to get a response about metrics creation. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_UpdateMetricsCallbackSet (TVCMI_Client *client, void(*TVCMI_OnUpdateMetrics)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err)) |
| Set TVCMI_OnUpdateMetrics callback to get a response about metrics update. More... | |
| IOTTVCMI_API void | TVCMI_DestroyCreatedMetrics (TVCMI_CreatedMetrics *createdMetrics) |
| Destroy created metrics returned by callback function TVCMI_OnCraeteMetrics(). More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeleteMetricsCallbackSet (TVCMI_Client *client, void(*TVCMI_OnDeleteMetrics)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err)) |
| Set TVCMI_OnDeleteMetrics callback to get errors about metrics deletion. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_PushMetricValuesCallbackSet (TVCMI_Client *client, void(*TVCMI_OnPushMetricValues)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err)) |
| Set TVCMI_OnPushMetricValues callback to get errors about metrics values update. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_ListSensorsCallbackSet (TVCMI_Client *client, void(*TVCMI_OnListSensors)(TVCMI_Client *client, TVCMI_SensorsInfo *sensorsInfo, void *callbackParameter, TVCMI_ApiError err)) |
| Set TVCMI_OnListSensors callback to get a response about the sensors. More... | |
| IOTTVCMI_API void | TVCMI_DestroySensorsInfo (TVCMI_SensorsInfo *sensorsInfo) |
| Destroy sensorsInfo returned by callback function TVCMI_OnListSensors(). More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DescribeMetricCallbackSet (TVCMI_Client *client, void(*TVCMI_OnDescribeMetric)(TVCMI_Client *client, const char *sensorId, TVCMI_MetricMetadata *metricMetadata, void *callbackParameter, TVCMI_ApiError err)) |
| Set TVCMI_OnDescribeMetric callback to receive a response about the metric. More... | |
| IOTTVCMI_API void | TVCMI_DestroyMetricMetadata (TVCMI_MetricMetadata *metricMetadata) |
| Destroy metricMetadata returned by callback function TVCMI_OnGetMetric(). More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_LogCallbackSet (TVCMI_Client *client, void(*TVCMI_OnLog)(TVCMI_Client *client, const char *logMessage, void *callbackParameter)) |
| Set TVCMI_OnLog callback to get library's internal info and error messages. More... | |
| const IOTTVCMI_API char * | TVCMI_GetClientId (TVCMI_Client *client) |
| Return the client id. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CheckConnection (TVCMI_Client *client) |
| Check if the connection with TeamViewer IoT Agent is alive. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CheckConnectionCallbackSet (TVCMI_Client *client, void(*TVCMI_OnCheckConnection)(TVCMI_Client *client, void *callbackParameter, TVCMI_ApiError err)) |
| Set TVCMI_OnCheckConnection callback to get a response from the TeamViewer IoT Agent. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_CreateSensorJobCallbackSet (TVCMI_Client *client, void(*TVCMI_OnCreateSensorJob)(TVCMI_Client *client, TVCMI_SensorMetadata *sensorMetadata, void *callbackParameter)) |
| Set TVCMI_OnCreateSensorJob callback to receive sensor create jobs. More... | |
| void | TVCMI_DestroySensorMetadata (TVCMI_SensorMetadata *sensorMetadata) |
| Destroy sensorMetadata returned by callback function TVCMI_OnCreateSensorJob(). More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeleteSensorJobCallbackSet (TVCMI_Client *client, void(*TVCMI_OnDeleteSensorJob)(TVCMI_Client *client, const char *sensorId, void *callbackParameter)) |
| Set TVCMI_OnDeleteSensorJob callback to receive sensor delete jobs. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeprovisionClient (TVCMI_Client *client) |
| Delete the access to this client. More... | |
| IOTTVCMI_API TVCMI_Error | TVCMI_DeprovisionClientCallbackSet (TVCMI_Client *client, void(*TVCMI_OnDeprovisionClient)(TVCMI_Client *client, void *callbackParameter)) |
| Set TVCMI_OnDeprovisionClient callback to know that the Deprovision is done. More... | |
tvcmiclient - client library for the TeamViewer IOT Agent API version 1.0
Usage hints
Call TVCMI_LibInit() function before using any other functions of this library.
All callback functions should be set once. Otherwise they will be replaced and that will not be thread safe.
| IOTTVCMI_API TVCMI_Error TVCMI_AddBoolMetricValue | ( | TVCMI_MetricValueContainer * | container, |
| int | value, | ||
| const char * | metricId | ||
| ) |
Add a value of boolean type to the container object.
| container | A valid TVCMI_MetricValueContainer object. |
| value | A value of boolean type. It can be 0 or 1. |
| metricId | Metric ID. |
| IOTTVCMI_API TVCMI_Error TVCMI_AddCustomMetricSchema | ( | TVCMI_MetricSchemaContainer * | container, |
| const char * | matchingId, | ||
| const char * | name, | ||
| TVCMI_ValueType | valueType, | ||
| const char * | valueAnnotation | ||
| ) |
Add a metric with custom type of value unit.
| container | A valid TVCMI_MetricValueContainer pointer. |
| matchingId | An ID which is unique in sensor and can be used to match metric IDs after registration. |
| name | Metric name. |
| valueType | Custom value type of metric. |
| valueAnnotation | Custom measurement unit ("kg", "Mhz", "Km", "", ...). |
| IOTTVCMI_API TVCMI_Error TVCMI_AddDoubleMetricValue | ( | TVCMI_MetricValueContainer * | container, |
| double | value, | ||
| const char * | metricId | ||
| ) |
Add a value of type double to the container object.
| container | A valid TVCMI_MetricValueContainer object. |
| value | A value of type double. |
| metricId | Metric ID. |
| IOTTVCMI_API TVCMI_Error TVCMI_AddEpochTimeStamp | ( | TVCMI_MetricValueContainer * | container, |
| uint64_t | epochTimestamp | ||
| ) |
Add a timestamp to the container object.
| container | A valid TVCMI_MetricValueContainer object. |
| epochTimestamp | The timestamp has to be a UNIX Epoch timestamp. Time since 1.1.1970. |
| IOTTVCMI_API TVCMI_Error TVCMI_AddIntegerMetricValue | ( | TVCMI_MetricValueContainer * | container, |
| int64_t | value, | ||
| const char * | metricId | ||
| ) |
Add a value of type int64_t to the container object.
| container | A valid TVCMI_MetricValueContainer object. |
| value | A value of type int64_t. |
| metricId | Metric ID. |
| IOTTVCMI_API TVCMI_Error TVCMI_AddMetricUpdateSchema | ( | TVCMI_MetricSchemaContainer * | container, |
| const char * | metricId, | ||
| const char * | name, | ||
| const char * | valueAnnotation | ||
| ) |
Add metrics to change name and/or valueAnnotation.
| container | A valid TVCMI_MetricValueContainer pointer. |
| metricId | metric ID. |
| name | Metric name. |
| valueAnnotation | Custom measurement unit ("kg", "Mhz", "Km", "", ...). |
| IOTTVCMI_API TVCMI_Error TVCMI_AddStandardMetricSchema | ( | TVCMI_MetricSchemaContainer * | container, |
| const char * | matchingId, | ||
| const char * | name, | ||
| TVCMI_ValueUnit | valueUnit | ||
| ) |
Add a metric with standard ValueUnit type of value unit.
| container | A valid TVCMI_MetricValueContainer pointer. |
| matchingId | This string will be used to identify the metric ID in the response. It has to be unique in the context of this request. |
| name | Metric name. |
| valueUnit | Value unit of metric. |
| IOTTVCMI_API TVCMI_Error TVCMI_AddStringMetricValue | ( | TVCMI_MetricValueContainer * | container, |
| const char * | value, | ||
| const char * | metricId | ||
| ) |
Add a value of type string to the container object.
| container | A valid TVCMI_MetricValueContainer object. |
| value | Null terminated string value. |
| metricId | Metric ID. |
| IOTTVCMI_API TVCMI_Error TVCMI_CheckConnection | ( | TVCMI_Client * | client | ) |
Check if the connection with TeamViewer IoT Agent is alive.
If it works then you will get a response callback set by function TVCMI_CheckConnectionCallbackSet().
| client | - A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_CheckConnectionCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, TVCMI_ApiError err) | TVCMI_OnCheckConnection | ||
| ) |
Set TVCMI_OnCheckConnection callback to get a response from the TeamViewer IoT Agent.
If the connection is alive you will get the response.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnCheckConnection | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of connetor.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_Connect | ( | TVCMI_Client * | client | ) |
Connect to the TeamViewer IOT Agent.
Callback function set by TVCMI_ConnectCallbackSet() will inform about connection done.
| client | A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_ConnectCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, TVCMI_Error err) | TVCMI_OnConnect | ||
| ) |
Set TVCMI_OnConnect callback to get an event about client being connected.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnConnect | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_CreateMetrics | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| TVCMI_MetricSchemaContainer * | container | ||
| ) |
Create metrics of a sensor.
The callback function set by TVCMI_CreateMetricsCallbackSet() will return created metric IDs on success or error code on failure.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| container | A structure containing metric schemas. |
| IOTTVCMI_API TVCMI_Error TVCMI_CreateMetricsCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, TVCMI_CreatedMetrics *createdMetrics, TVCMI_ApiError err) | TVCMI_OnCreateMetrics | ||
| ) |
Set TVCMI_OnCreateMetrics callback to get a response about metrics creation.
createdMetrics must be destroyed by call to function TVCMI_DestroyCreatedMetrics() after usage.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnCreateMetrics | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
createdMetrics - A structure containing information about created
metrics. Created metrics must be destroyed by
function TVCMI_DestroyCreatedMetrics() after usage.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_MetricSchemaContainer* TVCMI_CreateMetricSchemaContainer | ( | ) |
Create a TVCMI_MetricSchemaContainer object and returns it's pointer.
It should be destroyed by function TVCMI_DestroyMetricSchemaContainer().
| IOTTVCMI_API TVCMI_MetricValueContainer* TVCMI_CreateMetricValueContainer | ( | ) |
Create a TVCMI_MetricValueContainer object.
Should be destroyed by function TVCMI_DestroyMetricValueContainer().
| IOTTVCMI_API TVCMI_Error TVCMI_CreateSensor | ( | TVCMI_Client * | client, |
| const char * | name | ||
| ) |
Create sensor by name.
Callback function set by TVCMI_CreteSensorCallbackSet() will return a sensor id.
| client | A valid TVCMI_Client instance. |
| name | Sensor name. |
| IOTTVCMI_API TVCMI_Error TVCMI_CreateSensorCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, const char *sensorName, const char *sensorId, TVCMI_ApiError err) | TVCMI_OnCreateSensor | ||
| ) |
Set TVCMI_OnCreateSensor callback to get a response about sensor creation.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnCreateSensor | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
sensorName - The name of the sensor. It will be destroyed automatically after callback returns.
sensorId - The id of the sensor. It will be destroyed automatically after callback returns.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_CreateSensorJobCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, TVCMI_SensorMetadata *sensorMetadata, void *callbackParameter) | TVCMI_OnCreateSensorJob | ||
| ) |
Set TVCMI_OnCreateSensorJob callback to receive sensor create jobs.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnCreateSensorJob | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
sensorMetadata - A pointer to a structure containing the sensor information.
It must be deleted by call of function
TVCMI_DestroySensorMetadata()
callbackParameter - A pointer provided during creation of the client.
|
| IOTTVCMI_API TVCMI_Error TVCMI_DeleteClient | ( | TVCMI_Client * | client | ) |
Use to free the memory associated with a TVCMI_Client instance.
Do not call this function from the callback functions.
| client | A struct TVCMI_Client pointer to free. |
| IOTTVCMI_API TVCMI_Error TVCMI_DeleteMetrics | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| char ** | metricIds, | ||
| int | metricsCount | ||
| ) |
Delete metrics.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| metricIds | An array of metric IDs. |
| metricsCount | The number of metrics in the metricIds array. |
| IOTTVCMI_API TVCMI_Error TVCMI_DeleteMetricsCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err) | TVCMI_OnDeleteMetrics | ||
| ) |
Set TVCMI_OnDeleteMetrics callback to get errors about metrics deletion.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnDeleteMetrics | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
sensorId - The id of the sensor.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_DeleteSensor | ( | TVCMI_Client * | client, |
| const char * | sensorId | ||
| ) |
Delete sensor.
The callback function set by TVCMI_DeleteSensorCallbackSet() will return success or error information about sensor deletion.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor to delete. |
| IOTTVCMI_API TVCMI_Error TVCMI_DeleteSensorCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err) | TVCMI_OnDeleteSensor | ||
| ) |
Set TVCMI_OnDeleteSensor callback to get a response about sensor deletion.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnDeleteSensor | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
sensorId - The id of the sensor.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_DeleteSensorJobCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, const char *sensorId, void *callbackParameter) | TVCMI_OnDeleteSensorJob | ||
| ) |
Set TVCMI_OnDeleteSensorJob callback to receive sensor delete jobs.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnDeleteSensorJob | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
sensorId - ID of a sensor to delete.
callbackParameter - A pointer provided during creation of the client.
|
| IOTTVCMI_API TVCMI_Error TVCMI_DeprovisionClient | ( | TVCMI_Client * | client | ) |
Delete the access to this client.
The callback function set by TVCMI_DeprovisionClientCallbackSet() will confirm that deprovisioning is done.
| client | A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_DeprovisionClientCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter) | TVCMI_OnDeprovisionClient | ||
| ) |
Set TVCMI_OnDeprovisionClient callback to know that the Deprovision is done.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnDeprovisionClient | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of client.
|
| IOTTVCMI_API TVCMI_Error TVCMI_DescribeMetric | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| const char * | metricId | ||
| ) |
Get information about certain metric.
The callback set by TVCMI_DescribeMetricCallbackSet() will return the information about the metric.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| metricId | ID of a metric. |
| IOTTVCMI_API TVCMI_Error TVCMI_DescribeMetricCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, const char *sensorId, TVCMI_MetricMetadata *metricMetadata, void *callbackParameter, TVCMI_ApiError err) | TVCMI_OnDescribeMetric | ||
| ) |
Set TVCMI_OnDescribeMetric callback to receive a response about the metric.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnDescribeMetric | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
sensorId - ID of a sensor to which the metric belongs to.
inventory - A pointer to a structure containing inventory information.
It must be deleted by call of function
TVCMI_DestroyMetricInventory()
callbackParameter - A pointer provided during creation of the client.
err - Returned error code.
|
| IOTTVCMI_API void TVCMI_DestroyCreatedMetrics | ( | TVCMI_CreatedMetrics * | createdMetrics | ) |
Destroy created metrics returned by callback function TVCMI_OnCraeteMetrics().
| createdMetrics | A pointer to structure containing created metrics. |
| IOTTVCMI_API void TVCMI_DestroyMetricMetadata | ( | TVCMI_MetricMetadata * | metricMetadata | ) |
Destroy metricMetadata returned by callback function TVCMI_OnGetMetric().
| metricMetadata | - A structure containing inventory information. |
| IOTTVCMI_API TVCMI_Error TVCMI_DestroyMetricSchemaContainer | ( | TVCMI_MetricSchemaContainer * | container | ) |
Destroy container object created by function TVCMI_CreateMetricSchemaContainer().
| container | A valid TVCMI_MetricSchemaContainer pointer to destroy. |
| IOTTVCMI_API TVCMI_Error TVCMI_DestroyMetricValueContainer | ( | TVCMI_MetricValueContainer * | container | ) |
Destroy container object created by function TVCMI_CreateMetricValueContainer().
| container | A valid TVCMI_MetricValueContainer pointer to destroy. |
| void TVCMI_DestroySensorMetadata | ( | TVCMI_SensorMetadata * | sensorMetadata | ) |
Destroy sensorMetadata returned by callback function TVCMI_OnCreateSensorJob().
| sensorMetadata | A structure containing sensor information. |
| IOTTVCMI_API void TVCMI_DestroySensorsInfo | ( | TVCMI_SensorsInfo * | sensorsInfo | ) |
Destroy sensorsInfo returned by callback function TVCMI_OnListSensors().
| sensorsInfo | - A structure containing sensors information. |
| IOTTVCMI_API TVCMI_Error TVCMI_Disconnect | ( | TVCMI_Client * | client | ) |
Disconnect from the TeamViewer IOT Agent.
Callback function set by TVCMI_DisconnectCallbackSet() will inform about connection drop.
| client | A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_DisconnectCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, TVCMI_Error err) | TVCMI_OnDisconnect | ||
| ) |
Set TVCMI_OnDisconnect callback to get an event about client being disconnected.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnDisconnect | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
err - Returned error code.
|
| const IOTTVCMI_API char* TVCMI_GetClientId | ( | TVCMI_Client * | client | ) |
Return the client id.
| client | A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_LibCleanup | ( | ) |
Call TVCMI_LibCleanup to free resources associated with the library.
This function is not thread safe.
| IOTTVCMI_API TVCMI_Error TVCMI_LibInit | ( | ) |
Initializes the library.
It must be called before any other API functions. This have to be called only once in the beginning. This function is not thread safe.
| IOTTVCMI_API TVCMI_Error TVCMI_ListSensors | ( | TVCMI_Client * | client | ) |
Get information about sensors, including its metrics.
The Callback set by TVCMI_ListSensorsCallbackSet() will return the information about sensors.
| client | A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_ListSensorsCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, TVCMI_SensorsInfo *sensorsInfo, void *callbackParameter, TVCMI_ApiError err) | TVCMI_OnListSensors | ||
| ) |
Set TVCMI_OnListSensors callback to get a response about the sensors.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnListSensors | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
sensorsInfo - A pointer to a structure containing information about sensors.
The pointer must be freed by function
TVCMI_DestroySensorsInfo() after usage.
callbackParameter - A pointer provided during creation of the client.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_LogCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, const char *logMessage, void *callbackParameter) | TVCMI_OnLog | ||
| ) |
Set TVCMI_OnLog callback to get library's internal info and error messages.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnLog | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
logMessage - The message text.
callbackParameter - A pointer provided during creation of the client.
|
| IOTTVCMI_API TVCMI_Client* TVCMI_NewClient | ( | const char * | confFile, |
| void * | callbackParameter, | ||
| TVCMI_Error * | err | ||
| ) |
Create a client object.
It must be deleted by TVCMI_DeleteClient() after usage.
| confFile | A file path which will contain all the API protocol specific configuration data. A possible content of that file is described in the following section:
|
| callbackParameter | A pointer that will be passed as an argument to any callbacks function. |
| err | Returned error code. |
| IOTTVCMI_API TVCMI_Error TVCMI_ProvisionClient | ( | TVCMI_Client * | client | ) |
Provision the client.
It will provision the client, if it is not provisioned yet. The callback function set by TVCMI_ProvisionClientCallbackSet will inform about the client provisioning on success or will return an error code in case of failure.
| client | A valid TVCMI_Client instance. |
| IOTTVCMI_API TVCMI_Error TVCMI_ProvisionClientCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, TVCMI_Error err) | TVCMI_OnProvisionClient | ||
| ) |
Set TVCMI_OnProvisionClient callback to get an event about client being provisioned.
Do not make any other SDK function calls in this callback function.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnProvisionClient | A callback function. Callback Parameters:
client - A valid TVCMI_Client instance.
callbackParameter - A pointer provided during creation of the client.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_PushMetricValues | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| TVCMI_MetricValueContainer * | container | ||
| ) |
Send values of metrics of a client to the TeamViewer IOT Agent.
If the sensor or metrics were not registered, then they will be registered before pushing values. The callback function set by TVCMI_PushMetricValuesCallbackSet() will return error codes in case of failure.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor |
| container | A pointer to a structure containing metric values. |
| IOTTVCMI_API TVCMI_Error TVCMI_PushMetricValuesCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err) | TVCMI_OnPushMetricValues | ||
| ) |
Set TVCMI_OnPushMetricValues callback to get errors about metrics values update.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnPushMetricValues | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
sensorId - The id of the sensor.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_ReportClientError | ( | TVCMI_Client * | client, |
| int | error, | ||
| const char * | errMessage | ||
| ) |
Send error message about a client.
| client | A valid TVCMI_Client instance. |
| error | Error code. |
| errMessage | Error message text. |
| IOTTVCMI_API TVCMI_Error TVCMI_ReportMetricError | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| const char * | metricId, | ||
| int | error, | ||
| const char * | errMessage | ||
| ) |
Send error message about a metric.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| metricId | ID of a metric. |
| error | Error code. |
| errMessage | error Message text. |
| IOTTVCMI_API TVCMI_Error TVCMI_ReportSensorError | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| int | error, | ||
| const char * | errMessage | ||
| ) |
Send error message about a sensor.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| error | Error code. |
| errMessage | Error message text. |
| IOTTVCMI_API TVCMI_Error TVCMI_UpdateMetrics | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| TVCMI_MetricSchemaContainer * | container | ||
| ) |
Update metrics.
The callback function set by TVCMI_UpdateMetricsCallbackSet() will return success or error information about metrics update.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| container | A structure containing metric schemas. |
| IOTTVCMI_API TVCMI_Error TVCMI_UpdateMetricsCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err) | TVCMI_OnUpdateMetrics | ||
| ) |
Set TVCMI_OnUpdateMetrics callback to get a response about metrics update.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnUpdateMetrics | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
sensorId - The id of the sensor.
err - Returned error code.
|
| IOTTVCMI_API TVCMI_Error TVCMI_UpdateSensor | ( | TVCMI_Client * | client, |
| const char * | sensorId, | ||
| const char * | sensorName | ||
| ) |
Update sensor meta data.
The callback function set by TVCMI_UpdateSensorCallbackSet() will return success or error information about sensor meta data change.
| client | A valid TVCMI_Client instance. |
| sensorId | ID of a sensor. |
| sensorName | Sensor name. If NULL, it will not be changed. |
| IOTTVCMI_API TVCMI_Error TVCMI_UpdateSensorCallbackSet | ( | TVCMI_Client * | client, |
| void(*)(TVCMI_Client *client, void *callbackParameter, const char *sensorId, TVCMI_ApiError err) | TVCMI_OnUpdateSensor | ||
| ) |
Set TVCMI_OnUpdateSensor callback to get a response about sensor meta data change.
| client | A valid TVCMI_Client instance. |
| TVCMI_OnUpdateSensor | A callback function. Callback Parameters:
client - The TVCMI_Client instance making the callback.
callbackParameter - A pointer provided during creation of the client.
sensorId - The id of the sensor.
err - Returned error code.
|
1.8.17