AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
MqttTypes.h
Go to the documentation of this file.
1 #pragma once
2 
7 #include <aws/crt/Types.h>
10 
11 #include <aws/mqtt/client.h>
12 #include <aws/mqtt/v5/mqtt5_client.h>
13 
14 #include <functional>
15 
16 namespace Aws
17 {
18  namespace Crt
19  {
20  namespace Mqtt
21  {
22  class MqttConnection;
23 
28  {
29  const char *hostName = nullptr;
30  uint32_t port = 0;
34  bool useWebsocket = false;
35  bool useTls = false;
36  Allocator *allocator = nullptr;
37  };
38 
50  using OnMessageReceivedHandler = std::function<void(
51  MqttConnection &connection,
52  const String &topic,
53  const ByteBuf &payload,
54  bool dup,
55  QOS qos,
56  bool retain)>;
57 
67  using OnSubAckHandler = std::function<
68  void(MqttConnection &connection, uint16_t packetId, const String &topic, QOS qos, int errorCode)>;
69 
79  using OnMultiSubAckHandler = std::function<void(
80  MqttConnection &connection,
81  uint16_t packetId,
82  const Vector<String> &topics,
83  QOS qos,
84  int errorCode)>;
85 
97  std::function<void(MqttConnection &connection, uint16_t packetId, int errorCode)>;
98 
103  {
104  /*
105  * Total number of operations submitted to the connection that have not yet been completed. Unacked
106  * operations are a subset of this.
107  */
109 
110  /*
111  * Total packet size of operations submitted to the connection that have not yet been completed. Unacked
112  * operations are a subset of this.
113  */
115 
116  /*
117  * Total number of operations that have been sent to the server and are waiting for a corresponding ACK
118  * before they can be completed.
119  */
121 
122  /*
123  * Total packet size of operations that have been sent to the server and are waiting for a corresponding
124  * ACK before they can be completed.
125  */
127  };
128  } // namespace Mqtt
129  } // namespace Crt
130 } // namespace Aws
Aws::Crt::Mqtt::MqttConnectionOptions::allocator
Allocator * allocator
Definition: MqttTypes.h:36
Aws::Crt::Mqtt::MqttConnectionOptions::useWebsocket
bool useWebsocket
Definition: MqttTypes.h:34
Aws::Crt::Mqtt::MqttConnectionOptions
Definition: MqttTypes.h:28
TlsOptions.h
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::incompleteOperationCount
uint64_t incompleteOperationCount
Definition: MqttTypes.h:108
Aws::Crt::Mqtt::MqttConnectionOptions::tlsConnectionOptions
Crt::Io::TlsConnectionOptions tlsConnectionOptions
Definition: MqttTypes.h:33
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::incompleteOperationSize
uint64_t incompleteOperationSize
Definition: MqttTypes.h:114
Aws::Crt::Mqtt::MqttConnectionOptions::useTls
bool useTls
Definition: MqttTypes.h:35
Aws::Crt::Io::TlsConnectionOptions
Definition: TlsOptions.h:293
Aws::Crt::Mqtt::OnSubAckHandler
std::function< void(MqttConnection &connection, uint16_t packetId, const String &topic, QOS qos, int errorCode)> OnSubAckHandler
Definition: MqttTypes.h:68
Aws::Crt::Mqtt::MqttConnection
Definition: MqttConnection.h:158
Aws::Crt::Mqtt::MqttConnectionOptions::socketOptions
Io::SocketOptions socketOptions
Definition: MqttTypes.h:31
Aws::Crt::Mqtt::QOS
aws_mqtt_qos QOS
Definition: Types.h:40
Aws::Crt::Mqtt::OnMultiSubAckHandler
std::function< void(MqttConnection &connection, uint16_t packetId, const Vector< String > &topics, QOS qos, int errorCode)> OnMultiSubAckHandler
Definition: MqttTypes.h:84
Aws::Crt::Io::TlsContext
Definition: TlsOptions.h:350
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::unackedOperationCount
uint64_t unackedOperationCount
Definition: MqttTypes.h:120
Aws::Crt::Mqtt::OnOperationCompleteHandler
std::function< void(MqttConnection &connection, uint16_t packetId, int errorCode)> OnOperationCompleteHandler
Definition: MqttTypes.h:97
Aws::Crt::Mqtt::MqttConnectionOptions::tlsContext
Crt::Io::TlsContext tlsContext
Definition: MqttTypes.h:32
Types.h
Aws::Crt::Mqtt::MqttConnectionOperationStatistics
Definition: MqttTypes.h:103
Aws::Crt::Io::SocketOptions
Definition: SocketOptions.h:48
Aws::Crt::Vector
std::vector< T, StlAllocator< T > > Vector
Definition: Types.h:53
Aws::Crt::ByteBuf
aws_byte_buf ByteBuf
Definition: Types.h:30
AWS_CRT_CPP_API
#define AWS_CRT_CPP_API
Definition: Exports.h:37
Aws
Definition: Allocator.h:11
Aws::Crt::Mqtt::MqttConnectionOptions::port
uint32_t port
Definition: MqttTypes.h:30
SocketOptions.h
Aws::Crt::Allocator
aws_allocator Allocator
Definition: Allocator.h:14
Aws::Crt::Mqtt::MqttConnectionOptions::hostName
const char * hostName
Definition: MqttTypes.h:29
Aws::Crt::Mqtt::OnMessageReceivedHandler
std::function< void(MqttConnection &connection, const String &topic, const ByteBuf &payload, bool dup, QOS qos, bool retain)> OnMessageReceivedHandler
Definition: MqttTypes.h:56
Aws::Crt::String
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > String
Definition: Types.h:45
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::unackedOperationSize
uint64_t unackedOperationSize
Definition: MqttTypes.h:126