/*
 * mqtt.h
 *
 *  Created on: 2018Äê6ÔÂ26ÈÕ
 *      Author: Think
 */

#ifndef COLLECTOR_MQTT_MQTT_H_
#define COLLECTOR_MQTT_MQTT_H_

#define GATEWAY_MAX_SN_LEN			32
#define GATEWAY_MIN_SN_LEN			8

/******************************************************************************
 GLOBAL PARAMETERS
 *****************************************************************************/

/*! Config mqtt server */
extern char gateway_CONFIG_MQTT_SERVER[];
#define CONFIG_MQTT_SERVER            gateway_CONFIG_MQTT_SERVER

extern char Gateway_serialNumber[GATEWAY_MAX_SN_LEN];
#define GATEWAY_SN                    Gateway_serialNumber

extern bool gateway_CONFIG_MQTT_ENABLE;
#define CONFIG_MQTT_ENABLE            gateway_CONFIG_MQTT_ENABLE

extern bool gateway_CONFIG_MQTT_SSL_ENABLE;
#define CONFIG_MQTT_SSL_ENABLE        gateway_CONFIG_MQTT_SSL_ENABLE

extern char gateway_CONFIG_MQTT_CACRT[];
#define CONFIG_MQTT_CACRT             gateway_CONFIG_MQTT_CACRT

extern char gateway_CONFIG_MQTT_CLIENTCRT[];
#define CONFIG_MQTT_CLIENTCRT         gateway_CONFIG_MQTT_CLIENTCRT

extern char gateway_CONFIG_MQTT_CLIENTKEY[];
#define CONFIG_MQTT_CLIENTKEY         gateway_CONFIG_MQTT_CLIENTKEY

/******************************************************************************
 Function Prototypes
 *****************************************************************************/

/*!
 * @brief Initialize mqtt service.
 */
extern void Mqtt_init(void);

/*!
 * @brief Mqtt service task processing.
 */
extern void Mqtt_process(void);

#endif /* COLLECTOR_MQTT_MQTT_H_ */
