7#if !defined(ASYNC_MQTT_PACKET_CONNECT_RETURN_CODE_HPP)
8#define ASYNC_MQTT_PACKET_CONNECT_RETURN_CODE_HPP
16enum class connect_return_code : std::uint8_t {
18 unacceptable_protocol_version = 1,
19 identifier_rejected = 2,
20 server_unavailable = 3,
21 bad_user_name_or_password = 4,
26char const* connect_return_code_to_str(connect_return_code v) {
27 char const *
const str[] = {
29 "unacceptable_protocol_version",
30 "identifier_rejected",
32 "bad_user_name_or_password",
35 if (
static_cast<std::uint8_t
>(v) <
sizeof(str))
return str[
static_cast<std::uint8_t
>(v)];
36 return "unknown_connect_return_code";
40std::ostream& operator<<(std::ostream& os, connect_return_code val)
42 os << connect_return_code_to_str(val);