diff options
Diffstat (limited to 'src/lib/dlt_client.c')
-rw-r--r-- | src/lib/dlt_client.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/lib/dlt_client.c b/src/lib/dlt_client.c index 20291d5..2b37598 100644 --- a/src/lib/dlt_client.c +++ b/src/lib/dlt_client.c @@ -498,7 +498,7 @@ DltReturnValue dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *cti msg.standardheader->len = DLT_HTOBE_16(len); /* Send data (without storage header) */ - if (client->mode) + if ((client->mode == DLT_CLIENT_MODE_TCP) || (client->mode == DLT_CLIENT_MODE_SERIAL)) { /* via FileDescriptor */ ret=write(client->sock, msg.headerbuffer+sizeof(DltStorageHeader),msg.headersize-sizeof(DltStorageHeader)); @@ -697,6 +697,36 @@ DltReturnValue dlt_client_send_default_log_level(DltClient *client, uint8_t defa return DLT_RETURN_OK; } +DltReturnValue dlt_client_send_all_log_level(DltClient *client, uint8_t LogLevel) +{ + DltServiceSetDefaultLogLevel *req; + uint8_t *payload; + + payload = (uint8_t *) malloc(sizeof(DltServiceSetDefaultLogLevel)); + + if (payload == 0) + { + return DLT_RETURN_ERROR; + } + + req = (DltServiceSetDefaultLogLevel *) payload; + + req->service_id = DLT_SERVICE_ID_SET_ALL_LOG_LEVEL; + req->log_level = LogLevel; + dlt_set_id(req->com, "remo"); + + /* free message */ + if (dlt_client_send_ctrl_msg(client, "APP", "CON", payload, sizeof(DltServiceSetDefaultLogLevel)) == -1) + { + free(payload); + return DLT_RETURN_ERROR; + } + + free(payload); + + return DLT_RETURN_OK; +} + DltReturnValue dlt_client_send_default_trace_status(DltClient *client, uint8_t defaultTraceStatus) { DltServiceSetDefaultLogLevel *req; |