async_mqtt 5.0.0
Loading...
Searching...
No Matches
fixed_header.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_PACKET_FIXED_HEADER_HPP)
8#define ASYNC_MQTT_PACKET_FIXED_HEADER_HPP
9
10#include <async_mqtt/packet/control_packet_type.hpp>
11
12namespace async_mqtt {
13
14constexpr std::uint8_t make_fixed_header(control_packet_type type, std::uint8_t flags) {
15 return static_cast<std::uint8_t>(type) | (flags & 0x0f);
16}
17
18} // namespace async_mqtt
19
20#endif // ASYNC_MQTT_PACKET_FIXED_HEADER_HPP