Sebastián Pastor / EtheriosCloudConnector
Embed: (wiki syntax)

« Back to documentation index

Run routine

Run routine

Include: connector_api.h More...

Functions

connector_status_t connector_run (connector_handle_t const handle)
 Runs Cloud Connector as a blocking call.

Detailed Description

Include: connector_api.h


Function Documentation

connector_status_t connector_run ( connector_handle_t const   handle )

Runs Cloud Connector as a blocking call.

This blocking function is typically used in a separate thread (in a multi-threaded environment) to run Cloud Connector after it's been successfully initialized with an connector_init() call. This function only returns when Cloud Connector encounters an unexpected error. This function is similar to connector_step() except this is the blocking variant.

See Cloud Connector Threading Model section for more information on the differences between connector_run() and connector_step().

Parameters:
[in]handleHandle returned from connector_init() call.
Return values:
connector_init_errorCloud Connector was not properly initialized. The application requires a call to connector_init() prior to calling this function.
connector_abortCloud Connector was aborted by callback function.
connector_invalid_data_sizeAn application callback returned an invalid response_length. This is an application callback defect and should be corrected. To locate the faulty callback, enable CONNECTOR_DEBUG. For more information on debugging, see the section on how to implement debug support.
connector_invalid_data_rangeAn application callback returned invalid response_data. This is an application callback defect and should be corrected. To locate the faulty callback, enable CONNECTOR_DEBUG. For more information on debugging, see the section on how to implement debug support.
connector_keepalive_errorCloud Connector did not receive keep alive messages. Device Cloud may be offline.
connector_bad_versionDevice Cloud rejected version number.
connector_exceed_timeoutCallback exceeded timeout value before it returned.
connector_unsupported_securityCloud Connector received a packet with unsupported security.
connector_invalid_dataAn application callback returned unexpected NULL response_data. This is an application callback defect and should be corrected. To locate the faulty callback, enable CONNECTOR_DEBUG. For more information on debugging, see the section on how to implement debug support.
connector_device_errorClose Callback returns error. If connector_step or connector_run is called again, it will re-establish the connection.
connector_device_terminatedCloud Connector was terminated by user via connector_initiate_action call.

Example Usage:

     connector_status_t status;
     connector_handle_t connector_handle = connector_init(application_callback);

     status = connector_run(connector_handle);
See also:
connector_init()
Cloud Connector Handle
connector_status_t
connector_step()

Definition at line 556 of file connector_api.c.