guowenxue
2021-04-21 e0e3a637e92dbe3c7700cc541410ff19b3b0c80c
iotd/conf/conf.c
@@ -266,14 +266,16 @@
    if( !(str=iniparser_getstring(ini, "subsciber:subTopic", NULL)) )
    {
        log_err("ERROR: Parser MQTT subscribe topic failure\n");
        return -2;
        log_warn("WARNNING: Parser MQTT subscribe topic failure\n");
    }
    else
    {
    strncpy(mqtt_ctx->subTopic, str, sizeof(mqtt_ctx->subTopic) );
    mqtt_ctx->subQos = iniparser_getint(ini, "subsciber:subQos", 0);
    log_nrml("Parser subscriber topic \"%s\" with Qos[%d]\n", mqtt_ctx->subTopic, mqtt_ctx->subQos);
    mqtt_ctx->sub_enable = 1;
        log_nrml("Parser subscriber topic \"%s\" with Qos[%d]\n", mqtt_ctx->subTopic, mqtt_ctx->subQos);
    }
    /*+------------------------------------------------------+
     *|             parser publisher settings                |
@@ -281,15 +283,17 @@
    if( !(str=iniparser_getstring(ini, "publisher:pubTopic", NULL)) )
    {
        log_err("ERROR: Parser MQTT publisher topic failure\n");
        return -2;
        log_warn("WARNNING: Parser MQTT publisher topic failure\n");
    }
    else
    {
    strncpy(mqtt_ctx->pubTopic, str, sizeof(mqtt_ctx->pubTopic) );
    mqtt_ctx->pubQos = iniparser_getint(ini, "publisher:pubQos", 0);
    log_nrml("Parser publisher topic \"%s\" with Qos[%d]\n", mqtt_ctx->pubTopic, mqtt_ctx->pubQos);
    mqtt_ctx->pub_enable = 1;
        log_nrml("Parser publisher topic \"%s\" with Qos[%d]\n", mqtt_ctx->pubTopic, mqtt_ctx->pubQos);
    }
    return 0;
}