aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Loading...
Searching...
No Matches
MqttTypes.h
Go to the documentation of this file.
1#pragma once
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
16namespace Aws
17{
18 namespace Crt
19 {
20 namespace Mqtt
21 {
22 class MqttConnection;
23
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
#define AWS_CRT_CPP_API
Definition Exports.h:36
Definition SocketOptions.h:48
Definition TlsOptions.h:293
Definition TlsOptions.h:350
Definition MqttConnection.h:158
std::function< void(MqttConnection &connection, uint16_t packetId, const Vector< String > &topics, QOS qos, int errorCode)> OnMultiSubAckHandler
Definition MqttTypes.h:85
std::function< void(MqttConnection &connection, const String &topic, const ByteBuf &payload, bool dup, QOS qos, bool retain)> OnMessageReceivedHandler
Definition MqttTypes.h:57
std::function< void(MqttConnection &connection, uint16_t packetId, int errorCode)> OnOperationCompleteHandler
Definition MqttTypes.h:98
aws_mqtt_qos QOS
Definition Types.h:40
std::function< void(MqttConnection &connection, uint16_t packetId, const String &topic, QOS qos, int errorCode)> OnSubAckHandler
Definition MqttTypes.h:69
aws_allocator Allocator
Definition Allocator.h:14
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > String
Definition Types.h:45
aws_byte_buf ByteBuf
Definition Types.h:30
std::vector< T, StlAllocator< T > > Vector
Definition Types.h:53
Definition Allocator.h:11
uint64_t unackedOperationSize
Definition MqttTypes.h:127
uint64_t incompleteOperationCount
Definition MqttTypes.h:109
uint64_t unackedOperationCount
Definition MqttTypes.h:121
uint64_t incompleteOperationSize
Definition MqttTypes.h:115
Definition MqttTypes.h:28
Crt::Io::TlsConnectionOptions tlsConnectionOptions
Definition MqttTypes.h:33
bool useWebsocket
Definition MqttTypes.h:34
uint32_t port
Definition MqttTypes.h:30
Crt::Io::TlsContext tlsContext
Definition MqttTypes.h:32
Io::SocketOptions socketOptions
Definition MqttTypes.h:31
const char * hostName
Definition MqttTypes.h:29
Allocator * allocator
Definition MqttTypes.h:37
bool useTls
Definition MqttTypes.h:35
bool enableMetrics
Definition MqttTypes.h:36