Skip to main content

pamoja_mqtt_client_new

Function pamoja_mqtt_client_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mqtt_client_new( config: *const PamojaMqttConfig, ) -> *mut PamojaMqttClient
Expand description

Creates a disconnected MQTT client from the given settings.

§Returns

A heap-allocated client handle the caller owns and must release with pamoja_mqtt_client_free, or null on failure with the reason available from pamoja_last_error_message.

§Safety

config must point to a valid PamojaMqttConfig whose client_id and host are valid null-terminated UTF-8 strings for the duration of the call.