async_mqtt
9.0.1
Loading...
Searching...
No Matches
protocol_version.hpp
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
18
namespace
async_mqtt {
19
29
enum class
protocol_version
{
30
undetermined
= 0,
31
v3_1_1
= 4,
32
v5
= 5,
33
};
34
46
constexpr
char
const
*
protocol_version_to_str
(
protocol_version
v) {
47
switch
(v) {
48
case
protocol_version::undetermined
:
return
"undetermined"
;
49
case
protocol_version::v3_1_1
:
return
"v3_1_1"
;
50
case
protocol_version::v5
:
return
"v5"
;
51
default
:
return
"unknown_protocol_version"
;
52
}
53
}
54
67
inline
68
std::ostream&
operator<<
(std::ostream& os,
protocol_version
val)
69
{
70
os <<
protocol_version_to_str
(val);
71
return
os;
72
}
73
74
}
// namespace async_mqtt
75
76
#endif
// ASYNC_MQTT_PROTOCOL_VERSION_HPP
async_mqtt::operator<<
std::ostream & operator<<(std::ostream &o, mqtt_error v)
output to the stream
async_mqtt::protocol_version
protocol_version
MQTT protocol version.
Definition
protocol_version.hpp:29
async_mqtt::protocol_version_to_str
constexpr char const * protocol_version_to_str(protocol_version v)
stringize protocol_version
Definition
protocol_version.hpp:46
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
include
async_mqtt
protocol_version.hpp
Generated by
1.12.0