acl/lib_acl_cpp/include/acl_cpp/mqtt/mqtt_puback.hpp

33 lines
538 B
C++
Raw Normal View History

2021-03-02 16:39:06 +08:00
#pragma once
#include "mqtt_message.hpp"
namespace acl {
class mqtt_puback : public mqtt_message {
public:
2021-03-02 16:56:52 +08:00
mqtt_puback(mqtt_type_t type = MQTT_PUBACK);
virtual ~mqtt_puback(void);
2021-03-02 16:39:06 +08:00
void set_pkt_id(unsigned short id);
unsigned short get_pkt_id(void) const {
return pkt_id_;
}
bool to_string(string& out);
int update(const char* data, unsigned dlen);
public:
int unpack_header_var(const char* data, unsigned dlen);
private:
bool finished_;
char hbuf_[2];
unsigned hlen_;
unsigned short pkt_id_;
};
} // namespace acl