| | |
| | | if( !(str=iniparser_getstring(ini, "publisher:pubTopic", NULL)) ) |
| | | { |
| | | log_warn("WARNNING: Parser MQTT publisher topic failure\n"); |
| | | return 0; |
| | | } |
| | | else |
| | | |
| | | |
| | | mqtt_ctx->pub_enable = iniparser_getint(ini, "publisher:enable", 0); |
| | | if( !mqtt_ctx->pub_enable ) |
| | | { |
| | | strncpy(mqtt_ctx->pubTopic, str, sizeof(mqtt_ctx->pubTopic) ); |
| | | mqtt_ctx->pubQos = iniparser_getint(ini, "publisher:pubQos", 0); |
| | | mqtt_ctx->interval = iniparser_getint(ini, "publisher:interval", 60); |
| | | mqtt_ctx->pub_enable = 1; |
| | | |
| | | log_info("Parser publisher topic \"%s\" with Qos[%d]\n", mqtt_ctx->pubTopic, mqtt_ctx->pubQos); |
| | | log_warn("WARNNING: Parser MQTT publisher disabled\n"); |
| | | return 0; |
| | | } |
| | | |
| | | strncpy(mqtt_ctx->pubTopic, str, sizeof(mqtt_ctx->pubTopic) ); |
| | | mqtt_ctx->pubQos = iniparser_getint(ini, "publisher:pubQos", 0); |
| | | mqtt_ctx->interval = iniparser_getint(ini, "publisher:interval", 60); |
| | | |
| | | log_info("Parser publisher topic \"%s\" with Qos[%d]\n", mqtt_ctx->pubTopic, mqtt_ctx->pubQos); |
| | | |
| | | return 0; |
| | | } |