void myqtt_ctx_set_on_subscribe ( MyQttCtx ctx,
MyQttOnSubscribeHandler  on_subscribe,
axlPointer  on_subscribe_data 
)

Allows to configure a handler that will be called every time a subscription request is received.

The function must return the QoS that will accept or even return MYQTT_QOS_DENIED to reject the subscription.

Only one handler can be configured at time.

Parameters
ctxThe context where the operation takes place.
on_subscribeThe handler to be called when a subscription is received. See MyQttOnSubscribeHandler for more information.
on_subscribe_dataA user defined pointer to be passed to the handler configured when it is called.

References myqtt_mutex_lock(), and myqtt_mutex_unlock().