summaryrefslogtreecommitdiff
path: root/src/gateway
diff options
context:
space:
mode:
authorManikandanChockalingam <manikandan.chockalingam@in.bosch.com>2018-11-15 13:52:21 +0100
committerChristoph Lipka <clipka@users.noreply.github.com>2018-11-15 13:52:21 +0100
commit3cfb292aa43774428ce8dfe120fe16785942b086 (patch)
tree00841761981aead232f5e6995eefde6babaddeb4 /src/gateway
parent6cbaa4fd39fb584a227b8eb7a3331dcfce54d9a3 (diff)
downloadDLT-daemon-3cfb292aa43774428ce8dfe120fe16785942b086.tar.gz
Log storage - Updates (#82)
- improvements and refactor key creation - Sync strategies added Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
Diffstat (limited to 'src/gateway')
-rw-r--r--src/gateway/dlt_gateway.c29
-rw-r--r--src/gateway/dlt_gateway.h12
2 files changed, 41 insertions, 0 deletions
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;
+}
diff --git a/src/gateway/dlt_gateway.h b/src/gateway/dlt_gateway.h
index 9fa2d6a..571a76a 100644
--- a/src/gateway/dlt_gateway.h
+++ b/src/gateway/dlt_gateway.h
@@ -175,6 +175,18 @@ void dlt_gateway_send_control_message(DltGatewayConnection *con,
DltDaemonLocal *daemon_local,
int verbose);
+/**
+ * Gets the connection handle of passive node with specified ECU
+ *
+ * @param g DltGateway
+ * @param ecu Identifier string
+ * @param verbose verbose flag
+ * @returns Gateway connection handle on success, NULL otherwise
+ */
+DltGatewayConnection *dlt_gateway_get_connection(DltGateway *g,
+ char *ecu,
+ int verbose);
+
/* _ONLY_ for development purposes */
void print_gateway_connection_details(const DltGateway *g);
#ifdef DLT_UNIT_TESTS