/****************************************************************************
 * This file is part of the project AqHome.
 * AqHome (c) by 2025 Martin Preuss, all rights reserved.
 *
 * The license for this file can be found in the file COPYING which you
 * should have received along with this file.
 ****************************************************************************/

#ifndef AQH_M_MQTT_CONNACK_H
#define AQH_M_MQTT_CONNACK_H


#include <aqhome/api.h>
#include <aqhome/ipc2/message.h>

#include <gwenhywfar/buffer.h>



#define AQH_MQTTMSG_CONNACK_FLAGS_HAVE_SESSION     0x01u

#define AQH_MQTTMSG_CONNACK_RESULT_ACCEPTED        0x00u
#define AQH_MQTTMSG_CONNACK_RESULT_BAD_PROTO       0x01u
#define AQH_MQTTMSG_CONNACK_RESULT_BAD_CLIENTID    0x02u
#define AQH_MQTTMSG_CONNACK_RESULT_UNAVAILABLE     0x03u
#define AQH_MQTTMSG_CONNACK_RESULT_BAD_CREDENTIALS 0x04u
#define AQH_MQTTMSG_CONNACK_RESULT_UNAUTHORIZED    0x05u



AQHOME_API AQH_MESSAGE *AQH_MqttMessageConnAck_new(uint8_t flags, uint8_t result);
AQHOME_API uint8_t AQH_MqttMessageConnAck_GetResultFlags(const AQH_MESSAGE *msg);
AQHOME_API uint8_t AQH_MqttMessageConnAck_GetResultCode(const AQH_MESSAGE *msg);





#endif
