AWS IoT Device SDK C++ v2  1.43.1
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  bool enableMetrics = true;
37  Allocator *allocator = nullptr;
38  };
39 
51  using OnMessageReceivedHandler = std::function<void(
52  MqttConnection &connection,
53  const String &topic,
54  const ByteBuf &payload,
55  bool dup,
56  QOS qos,
57  bool retain)>;
58 
68  using OnSubAckHandler = std::function<
69  void(MqttConnection &connection, uint16_t packetId, const String &topic, QOS qos, int errorCode)>;
70 
80  using OnMultiSubAckHandler = std::function<void(
81  MqttConnection &connection,
82  uint16_t packetId,
83  const Vector<String> &topics,
84  QOS qos,
85  int errorCode)>;
86 
98  std::function<void(MqttConnection &connection, uint16_t packetId, int errorCode)>;
99 
104  {
105  /*
106  * Total number of operations submitted to the connection that have not yet been completed. Unacked
107  * operations are a subset of this.
108  */
110 
111  /*
112  * Total packet size of operations submitted to the connection that have not yet been completed. Unacked
113  * operations are a subset of this.
114  */
116 
117  /*
118  * Total number of operations that have been sent to the server and are waiting for a corresponding ACK
119  * before they can be completed.
120  */
122 
123  /*
124  * Total packet size of operations that have been sent to the server and are waiting for a corresponding
125  * ACK before they can be completed.
126  */
128  };
129  } // namespace Mqtt
130  } // namespace Crt
131 } // namespace Aws
Aws::Crt::Mqtt::MqttConnectionOptions::allocator
Allocator * allocator
Definition: MqttTypes.h:37
Aws::Crt::Mqtt::MqttConnectionOptions::useWebsocket
bool useWebsocket
Definition: MqttTypes.h:34
Aws::Crt::Mqtt::MqttConnectionOptions
Definition: MqttTypes.h:28
TlsOptions.h
Aws::Crt::Mqtt::MqttConnectionOptions::enableMetrics
bool enableMetrics
Definition: MqttTypes.h:36
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::incompleteOperationCount
uint64_t incompleteOperationCount
Definition: MqttTypes.h:109
Aws::Crt::Mqtt::MqttConnectionOptions::tlsConnectionOptions
Crt::Io::TlsConnectionOptions tlsConnectionOptions
Definition: MqttTypes.h:33
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::incompleteOperationSize
uint64_t incompleteOperationSize
Definition: MqttTypes.h:115
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:69
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:85
Aws::Crt::Io::TlsContext
Definition: TlsOptions.h:350
Aws::Crt::Mqtt::MqttConnectionOperationStatistics::unackedOperationCount
uint64_t unackedOperationCount
Definition: MqttTypes.h:121
Aws::Crt::Mqtt::OnOperationCompleteHandler
std::function< void(MqttConnection &connection, uint16_t packetId, int errorCode)> OnOperationCompleteHandler
Definition: MqttTypes.h:98
Aws::Crt::Mqtt::MqttConnectionOptions::tlsContext
Crt::Io::TlsContext tlsContext
Definition: MqttTypes.h:32
Types.h
Aws::Crt::Mqtt::MqttConnectionOperationStatistics
Definition: MqttTypes.h:104
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:36
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:57
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:127