guowenxue
2019-06-26 57b8d8022cf8444cf59cd20a25cfee491ec88799
mqttd/etc/conf.c
@@ -25,6 +25,7 @@
    if( !conf_file )
    { 
        strncpy(ctx->id, "\"rpi3b001\"", sizeof(ctx->id));
        /* logger settings */
        strncpy(ctx->logfile, DBG_LOG_FILE, sizeof(ctx->logfile));
@@ -99,6 +100,19 @@
    log_nrml("Logger system initialise ok\n");
    /*+------------------------------------------------------+
     *|               parser production ID                   |
     *+------------------------------------------------------+*/
    if( !(str=iniparser_getstring(ini, "common:id", NULL)) )
    {
        log_err("ERROR: Parser production ID failure\n");
        return -2;
    }
    /* cJSON parser ID will get ""  */
    snprintf(ctx->id, sizeof(ctx->id), "\"%s\"", str);
    log_nrml("Parser production ID [%s]\n", ctx->id);
    /*+------------------------------------------------------+
     *|              parser broker settings                  |