Skip to content

Commit

Permalink
Bind missing negotiated setting fields
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose committed Nov 15, 2023
1 parent 9b47910 commit bacc5b5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions include/aws/crt/mqtt/Mqtt5Packets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions source/mqtt/Mqtt5Packets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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; }
Expand Down

0 comments on commit bacc5b5

Please sign in to comment.