Sending Numeric Data to Device Cloud in C
A client application can send numeric data, such as readings from a sensor, to Device Cloud using the telemetry APIs.
Numeric data (telemetry) appears as properties on the thing details page. Click the property name to see the values published from the application in graph and table format. For more information about viewing properties, see Device Cloud Management Portal User's Guide: Viewing the Properties of a Thing.
The function parameters max_time_out and txn are for future use.
You must have previously initialized your application (see Initializing Your C Application).
The thing definition that corresponds to your application must have the telemetry object defined as a property, or the thing definition must have Auto def properties selected. For more information about defining properties, see Device Cloud Management Portal User's Guide: Defining Properties.
To send data to Device Cloud, the application must be connected to Device Cloud.
Examples
The iot-app-simple-telemetry sample application provided with the agent shows example code for sending numeric data to Device Cloud.
If you do not need the object after you send the data, call the iot_telemetry_deregister, iot_telemetry_free functions to free the memory allocated for the object.