diff options
author | Yusuke Sato <yusuke-sato@apn.alpine.co.jp> | 2018-05-18 14:35:31 +0900 |
---|---|---|
committer | Christoph Lipka <clipka@users.noreply.github.com> | 2018-05-18 07:35:31 +0200 |
commit | f549f5527148b32a15489aae75c9e4557e19cbd4 (patch) | |
tree | f6586dd95fb402bfd396b006e876c2d18dc5d38b /src/lib/dlt_client.c | |
parent | 89639e55c39687af398bdf9fbaf000338a5cb7db (diff) | |
download | DLT-daemon-f549f5527148b32a15489aae75c9e4557e19cbd4.tar.gz |
Introduce controlling entire system trace status feature from dlt-control (#57)
* dlt-control: Provision to control entire system trace status
1. support for setting trace status using wildcards for both app and context
2. support for setting entire system trace status
*This Logic is as same as for changing log level.
(SHA: a966393ad7003d02870bceffa08df5ddf4bbf864
dlt-control: Provision to control entire system log level)
* dlt-daemon: Fix control entire log level / trace status issue
In previous, dlt-control could send request to set
all log level / trace status with DLT_LOG_DEFAULT / DLT_TRACE_STATUS_DEFAULT(-1).
However, dlt-daemon could not accept these value.
This change fix this issue so that setting log level/trace status of
all registered contexts become possible.
Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
Diffstat (limited to 'src/lib/dlt_client.c')
-rw-r--r-- | src/lib/dlt_client.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/dlt_client.c b/src/lib/dlt_client.c index fadd789..8a6595e 100644 --- a/src/lib/dlt_client.c +++ b/src/lib/dlt_client.c @@ -765,6 +765,43 @@ DltReturnValue dlt_client_send_default_trace_status(DltClient *client, uint8_t d return DLT_RETURN_OK; } +DltReturnValue dlt_client_send_all_trace_status(DltClient *client, uint8_t traceStatus) +{ + DltServiceSetDefaultLogLevel *req; + uint8_t *payload; + + if (client == NULL) + { + dlt_vlog(LOG_ERR, "%s: Invalid parameters\n", __func__); + return DLT_RETURN_ERROR; + } + + payload = (uint8_t *) malloc(sizeof(DltServiceSetDefaultLogLevel)); + + if (payload == 0) + { + dlt_vlog(LOG_ERR, "%s: Could not allocate memory %d\n", __func__, sizeof(DltServiceSetDefaultLogLevel)); + return DLT_RETURN_ERROR; + } + + req = (DltServiceSetDefaultLogLevel *) payload; + + req->service_id = DLT_SERVICE_ID_SET_ALL_TRACE_STATUS; + req->log_level = traceStatus; + 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_timing_pakets(DltClient *client, uint8_t timingPakets) { DltServiceSetVerboseMode *req; |