#ifndef SYS_MQTT_H
#define SYS_MQTT_H

#include "ucos_ii.h"
#include "json_queue.h"
#include "gateway_message.h"

#define  MBOX_NETWORK_ERROR     0xf0000000

#define  MBOX_MQTT_QOS1PUBACK   0x10000001
#define  MBOX_MQTT_QOS2PUBREC   0x10000002
#define  MBOX_MQTT_QOS2PUBCOMP  0x10000003

#define  MBOX_USER_PUBLISHQOS0  0x20000001
#define  MBOX_USER_PUBLISHQOS1  0x20000002
#define  MBOX_USER_PUBLISHQOS2  0x20000003

#define  MQTT_PRINTF  printf


//#define  MQTT_SERVER_ADDR  "192.168.0.116"
//#define  MQTT_SERVER_ADDR  "192.168.0.183"
//#define  MQTT_SERVER_ADDR  "36.134.23.11"
//#define  MQTT_SERVER_PORT  1883

#define  CLIENT_ID     "stm32f207test"       //
//#define  USER_NAME     "emqxxx"     
//#define  PASSWORD      "123456" 
//#define  USER_NAME     NULL  
//#define  PASSWORD      NULL
#define  KEEPLIVE_TIME   120
#define  MQTT_VERSION    4

//#define  TOPICSTM32    "test/stm32"
//#define  TOPICPC       "test/pc"
//#define  TOPICTEST     "/device/cxw0817111032"



extern int mqtt_connectFlag;
extern OS_EVENT *mqtt_sendMseeageMbox;
extern OS_EVENT *JsonQ;
void mqtt_threadCreate(void);
char *get_mqtt_payload();

#define jsonMaxSize 1000
extern char pubJsonString[jsonMaxSize];

#endif 



