7#if !defined(ASYNC_MQTT_CONNECT_FLAGS_HPP)
8#define ASYNC_MQTT_CONNECT_FLAGS_HPP
15namespace connect_flags {
17constexpr char const mask_clean_session = 0b00000010;
18constexpr char const mask_clean_start = 0b00000010;
19constexpr char const mask_will_flag = 0b00000100;
20constexpr char const mask_will_retain = 0b00100000;
21constexpr char const mask_password_flag = 0b01000000;
22constexpr char const mask_user_name_flag =
static_cast<char>(0b10000000u);
24constexpr bool has_clean_session(
char v) {
25 return (v & mask_clean_session) != 0;
28constexpr bool has_clean_start(
char v) {
29 return (v & mask_clean_start) != 0;
32constexpr bool has_will_flag(
char v) {
33 return (v & mask_will_flag) != 0;
36constexpr pub::retain will_retain(
char v) {
39 if (v & mask_will_retain)
return pub::retain::yes;
40 return pub::retain::no;
44constexpr bool has_password_flag(
char v) {
45 return (v & mask_password_flag) != 0;
48constexpr bool has_user_name_flag(
char v) {
49 return (v & mask_user_name_flag) != 0;
52constexpr void set_will_qos(
char& v, qos qos_value) {
53 v |=
static_cast<char>(
static_cast<std::uint8_t
>(qos_value) << 3);
56constexpr qos will_qos(
char v) {
57 return static_cast<qos>((v & 0b00011000) >> 3);
qos
MQTT QoS.
Definition qos.hpp:23