#ifndef __CLOUD_MQTT_H__
#define __CLOUD_MQTT_H__
#include <stdint.h>
#include "mqtt_it.h"
#include "mqtt_session.h"

typedef struct mqtt_server_info
{
    char *ip;
    uint16_t port;
    char *user;
    char *pass;
    //
    int qos;
    int keepalive;
} mqtt_server_info;

typedef struct cloud_mqtt
{
    mqtt_session_t *mqtt;
    mqtt_server_info server_info;
    //
    cloud_mqtt_its *its;
    time_t last_update_time;

} cloud_mqtt;

cloud_mqtt *new_cloud_mqtt(mqtt_server_info *server_info, const char *platform_name);
int delete_cloud_mqtt(cloud_mqtt *cloud);
int cloud_mqtt_start(cloud_mqtt *cloud);
int cloud_mqtt_update(cloud_mqtt *cloud);
#endif
