From 3cfb292aa43774428ce8dfe120fe16785942b086 Mon Sep 17 00:00:00 2001 From: ManikandanChockalingam Date: Thu, 15 Nov 2018 13:52:21 +0100 Subject: Log storage - Updates (#82) - improvements and refactor key creation - Sync strategies added Signed-off-by: ManikandanC Signed-off-by: Saya Sugiura Signed-off-by: S. Hameed Signed-off-by: Ravi Sankar P Signed-off-by: Christoph Lipka --- src/gateway/dlt_gateway.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/gateway/dlt_gateway.c') diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index 04237c2..dda1833 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -1293,3 +1293,32 @@ void dlt_gateway_send_control_message(DltGatewayConnection *con, dlt_message_free(&msg, verbose); } } + +DltGatewayConnection *dlt_gateway_get_connection(DltGateway *gateway, + char *ecu, + int verbose) +{ + DltGatewayConnection *con = NULL; + int i = 0; + + PRINT_FUNCTION_VERBOSE(verbose); + + if ((gateway == NULL) || (ecu == NULL)) + { + dlt_vlog(LOG_ERR, "%s: wrong parameter\n", __func__); + return con; + } + + for (i = 0; i < gateway->num_connections; i++) + { + con = &gateway->connections[i]; + if (strncmp(con->ecuid, ecu, DLT_ID_SIZE) == 0) + { + return con; + } + } + + dlt_vlog(LOG_ERR, "%s: No connection found\n", ecu); + + return con; +} -- cgit v1.2.1