Struct paho_mqtt3as_sys::MQTTAsync_connectOptions
[−]
[src]
#[repr(C)]pub struct MQTTAsync_connectOptions { pub struct_id: [c_char; 4], pub struct_version: c_int, pub keepAliveInterval: c_int, pub cleansession: c_int, pub maxInflight: c_int, pub will: *mut MQTTAsync_willOptions, pub username: *const c_char, pub password: *const c_char, pub connectTimeout: c_int, pub retryInterval: c_int, pub ssl: *mut MQTTAsync_SSLOptions, pub onSuccess: MQTTAsync_onSuccess, pub onFailure: MQTTAsync_onFailure, pub context: *mut c_void, pub serverURIcount: c_int, pub serverURIs: *const *const c_char, pub MQTTVersion: c_int, pub automaticReconnect: c_int, pub minRetryInterval: c_int, pub maxRetryInterval: c_int, pub binarypwd: MQTTAsync_connectOptions__bindgen_ty_1, }
MQTTAsync_connectOptions defines several settings that control the way the client connects to an MQTT server. Default values are set in MQTTAsync_connectOptions_initializer.
Fields
struct_id: [c_char; 4]
The eyecatcher for this structure. must be MQTC.
struct_version: c_int
The version number of this structure. Must be 0, 1, 2, 3 4 or 5. 0 signifies no SSL options and no serverURIs 1 signifies no serverURIs 2 signifies no MQTTVersion 3 signifies no automatic reconnect options 4 signifies no binary password option (just string)
keepAliveInterval: c_int
The "keep alive" interval, measured in seconds, defines the maximum time that should pass without communication between the client and the server The client will ensure that at least one message travels across the network within each keep alive period. In the absence of a data-related message during the time period, the client sends a very small MQTT "ping" message, which the server will acknowledge. The keep alive interval enables the client to detect when the server is no longer available without having to wait for the long TCP/IP timeout. Set to 0 if you do not want any keep alive processing.
cleansession: c_int
This is a boolean value. The cleansession setting controls the behaviour of both the client and the server at connection and disconnection time. The client and server both maintain session state information. This information is used to ensure "at least once" and "exactly once" delivery, and "exactly once" receipt of messages. Session state also includes subscriptions created by an MQTT client. You can choose to maintain or discard state information between sessions.
When cleansession is true, the state information is discarded at connect and disconnect. Setting cleansession to false keeps the state information. When you connect an MQTT client application with MQTTAsync_connect(), the client identifies the connection using the client identifier and the address of the server. The server checks whether session information for this client has been saved from a previous connection to the server. If a previous session still exists, and cleansession=true, then the previous session information at the client and server is cleared. If cleansession=false, the previous session is resumed. If no previous session exists, a new session is started.
maxInflight: c_int
This controls how many messages can be in-flight simultaneously.
will: *mut MQTTAsync_willOptions
This is a pointer to an MQTTAsync_willOptions structure. If your application does not make use of the Last Will and Testament feature, set this pointer to NULL.
username: *const c_char
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user name and password. This is the user name parameter.
password: *const c_char
MQTT servers that support the MQTT v3.1 protocol provide authentication and authorisation by user name and password. This is the password parameter.
connectTimeout: c_int
The time interval in seconds to allow a connect to complete.
retryInterval: c_int
The time interval in seconds
ssl: *mut MQTTAsync_SSLOptions
This is a pointer to an MQTTAsync_SSLOptions structure. If your application does not make use of SSL, set this pointer to NULL.
onSuccess: MQTTAsync_onSuccess
A pointer to a callback function to be called if the connect successfully completes. Can be set to NULL, in which case no indication of successful completion will be received.
onFailure: MQTTAsync_onFailure
A pointer to a callback function to be called if the connect fails. Can be set to NULL, in which case no indication of unsuccessful completion will be received.
context: *mut c_void
A pointer to any application-specific context. The the context pointer is passed to success or failure callback functions to provide access to the context information in the callback.
serverURIcount: c_int
The number of entries in the serverURIs array.
serverURIs: *const *const c_char
An array of null-terminated strings specifying the servers to which the client will connect. Each string takes the form protocol://host:port. protocol must be tcp or ssl. For host, you can specify either an IP address or a domain name. For instance, to connect to a server running on the local machines with the default MQTT port, specify tcp://localhost:1883.
MQTTVersion: c_int
Sets the version of MQTT to be used on the connect. MQTTVERSION_DEFAULT (0) = default: start with 3.1.1, and if that fails, fall back to 3.1 MQTTVERSION_3_1 (3) = only try version 3.1 MQTTVERSION_3_1_1 (4) = only try version 3.1.1
automaticReconnect: c_int
Reconnect automatically in the case of a connection being lost?
minRetryInterval: c_int
Minimum retry interval in seconds. Doubled on each failed retry.
maxRetryInterval: c_int
Maximum retry interval in seconds. The doubling stops here on failed retries.
binarypwd: MQTTAsync_connectOptions__bindgen_ty_1
Trait Implementations
impl Debug for MQTTAsync_connectOptions
[src]
impl Copy for MQTTAsync_connectOptions
[src]
impl Clone for MQTTAsync_connectOptions
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for MQTTAsync_connectOptions
[src]
fn default() -> MQTTAsync_connectOptions
Returns the "default value" for a type. Read more