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
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
#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:84
std::function< void(MqttConnection &connection, const String &topic, const ByteBuf &payload, bool dup, QOS qos, bool retain)> OnMessageReceivedHandler
Definition MqttTypes.h:56
std::function< void(MqttConnection &connection, uint16_t packetId, int errorCode)> OnOperationCompleteHandler
Definition MqttTypes.h:97
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:68
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:126
uint64_t incompleteOperationCount
Definition MqttTypes.h:108
uint64_t unackedOperationCount
Definition MqttTypes.h:120
uint64_t incompleteOperationSize
Definition MqttTypes.h:114
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:36
bool useTls
Definition MqttTypes.h:35