summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_offline_logstorage.c
diff options
context:
space:
mode:
authorManikandan C <mchockalingam@de.adit-jv.com>2018-10-29 16:32:17 +0100
committerChristoph Lipka <clipka@users.noreply.github.com>2018-11-23 11:10:47 +0100
commitd515020fa1bcb5d874084a68c9de9434dc9d994e (patch)
tree339074f3d4e0858dfbe1c528705ed3e4343521f3 /src/daemon/dlt_daemon_offline_logstorage.c
parent3cfb292aa43774428ce8dfe120fe16785942b086 (diff)
downloadDLT-daemon-d515020fa1bcb5d874084a68c9de9434dc9d994e.tar.gz
Gateway Improvements
-Support to send and parse periodic control messages -add application/contexts to passive ECU list -Refactor dlt_gateway_send_control_message -Gateway issues with corrupted data and on demand connection -Unit Test update Signed-off-by: Saya Sugiura ssugiura@jp.adit-jv.com Signed-off-by: Christoph Lipka clipka@jp.adit-jv.com Signed-off-by: S. Hameed shameed@jp.adit-jv.com Signed-off-by: ManikandanC Manikandan.Chockalingam@in.bosch.com
Diffstat (limited to 'src/daemon/dlt_daemon_offline_logstorage.c')
-rw-r--r--src/daemon/dlt_daemon_offline_logstorage.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/src/daemon/dlt_daemon_offline_logstorage.c b/src/daemon/dlt_daemon_offline_logstorage.c
index fe4d8a7..109cc73 100644
--- a/src/daemon/dlt_daemon_offline_logstorage.c
+++ b/src/daemon/dlt_daemon_offline_logstorage.c
@@ -347,15 +347,47 @@ STATIC DltReturnValue dlt_daemon_logstorage_update_passive_node_context(
int loglevel,
int verbose)
{
- // Need to be updated
- // To avoid compiler warning
- (void) daemon_local;
- (void) apid;
- (void) ctid;
- (void) ecuid;
- (void) loglevel;
- (void) verbose;
+ DltServiceSetLogLevel req = {0};
+ DltPassiveControlMessage ctrl = {0};
+ DltGatewayConnection *con = NULL;
+ PRINT_FUNCTION_VERBOSE(verbose);
+
+ if ((daemon_local == NULL) || (apid == NULL) || (ctid == NULL) || (ecuid == NULL) ||
+ (loglevel > DLT_LOG_VERBOSE) || (loglevel < DLT_LOG_DEFAULT))
+ {
+ dlt_vlog(LOG_ERR, "%s: Wrong parameter\n", __func__);
+ return DLT_RETURN_WRONG_PARAMETER;
+ }
+
+ con = dlt_gateway_get_connection(&daemon_local->pGateway, ecuid, verbose);
+
+ if (con == NULL)
+ {
+ dlt_vlog(LOG_ERR,
+ "Failed to fond connection to passive node %s\n",
+ ecuid);
+ return DLT_RETURN_ERROR;
+ }
+
+ ctrl.id = DLT_SERVICE_ID_SET_LOG_LEVEL;
+ ctrl.type = CONTROL_MESSAGE_ON_DEMAND;
+
+ dlt_set_id(req.apid, apid);
+ dlt_set_id(req.ctid, ctid);
+
+ req.log_level = loglevel;
+
+ if (dlt_gateway_send_control_message(con, &ctrl, (void *) &req, verbose) != 0)
+ {
+ dlt_vlog(LOG_ERR,
+ "Failed to forward SET_LOG_LEVEL message to passive node %s\n",
+ ecuid);
+
+ return DLT_RETURN_ERROR;
+ }
+
+ return DLT_RETURN_OK;
return DLT_RETURN_OK;
}