1.1.11.2 WDRV_WINC_MQTTSubscribe

Function

WDRV_WINC_STATUS WDRV_WINC_MQTTSubscribe
(
DRV_HANDLE handle,
WDRV_WINC_MQTT_QOS_TYPE qos,
const char *pTopicName,
WDRV_WINC_MQTT_SUBSCRIBE_CALLBACK pfSubscribeCb,
uintptr_t subscribeCbCtx
)

Summary

Subscribe to an MQTT topic.

Description

Sends a subscription request to the MQTT broker.

Precondition

WDRV_WINC_Initialize should have been called. WDRV_WINC_Open should have been called to obtain a valid handle. WDRV_WINC_MQTTConnect should have been called to connect to a broker.

Parameters

handle - Client handle obtained by a call to WDRV_WINC_Open.

qos - Quality of service required.

pTopicName - Pointer to topic name to subscribe to.

pfSubscribeCb - Pointer to subscription callback.

subscribeCbCtx - User context to pass to callback when called.

Returns

WDRV_WINC_STATUS_OK - A scan was initiated.

WDRV_WINC_STATUS_NOT_OPEN - The driver instance is not open.

WDRV_WINC_STATUS_REQUEST_ERROR - The request to the WINC was rejected.

WDRV_WINC_STATUS_INVALID_ARG - The parameters were incorrect.

Remarks

None.