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

« Back to documentation index

Step Routine

Step Routine

Include: connector_api.h More...

Functions

connector_status_t connector_step (connector_handle_t const handle)
 Executes a small portion of Cloud Connector in a non-blocking call.

Detailed Description

Include: connector_api.h


Function Documentation

connector_status_t connector_step ( connector_handle_t const   handle )

Executes a small portion of Cloud Connector in a non-blocking call.

This non-blocking function is used to execute a portion Cloud Connector after it's been successfully initialized with an connector_init() call. This function performs a sequence of operations or events and then returns. This allows applications to perform other tasks, especially in non-threading environment. For more information on the differences between connector_run() and connector_step() see the Cloud Connector threading model.

This function is similar to connector_run() except this is the non-blocking variant. This function would normally be made from system control loop or state machine. This function must be repeatedly made to maintain Cloud Connector state.

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
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_invalid_payload_packetCloud Connector received invalid payload message.
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_terminatedCloud Connector was terminated by user via connector_initiate_action() call.
connector_idleCloud Connector is idling. Cloud Connector has no message to process and relinquishes other task execution.
connector_workingCloud Connector is processing a message and should be called at the earliest possible time.
connector_pendingCloud Connector is busy or waiting to process a message and relinquishes other task execution
connector_activeCloud Connector is busy or waiting to process a message and should be called at the earliest possible time

Example Usage:

     connector_status_t status;
     connector_handle_t connector_handle = connector_init(application_callback);

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

Definition at line 443 of file connector_api.c.