Guo Wenxue
2022-09-21 fbbb2d0b2aba4ddc42651096b20dd4a7ca4a33f2
mqttd/etc/conf.h
@@ -13,7 +13,7 @@
#ifndef  __CONF_H_
#define  __CONF_H_
#define DEF_BORKER_HOSTNAME        "master.iot-yun.com"
#define DEF_BORKER_HOSTNAME        "master.iot-yun.club"
#define DEF_BROKER_PORT            10883
#define DEF_BROKER_KEEPALIVE       30
#define DEF_BROKER_USERNAME        "lingyun"
@@ -35,8 +35,49 @@
    Qos2, /* Qos2使用两阶段确认来保证消息的不丢失和不重复。在Qos2情况下,Broker肯定会收到消息,且只收到一次  */
};
#define LUX_TRIGGLE_VAL            0.01
enum
{
    FILLIN_LIGHT_OFF=0,  /* disable */
    FILLIN_LIGHT_ON,     /* enable  */
    FILLIN_LIGHT_AUTO,   /* auto fill-in light based on LUX sensor detected value */
};
typedef struct hwconf_s
{
    unsigned char  enable;      /* Hardware enable or not, help to running on X86 */
    int            relay_pin;   /* relay connected wPI #pin number, if set to 0 means disable */
    int            beep_pin;    /* beep connected wPI #pin number, if set to 0 means disable */
    int            beep_times;  /* default beep count when beep on */
    unsigned char  leds;
    int            red_pin;     /*  redled connect wPI #pin number, if set to 0 means disable */
    int            green_pin;   /*greenled connect wPI #pin number, if set to 0 means disable */
    int            blue_pin;    /* blueled connect wPI #pin number, if set to 0 means disable */
    unsigned char  ds18b20;    /* enable or disable temperature sensor ds18b20 */
    unsigned char  sht2x;      /* enable or disable temperature and hummidity sensor sht2x */
    unsigned char  lux;        /* enable or disable light intensity sensor TSL2561 */
    /* Infrared detect inbreank  */
    unsigned char  infrared_pin; /* enable or disable inbreak detected */
    unsigned char  inbreak_beep; /* enable or diable beep when detect inbreak */
    unsigned char  fillin_light; /* fill-in light when detect inbrank or not */
    unsigned char  light_intval; /* fill-in light interval time, unit second  */
    double         lux_threshold; /* Lux sensor detect value smaller than treshold will fill-in light  */
} hwconf_t;
typedef struct mqtt_ctx_s
{
    char          id[32];       /*  production ID */
    /* hardware configuration */
    hwconf_t      hwconf;
    /* logger settings */
    char          logfile[128]; /* logger record file */
    int           loglevel;     /* logger level  */