Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Open an a new HTTP connection and connect to the remote HTTP serverMQTT Client connection.

Files

httpmqtt-c.h/httpmqtt-c.c

Prototype

Arguments

p_conn_obj

Pointer to the HTTPc Connection Object for which MQTTc Connection object to open the socket.

p_buf

Pointer to the HTTP buffer that will be used to transmit and receive data.

buf_len

Length of the HTTP buffer.

p_hostname_str

Pointer to the hostname (or IP address) string.

hostname_str_len

Length of the hostname (or IP address) string.

flags

Configuration flags:

...

flags

Configuration flags, reserved for future usage.

p_err

Pointer to variable that will receive the return error code from this function:HTTPc

MQTTc_ERR_NONE

...

MQTTc_ERR_NULL_PTR

...

Returned Values

None.

Required Configuration

None.

Notes / Warnings

  • This function MUST be called after the µCHTTPµC/MQTT-client Suite Initialization has been completed.
    If the µC/HTTP-client Asynchronous Task is enabled (HTTPc_CFG_MODE_ASYNC_TASK_EN macro in http-c_cfg.h), the HTTPc Connection Object will be added to the connection open's queue.  
    If the HTTPc_FLAG_CONN_NO_BLOCK flag is set, the function will be in non-blocking mode. Therefore, the function could return before the connection opening is finished. For the application to be notified when the opening process completes, the callback function must have been setup before with the parameter type HTTPc_PARAM_TYPE_CONN_CONNECT_CALLBACK.