#ifndef __MY_PUBLIC__
#define __MY_PUBLIC__
#include <lnxall_ubuslog.h>

typedef unsigned char BYTE;
typedef char CHAR;
typedef unsigned short USHORT;
typedef short SHORT;
typedef unsigned int UWORD;
typedef int WORD;
typedef long long DWORD;
typedef unsigned long long UDWORD;

#define _TO_STRING(a) #a
#define TO_STRING(a) _TO_STRING(a)

typedef enum bool_s
{
    E_TRUE,
    E_FALSE,
    E_PLANINFO_ERR,
    E_PCSYGGLERR,
    E_PCSWGGLERR,
    E_NOT_IDEL,
    E_IDEENTIFIER_ERR,
    E_RUNSTATE_ERR,
    E_MALLOC_ERR,
    E_NOT_CONNET_GRID,
} BOOL_E;

#define DEV_NODE_NAME_LEN 16

#define POWER_MAX_VAL 1000

#define GET_JSON_VALUE_DY_STRING_LOG(a, b, c) \
    GET_JSON_VALUE_DY_STRING(a, b, c);        \
    dbg_syslog(LOG_INFO, "key:%s :%s", b, c);

#define GET_JSON_VALUE_INT_LOG(a, b, c) \
    GET_JSON_VALUE_INT(a, b, c);        \
    dbg_syslog(LOG_INFO, "key:%s :%d", b, c);

#define GET_JSON_VALUE_STRING_LOG(a, b, c) \
    GET_JSON_VALUE_STRING(a, b, c);        \
    dbg_syslog(LOG_INFO, "key:%s :%s", b, c);

#define GET_JSON_VALUE_DOUBLE_LOG(a, b, c)     \
    GET_JSON_VALUE_DOUBLE(a, b, c); \
    dbg_syslog(LOG_INFO, "key:%s :%f", b, c);



#define MQTT_NAME_LEN 64
#define TOPIC_MAX_LEN 128
#define MQTT_QOS_LEVLE0 0
#define KEEP_ALIVE_MAX  3600
#define LOG_BUFFER_SIZE 128

typedef struct  mqtt_info_s{
    CHAR username[MQTT_NAME_LEN];
    CHAR password[MQTT_NAME_LEN];
    CHAR hostname[MQTT_NAME_LEN];
    UWORD port;
}MQTT_INFO_T;


typedef enum run_mode_e{
    E_ONGW_MODE,
    E_ONIOTBOX_MODE,
    E_ONGW_TO_IOTBOX_MODE,
}E_RUN_MODE;


#endif


