[][src]Function paho_mqtt_sys::MQTTAsync_setCallbacks

pub unsafe extern "C" fn MQTTAsync_setCallbacks(
    handle: MQTTAsync,
    context: *mut c_void,
    cl: MQTTAsync_connectionLost,
    ma: MQTTAsync_messageArrived,
    dc: MQTTAsync_deliveryComplete
) -> c_int

This function sets the global callback functions for a specific client. If your client application doesn't use a particular callback, set the relevant parameter to NULL. Any necessary message acknowledgements and status communications are handled in the background without any intervention from the client application. If you do not set a messageArrived callback function, you will not be notified of the receipt of any messages as a result of a subscription.

Note: The MQTT client must be disconnected when this function is called. @param handle A valid client handle from a successful call to MQTTAsync_create(). @param context A pointer to any application-specific context. The the context pointer is passed to each of the callback functions to provide access to the context information in the callback. @param cl A pointer to an MQTTAsync_connectionLost() callback function. You can set this to NULL if your application doesn't handle disconnections. @param ma A pointer to an MQTTAsync_messageArrived() callback function. If this callback is not set, an error will be returned. You must set this callback because otherwise there would be no way to deliver any incoming messages. @param dc A pointer to an MQTTAsync_deliveryComplete() callback function. You can set this to NULL if you do not want to check for successful delivery. @return ::MQTTASYNC_SUCCESS if the callbacks were correctly set, ::MQTTASYNC_FAILURE if an error occurred.