From bacc5b5efcb75e93311e2de8967c277536785b9b Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Wed, 15 Nov 2023 15:49:35 -0800 Subject: [PATCH] Bind missing negotiated setting fields --- include/aws/crt/mqtt/Mqtt5Packets.h | 20 ++++++++++++++++++++ source/mqtt/Mqtt5Packets.cpp | 12 ++++++++++++ 2 files changed, 32 insertions(+) diff --git a/include/aws/crt/mqtt/Mqtt5Packets.h b/include/aws/crt/mqtt/Mqtt5Packets.h index 832cb0166..7d127040d 100644 --- a/include/aws/crt/mqtt/Mqtt5Packets.h +++ b/include/aws/crt/mqtt/Mqtt5Packets.h @@ -504,6 +504,16 @@ namespace Aws */ uint32_t getMaximumPacketSizeBytes() const noexcept; + /** + * @return returns the maximum allowed topic alias value on publishes sent from client to server + */ + uint16_t getTopicAliasMaximumToServer() const noexcept; + + /** + * @return returns the maximum allowed topic alias value on publishes sent from server to client + */ + uint16_t getTopicAliasMaximumToClient() const noexcept; + /** * The maximum amount of time in seconds between client packets. The client should use PINGREQs to * ensure this limit is not breached. The server will disconnect the client for inactivity if no MQTT @@ -575,6 +585,16 @@ namespace Aws */ uint32_t m_maximumPacketSizeBytes; + /** + * the maximum allowed topic alias value on publishes sent from client to server + */ + uint16_t m_topicAliasMaximumToServer; + + /** + * the maximum allowed topic alias value on publishes sent from server to client + */ + uint16_t m_topicAliasMaximumToClient; + /** * The maximum amount of time in seconds between client packets. The client should use PINGREQs to * ensure this limit is not breached. The server will disconnect the client for inactivity if no MQTT diff --git a/source/mqtt/Mqtt5Packets.cpp b/source/mqtt/Mqtt5Packets.cpp index 1d2f0052e..aa2b93705 100644 --- a/source/mqtt/Mqtt5Packets.cpp +++ b/source/mqtt/Mqtt5Packets.cpp @@ -1186,6 +1186,8 @@ namespace Aws m_receiveMaximumFromServer = negotiated_settings.receive_maximum_from_server; m_maximumPacketSizeBytes = negotiated_settings.maximum_packet_size_to_server; + m_topicAliasMaximumToServer = negotiated_settings.topic_alias_maximum_to_server; + m_topicAliasMaximumToClient = negotiated_settings.topic_alias_maximum_to_client; m_serverKeepAliveSec = negotiated_settings.server_keep_alive; m_retainAvailable = negotiated_settings.retain_available; @@ -1213,6 +1215,16 @@ namespace Aws uint32_t NegotiatedSettings::getMaximumPacketSizeBytes() const noexcept { return m_maximumPacketSizeBytes; } + uint16_t NegotiatedSettings::getTopicAliasMaximumToServer() const noexcept + { + return m_topicAliasMaximumToServer; + } + + uint16_t NegotiatedSettings::getTopicAliasMaximumToClient() const noexcept + { + return m_topicAliasMaximumToClient; + } + uint16_t NegotiatedSettings::getServerKeepAlive() const noexcept { return m_serverKeepAliveSec; } bool NegotiatedSettings::getRetainAvailable() const noexcept { return m_retainAvailable; }