SNode.C
Loading...
Searching...
No Matches
Suback.h
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef IOT_MQTT_PACKETS_SUBACK_H
21#define IOT_MQTT_PACKETS_SUBACK_H
22
23#include "iot/mqtt/ControlPacket.h" // IWYU pragma: export
24#include "iot/mqtt/types/UInt16.h" // IWYU pragma: export
25#include "iot/mqtt/types/UInt8.h" // IWYU pragma: export
26
27#ifndef DOXYGEN_SHOULD_SKIP_THIS
28
29#include <cstdint>
30#include <list>
31
32#endif // DOXYGEN_SHOULD_SKIP_THIS
33
34namespace iot::mqtt::packets {
35
36 class Suback : public iot::mqtt::ControlPacket {
37 public:
38 Suback();
39 Suback(uint16_t packetIdentifier, const std::list<uint8_t>& returnCodes);
40
41 private:
42 std::vector<char> serializeVP() const override;
43
44 public:
45 uint16_t getPacketIdentifier() const;
46 const std::list<uint8_t>& getReturnCodes() const;
47
48 protected:
50 iot::mqtt::types::UInt8 returnCode;
52
53 int state = 0;
54 };
55
56} // namespace iot::mqtt::packets
57
58#endif // IOT_MQTT_PACKETS_SUBACK_H
std::size_t deserializeVP(iot::mqtt::MqttContext *mqttContext) override
Definition Suback.cpp:37
Suback(uint32_t remainingLength, uint8_t flags)
Definition Suback.cpp:32
void deliverPacket(iot::mqtt::client::Mqtt *mqtt) override
Definition Suback.cpp:70
iot::mqtt::types::UInt16 packetIdentifier
Definition Suback.h:49
uint16_t getPacketIdentifier() const
Definition Suback.cpp:49
iot::mqtt::types::UInt8 returnCode
Definition Suback.h:50
std::list< uint8_t > returnCodes
Definition Suback.h:51
std::vector< char > serializeVP() const override
Definition Suback.cpp:41
Suback(uint16_t packetIdentifier, const std::list< uint8_t > &returnCodes)
Definition Suback.cpp:35
const std::list< uint8_t > & getReturnCodes() const
Definition Suback.cpp:53
#define MQTT_SUBACK_FLAGS