Sending Events to Device Cloud in C
A client application on the device can use the event APIs to send log messages to Device Cloud.
Logs appear under the Events tab on the thing details page. By default, only connect and disconnect events are logged for a thing.
In the options parameter of the API, you can specify additional, optional information about the event, including the following:
-
maximum time to wait for the publish operation to complete
-
timestamp of the event
-
log level
The function parameter txn is for future use.
You must have initialized your application (see Initializing Your C Application).
To send events to Device Cloud, your application must be connected to Device Cloud.
When you no longer need to send the event, call the iot_options_free function, if applicable, to free the associated memory.