MQTTc_ConnSetParam

Set parameters related to the TCP and MQTT Client Connection.

Files

mqtt-c.h/mqtt-c.c

Prototype

void  MQTTc_ConnSetParam (MQTTc_CONN        *p_conn,
                          MQTTc_PARAM_TYPE   type,
                          void              *p_param,
                          MQTTc_ERR         *p_err);

Arguments

p_conn

Pointer to the current MQTTc Connection.

type

Parameter type:

MQTTc_PARAM_TYPE_BROKER_IP_ADDR                 Broker's IP addr.

MQTTc_PARAM_TYPE_BROKER_NAME                    Broker's name.

MQTTc_PARAM_TYPE_BROKER_PORT_NBR                Broker's port nbr.

MQTTc_PARAM_TYPE_INACTIVITY_TIMEOUT_S           Inactivity timeout, in seconds.

MQTTc_PARAM_TYPE_CLIENT_ID_STR                  Client ID str.

MQTTc_PARAM_TYPE_USERNAME_STR                   Client username str.

MQTTc_PARAM_TYPE_PASSWORD_STR                   Client password str.

MQTTc_PARAM_TYPE_KEEP_ALIVE_TMR_SEC             Keep alive tmr, in seconds.

MQTTc_PARAM_TYPE_WILL_CFG_PTR                   Will cfg ptr, if any.

MQTTc_PARAM_TYPE_CALLBACK_ON_COMPL              Generic on     cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_CONNECT_CMPL       On connect     cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_PUBLISH_CMPL       On publish     cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_SUBSCRIBE_CMPL     On subscribe   cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_UNSUBSCRIBE_CMPL   On unsubscribe cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_PINGREQ_CMPL       On pingreq     cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_DISCONNECT_CMPL    On disconnect  cmpl callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_ERR_CALLBACK       On err              callback.

MQTTc_PARAM_TYPE_CALLBACK_ON_PUBLISH_RX         On publish rx'd callback.

MQTTc_PARAM_TYPE_CALLBACK_ARG_PTR               Ptr on arg passed to callback.

MQTTc_PARAM_TYPE_TIMEOUT_MS                     'Open' timeout, in milliseconds.

MQTTc_PARAM_TYPE_PUBLISH_RX_MSG_PTR             Ptr on msg that is used to rx publish.

p_param

Parameter's value.

p_err

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

MQTTc_ERR_NONE

MQTTc_ERR_NULL_PTR

MQTTc_ERR_INVALID_ARG

Returned Values

None.

Required Configuration

None.

Notes / Warnings

  • This function MUST be called after the µC/MQTT-client Suite Initialization has been completed.