src/config_mqtt.c
IG_Status IG_Config_MQTT_get_conn_string(IG_Config * config, unsigned char * buffer) {
    unsigned char * proto = NULL;
    unsigned char * hostname = NULL;
    unsigned char * port = NULL;

    IG_Status rt1 = IG_Config_get_node_attribute(config, IG_CONFIG_MQTT_BROKER_XPATH, IG_CONFIG_MQTT_PROTOCOL_VARNAME, &proto);
    IG_Status rt2 = IG_Config_get_node_attribute(config, IG_CONFIG_MQTT_BROKER_XPATH, IG_CONFIG_MQTT_HOST_VARNAME, &hostname);
    IG_Status rt3 = IG_Config_get_node_attribute(config, IG_CONFIG_MQTT_BROKER_XPATH, IG_CONFIG_MQTT_PORT_VARNAME, &port);
    
    if(rt1 != IG_STATUS_GOOD || rt2 != IG_STATUS_GOOD || rt3 != IG_STATUS_GOOD) {
        printf("some needed attributes are missing");
        return IG_STATUS_BAD;
    }

   


    snprintf(buffer, 100, IG_CONFIG_MQTT_CONN_STRING_FORMAT, proto, hostname, port);
    return IG_STATUS_GOOD;
}
//gets/builds the connectionstring and writes it (max 100 char) to the buffer
gets/builds the connectionstring and writes it (max 100 char) to the buffer
gets / builds the connectionstring and writes it ( max 100 char ) to the buffer
IG_Status IG_Config_MQTT_get_conn_string(IG_Config * config, unsigned char * buffer) {
    unsigned char * proto = NULL;
    unsigned char * hostname = NULL;
    unsigned char * port = NULL;
    IG_Status rt1 = IG_Config_get_node_attribute(config, IG_CONFIG_MQTT_BROKER_XPATH, IG_CONFIG_MQTT_PROTOCOL_VARNAME, &proto);
    IG_Status rt2 = IG_Config_get_node_attribute(config, IG_CONFIG_MQTT_BROKER_XPATH, IG_CONFIG_MQTT_HOST_VARNAME, &hostname);
    IG_Status rt3 = IG_Config_get_node_attribute(config, IG_CONFIG_MQTT_BROKER_XPATH, IG_CONFIG_MQTT_PORT_VARNAME, &port);
    if(rt1 != IG_STATUS_GOOD || rt2 != IG_STATUS_GOOD || rt3 != IG_STATUS_GOOD) {
        printf("some needed attributes are missing");
        return IG_STATUS_BAD;
    }
    snprintf(buffer, 100, IG_CONFIG_MQTT_CONN_STRING_FORMAT, proto, hostname, port);
    return IG_STATUS_GOOD;
}
IG_Status IG_Config_MQTT_get_conn_string ( IG_Config * config , unsigned char * buffer ) { unsigned char * proto = NULL ; unsigned char * hostname = NULL ; unsigned char * port = NULL ; IG_Status rt1 = IG_Config_get_node_attribute ( config , IG_CONFIG_MQTT_BROKER_XPATH , IG_CONFIG_MQTT_PROTOCOL_VARNAME , & proto ) ; IG_Status rt2 = IG_Config_get_node_attribute ( config , IG_CONFIG_MQTT_BROKER_XPATH , IG_CONFIG_MQTT_HOST_VARNAME , & hostname ) ; IG_Status rt3 = IG_Config_get_node_attribute ( config , IG_CONFIG_MQTT_BROKER_XPATH , IG_CONFIG_MQTT_PORT_VARNAME , & port ) ; if ( rt1 != IG_STATUS_GOOD || rt2 != IG_STATUS_GOOD || rt3 != IG_STATUS_GOOD ) { printf ( " " ) ; return IG_STATUS_BAD ; } snprintf ( buffer , 100 , IG_CONFIG_MQTT_CONN_STRING_FORMAT , proto , hostname , port ) ; return IG_STATUS_GOOD ; }
gets/builds the connectionstring and writes it (max 100 char) to the buffer
gets / builds the connectionstring and writes it ( max 100 char ) to the buffer