#include <Mqtt5Packets.h>
Data model of an MQTT5 CONNECT packet.
◆ ConnectPacket() [1/3]
◆ ~ConnectPacket()
Aws::Crt::Mqtt5::ConnectPacket::~ConnectPacket |
( |
| ) |
|
|
virtual |
◆ ConnectPacket() [2/3]
Aws::Crt::Mqtt5::ConnectPacket::ConnectPacket |
( |
const ConnectPacket & |
| ) |
|
|
delete |
◆ ConnectPacket() [3/3]
Aws::Crt::Mqtt5::ConnectPacket::ConnectPacket |
( |
ConnectPacket && |
| ) |
|
|
deletenoexcept |
◆ getClientId()
const Crt::String & Aws::Crt::Mqtt5::ConnectPacket::getClientId |
( |
| ) |
const |
|
noexcept |
A unique string identifying the client to the server. Used to restore session state between connections.
If left empty, the broker will auto-assign a unique client id. When reconnecting, the mqtt5 client will always use the auto-assigned client id.
See MQTT5 Client Identifier
- Returns
- A unique string identifying the client to the server.
◆ getKeepAliveIntervalSec()
uint16_t Aws::Crt::Mqtt5::ConnectPacket::getKeepAliveIntervalSec |
( |
| ) |
const |
|
noexcept |
The maximum time interval, in seconds, that is permitted to elapse between the point at which the client finishes transmitting one MQTT packet and the point it starts sending the next. The client will use PINGREQ packets to maintain this property.
If the responding CONNACK contains a keep alive property value, then that is the negotiated keep alive value. Otherwise, the keep alive sent by the client is the negotiated value.
See MQTT5 Keep Alive
- Returns
- The maximum time interval, in seconds, that is permitted to elapse between the point at which the client finishes transmitting one MQTT packet and the point it starts sending the next.
◆ getMaximumPacketSizeBytes()
const Crt::Optional< uint32_t > & Aws::Crt::Mqtt5::ConnectPacket::getMaximumPacketSizeBytes |
( |
| ) |
const |
|
noexcept |
◆ getMaximumPacketSizeToServer()
const Crt::Optional< uint32_t > & Aws::Crt::Mqtt5::ConnectPacket::getMaximumPacketSizeToServer |
( |
| ) |
const |
|
noexcept |
Notifies the server of the maximum packet size the client is willing to handle. If omitted or null, then no limit beyond the natural limits of MQTT packet size is requested.
See MQTT5 Maximum Packet Size
- Returns
- The maximum packet size the client is willing to handle
◆ getPassword()
Opaque binary data that the server may use for client authentication and authorization.
See MQTT5 Password
- Returns
- Opaque binary data that the server may use for client authentication and authorization.
◆ getReceiveMaximum()
const Crt::Optional< uint16_t > & Aws::Crt::Mqtt5::ConnectPacket::getReceiveMaximum |
( |
| ) |
const |
|
noexcept |
Notifies the server of the maximum number of in-flight QoS 1 and 2 messages the client is willing to handle. If omitted or null, then no limit is requested.
See MQTT5 Receive Maximum
- Returns
- The maximum number of in-flight QoS 1 and 2 messages the client is willing to handle.
◆ getRequestProblemInformation()
const Crt::Optional< bool > & Aws::Crt::Mqtt5::ConnectPacket::getRequestProblemInformation |
( |
| ) |
const |
|
noexcept |
If true, requests that the server send additional diagnostic information (via response string or user properties) in DISCONNECT or CONNACK packets from the server.
See MQTT5 Request Problem Information
- Returns
- If true, requests that the server send additional diagnostic information (via response string or user properties) in DISCONNECT or CONNACK packets from the server.
◆ getRequestResponseInformation()
const Crt::Optional< bool > & Aws::Crt::Mqtt5::ConnectPacket::getRequestResponseInformation |
( |
| ) |
const |
|
noexcept |
If true, requests that the server send response information in the subsequent CONNACK. This response information may be used to set up request-response implementations over MQTT, but doing so is outside the scope of the MQTT5 spec and client.
See MQTT5 Request Response Information
- Returns
- If true, requests that the server send response information in the subsequent CONNACK.
◆ getSessionExpiryIntervalSec()
const Crt::Optional< uint32_t > & Aws::Crt::Mqtt5::ConnectPacket::getSessionExpiryIntervalSec |
( |
| ) |
const |
|
noexcept |
A time interval, in seconds, that the client requests the server to persist this connection's MQTT session state for. Has no meaning if the client has not been configured to rejoin sessions. Must be non-zero in order to successfully rejoin a session.
If the responding CONNACK contains a session expiry property value, then that is the negotiated session expiry value. Otherwise, the session expiry sent by the client is the negotiated value.
See MQTT5 Session Expiry Interval
- Returns
- A time interval, in seconds, that the client requests the server to persist this connection's MQTT session state for.
◆ getType()
PacketType Aws::Crt::Mqtt5::ConnectPacket::getType |
( |
| ) |
|
|
inlineoverridevirtual |
◆ getUsername()
A string value that the server may use for client authentication and authorization.
See MQTT5 User Name
- Returns
- A string value that the server may use for client authentication and authorization.
◆ getUserProperties()
List of MQTT5 user properties included with the packet.
See MQTT5 User Property
- Returns
- List of MQTT5 user properties included with the packet.
◆ getWill()
The definition of a message to be published when the connection's session is destroyed by the server or when the will delay interval has elapsed, whichever comes first. If null, then nothing will be sent.
See MQTT5 Will
- Returns
- The message to be published when the connection's session is destroyed by the server or when the will delay interval has elapsed, whichever comes first.
◆ getWillDelayIntervalSec()
const Crt::Optional< uint32_t > & Aws::Crt::Mqtt5::ConnectPacket::getWillDelayIntervalSec |
( |
| ) |
const |
|
noexcept |
A time interval, in seconds, that the server should wait (for a session reconnection) before sending the will message associated with the connection's session. If omitted or null, the server will send the will when the associated session is destroyed. If the session is destroyed before a will delay interval has elapsed, then the will must be sent at the time of session destruction.
See MQTT5 Will Delay Interval
- Returns
- A time interval, in seconds, that the server should wait (for a session reconnection) before sending the will message associated with the connection's session.
◆ initializeRawOptions()
bool Aws::Crt::Mqtt5::ConnectPacket::initializeRawOptions |
( |
aws_mqtt5_packet_connect_view & |
raw_options, |
|
|
Allocator * |
allocator |
|
) |
| |
|
noexcept |
Intended for internal use only. Initializes the C aws_mqtt5_packet_connack_view from PacketConnect
- Parameters
-
raw_options | - output parameter containing low level client options to be passed to the C |
allocator | - memory Allocator |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ WithClientId()
Sets the unique string identifying the client to the server. Used to restore session state between connections.
If left empty, the broker will auto-assign a unique client id. When reconnecting, the mqtt5 client will always use the auto-assigned client id.
See MQTT5 Client Identifier
- Parameters
-
clientId | A unique string identifying the client to the server. |
- Returns
- The ConnectPacket Object after setting the client ID.
◆ WithKeepAliveIntervalSec()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithKeepAliveIntervalSec |
( |
uint16_t |
keepAliveInteralSeconds | ) |
|
|
noexcept |
Sets the maximum time interval, in seconds, that is permitted to elapse between the point at which the client finishes transmitting one MQTT packet and the point it starts sending the next. The client will use PINGREQ packets to maintain this property.
If the responding CONNACK contains a keep alive property value, then that is the negotiated keep alive value. Otherwise, the keep alive sent by the client is the negotiated value.
See MQTT5 Keep Alive
NOTE: The keepAliveIntervalSeconds HAS to be larger than the pingTimeoutMs time set in the Mqtt5ClientOptions.
- Parameters
-
keepAliveInteralSeconds | the maximum time interval, in seconds, that is permitted to elapse between the point at which the client finishes transmitting one MQTT packet and the point it starts sending the next. |
- Returns
- The ConnectPacket Object after setting the keep alive interval.
◆ WithMaximumPacketSizeBytes()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithMaximumPacketSizeBytes |
( |
uint32_t |
maximumPacketSizeBytes | ) |
|
|
noexcept |
Sets the maximum packet size the client is willing to handle. If omitted, then no limit beyond the natural limits of MQTT packet size is requested.
See MQTT5 Maximum Packet Size
- Parameters
-
maximumPacketSizeBytes | The maximum packet size the client is willing to handle |
- Returns
- The ConnectPacket Object after setting the maximum packet size.
◆ WithPassword()
Sets the opaque binary data that the server may use for client authentication and authorization.
See MQTT5 Password
- Parameters
-
password | Opaque binary data that the server may use for client authentication and authorization. |
- Returns
- The ConnectPacket Object after setting the password.
◆ WithReceiveMaximum()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithReceiveMaximum |
( |
uint16_t |
receiveMaximum | ) |
|
|
noexcept |
Sets the maximum number of in-flight QoS 1 and 2 messages the client is willing to handle. If omitted, then no limit is requested.
See MQTT5 Receive Maximum
- Parameters
-
receiveMaximum | The maximum number of in-flight QoS 1 and 2 messages the client is willing to handle. |
- Returns
- The ConnectPacket Object after setting the receive maximum.
◆ WithRequestProblemInformation()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithRequestProblemInformation |
( |
bool |
requestProblemInformation | ) |
|
|
noexcept |
Sets whether requests that the server send additional diagnostic information (via response string or user properties) in DISCONNECT or CONNACK packets from the server.
See MQTT5 Request Problem Information
- Parameters
-
requestProblemInformation | If true, requests that the server send additional diagnostic information (via response string or user properties) in DISCONNECT or CONNACK packets from the server. |
- Returns
- The ConnectPacket Object after setting the request problem information.
◆ WithRequestResponseInformation()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithRequestResponseInformation |
( |
bool |
requestResponseInformation | ) |
|
|
noexcept |
Sets whether requests that the server send response information in the subsequent CONNACK. This response information may be used to set up request-response implementations over MQTT, but doing so is outside the scope of the MQTT5 spec and client.
See MQTT5 Request Response Information
- Parameters
-
requestResponseInformation | If true, requests that the server send response information in the subsequent CONNACK. |
- Returns
- The ConnectPacket Object after setting the request response information.
◆ WithSessionExpiryIntervalSec()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithSessionExpiryIntervalSec |
( |
uint32_t |
sessionExpiryIntervalSeconds | ) |
|
|
noexcept |
Sets the time interval, in seconds, that the client requests the server to persist this connection's MQTT session state for. Has no meaning if the client has not been configured to rejoin sessions. Must be non-zero in order to successfully rejoin a session.
If the responding CONNACK contains a session expiry property value, then that is the negotiated session expiry value. Otherwise, the session expiry sent by the client is the negotiated value.
See MQTT5 Session Expiry Interval
- Parameters
-
sessionExpiryIntervalSeconds | A time interval, in seconds, that the client requests the server to persist this connection's MQTT session state for. |
- Returns
- The ConnectPacket Object after setting the session expiry interval.
◆ WithUserName()
Sets the string value that the server may use for client authentication and authorization.
See MQTT5 User Name
- Parameters
-
username | The string value that the server may use for client authentication and authorization. |
- Returns
- The ConnectPacket Object after setting the username.
◆ WithUserProperties() [1/2]
Sets the list of MQTT5 user properties included with the packet.
See MQTT5 User Property
- Parameters
-
userProperties | List of MQTT5 user properties included with the packet. |
- Returns
- The ConnectPacket Object after setting the user properties.
◆ WithUserProperties() [2/2]
Sets the list of MQTT5 user properties included with the packet.
See MQTT5 User Property
- Parameters
-
userProperties | List of MQTT5 user properties included with the packet. |
- Returns
- The ConnectPacket Object after setting the user properties.
◆ WithUserProperty()
Put a MQTT5 user property to the back of the packet user property vector/list
See MQTT5 User Property
- Parameters
-
property | set of userProperty of MQTT5 user properties included with the packet. |
- Returns
- The ConnectPacket Object after setting the user property
◆ WithWill()
Sets the definition of a message to be published when the connection's session is destroyed by the server or when the will delay interval has elapsed, whichever comes first. If null, then nothing will be sent.
See MQTT5 Will
- Parameters
-
will | The message to be published when the connection's session is destroyed by the server or when the will delay interval has elapsed, whichever comes first. |
- Returns
- The ConnectPacket Object after setting the will message.
◆ WithWillDelayIntervalSec()
ConnectPacket & Aws::Crt::Mqtt5::ConnectPacket::WithWillDelayIntervalSec |
( |
uint32_t |
willDelayIntervalSeconds | ) |
|
|
noexcept |
Sets the time interval, in seconds, that the server should wait (for a session reconnection) before sending the will message associated with the connection's session. If omitted, the server will send the will when the associated session is destroyed. If the session is destroyed before a will delay interval has elapsed, then the will must be sent at the time of session destruction.
See MQTT5 Will Delay Interval
- Parameters
-
willDelayIntervalSeconds | A time interval, in seconds, that the server should wait (for a session reconnection) before sending the will message associated with the connection's session. |
- Returns
- The ConnectPacket Object after setting the will message delay interval.
The documentation for this class was generated from the following files: