async_mqtt
5.0.0
Loading...
Searching...
No Matches
protocol_version.hpp
Go to the documentation of this file.
1
// Copyright Takatoshi Kondo 2022
2
//
3
// Distributed under the Boost Software License, Version 1.0.
4
// (See accompanying file LICENSE_1_0.txt or copy at
5
// http://www.boost.org/LICENSE_1_0.txt)
6
7
#if !defined(ASYNC_MQTT_PROTOCOL_VERSION_HPP)
8
#define ASYNC_MQTT_PROTOCOL_VERSION_HPP
9
10
#include <cstdint>
11
#include <ostream>
12
14
15
namespace
async_mqtt {
16
20
enum class
protocol_version
{
21
undetermined
= 0,
22
v3_1_1
= 4,
23
v5
= 5,
24
};
25
29
constexpr
char
const
*
protocol_version_to_str
(
protocol_version
v
) {
30
switch
(
v
) {
31
case
protocol_version::undetermined:
return
"undetermined"
;
32
case
protocol_version::v3_1_1:
return
"v3_1_1"
;
33
case
protocol_version::v5:
return
"v5"
;
34
default
:
return
"unknown_protocol_version"
;
35
}
36
}
37
41
inline
42
std::ostream&
operator<<
(std::ostream&
os
,
protocol_version
val)
43
{
44
os
<<
protocol_version_to_str
(val);
45
return
os
;
46
}
47
48
}
// namespace async_mqtt
49
50
#endif
// ASYNC_MQTT_PROTOCOL_VERSION_HPP
async_mqtt::basic_packet_variant
Definition
packet_variant.hpp:49
async_mqtt::protocol_version
protocol_version
MQTT protocol version.
Definition
protocol_version.hpp:20
async_mqtt::protocol_version::undetermined
@ undetermined
both v3.1.1 and v5.0 are accepted for broker (server)
async_mqtt::protocol_version::v5
@ v5
version 5.0
async_mqtt::protocol_version::v3_1_1
@ v3_1_1
version 3.1.1
async_mqtt::protocol_version_to_str
constexpr char const * protocol_version_to_str(protocol_version v)
stringize protocol_version
Definition
protocol_version.hpp:29
include
async_mqtt
protocol_version.hpp
Generated by
1.10.0