diff options
author | Christoph Lipka <clipka@jp.adit-jv.com> | 2016-10-12 12:20:55 +0900 |
---|---|---|
committer | Christoph Lipka <clipka@jp.adit-jv.com> | 2016-10-24 13:39:56 +0900 |
commit | 3894a8d101a7be0f67262de8af3746a768433fed (patch) | |
tree | 179f8c486d834e3f2e53826b03bcb8fc9e51123e /src/gateway | |
parent | c739c8ce49e9a285de6cf2c5df73c974dd8bab2e (diff) | |
download | DLT-daemon-3894a8d101a7be0f67262de8af3746a768433fed.tar.gz |
MultiNode: Specify config file location in dlt.conf
Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
Diffstat (limited to 'src/gateway')
-rw-r--r-- | src/gateway/dlt_gateway.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index edae0c7..99eabd8 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -442,11 +442,12 @@ int dlt_gateway_store_connection(DltGateway *gateway, /** * Read configuration file and initialize connection data structures * - * @param g DltGateway - * @param verbose verbose flag + * @param gateway DltGateway + * @param config_file Gateway configuration + * @param verbose verbose flag * @return 0 on success, -1 otherwise */ -int dlt_gateway_configure(DltGateway *gateway, int verbose) +int dlt_gateway_configure(DltGateway *gateway, char *config_file, int verbose) { int ret = 0; int i = 0; @@ -454,13 +455,13 @@ int dlt_gateway_configure(DltGateway *gateway, int verbose) PRINT_FUNCTION_VERBOSE(verbose); - if (gateway == NULL) + if (gateway == NULL || config_file == 0 || config_file[0] == '\0') { return -1; } /* read configuration file */ - file = dlt_config_file_init(DLT_GATEWAY_CONFIG_PATH); + file = dlt_config_file_init(config_file); /* get number of entries and allocate memory to store information */ ret = dlt_config_file_get_num_sections(file, &gateway->num_connections); @@ -584,7 +585,9 @@ int dlt_gateway_init(DltDaemonLocal *daemon_local, int verbose) /* Get default value from daemon_local */ gateway->send_serial = daemon_local->flags.lflag; - if (dlt_gateway_configure(gateway, verbose) != 0) + if (dlt_gateway_configure(gateway, + daemon_local->flags.gatewayConfigFile, + verbose) != 0) { dlt_log(LOG_ERR, "Gateway initialization failed\n"); return -1; |