From 716ecb8e223f1c89ca2a6200091ad15febb09144 Mon Sep 17 00:00:00 2001 From: Saya Sugiura <39760799+ssugiura@users.noreply.github.com> Date: Mon, 2 Sep 2019 14:32:09 +0900 Subject: protocol: Remove non supported user service ID (#159) With this commit, following DLT user service IDs are now free to use: - 0xF0A - 0xF0F to 0xFFE Also the cases in dlt_daemon_client_process_control() is reordered so that it matches the order of dlt_user_services enum. Signed-off-by: Saya Sugiura --- include/dlt/dlt_protocol.h | 14 ++++++++------ src/daemon/dlt_daemon_client.c | 22 +++++++++++----------- src/shared/dlt_protocol.c | 10 +++++++--- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/include/dlt/dlt_protocol.h b/include/dlt/dlt_protocol.h index 083a0f5..1e57962 100644 --- a/include/dlt/dlt_protocol.h +++ b/include/dlt/dlt_protocol.h @@ -208,12 +208,14 @@ enum dlt_user_services { DLT_SERVICE_ID_TIMEZONE = 0xF03, DLT_SERVICE_ID_MARKER = 0xF04, DLT_SERVICE_ID_OFFLINE_LOGSTORAGE = 0xF05, - DLT_SERVICE_ID_SET_FILTER_LEVEL = 0xF06, - DLT_SERVICE_ID_GET_FILTER_STATUS = 0xF07, - DLT_SERVICE_ID_PASSIVE_NODE_CONNECT = 0xF08, - DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS = 0xF09, - DLT_SERVICE_ID_SET_ALL_LOG_LEVEL = 0xF0A, - DLT_SERVICE_ID_SET_ALL_TRACE_STATUS = 0xF0B, + DLT_SERVICE_ID_PASSIVE_NODE_CONNECT = 0xF06, + DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS = 0xF07, + DLT_SERVICE_ID_SET_ALL_LOG_LEVEL = 0xF08, + DLT_SERVICE_ID_SET_ALL_TRACE_STATUS = 0xF09, + DLT_SERVICE_ID_RESERVED_B = 0xF0B, + DLT_SERVICE_ID_RESERVED_C = 0xF0C, + DLT_SERVICE_ID_RESERVED_D = 0xF0D, + DLT_SERVICE_ID_RESERVED_E = 0xF0E, DLT_USER_SERVICE_ID_LAST_ENTRY }; diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 5fe0215..324f6b1 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -453,7 +453,7 @@ int dlt_daemon_client_process_control(int sock, id_tmp = *((uint32_t *)(msg->databuffer)); id = DLT_ENDIAN_GET_32(msg->standardheader->htyp, id_tmp); - if ((id > 0) && (id < DLT_SERVICE_ID_CALLSW_CINJECTION)) { + if ((id > DLT_SERVICE_ID) && (id < DLT_SERVICE_ID_CALLSW_CINJECTION)) { /* Control message handling */ switch (id) { case DLT_SERVICE_ID_SET_LOG_LEVEL: @@ -631,16 +631,6 @@ int dlt_daemon_client_process_control(int sock, verbose); break; } - case DLT_SERVICE_ID_SET_ALL_LOG_LEVEL: - { - dlt_daemon_control_set_all_log_level(sock, daemon, daemon_local, msg, verbose); - break; - } - case DLT_SERVICE_ID_SET_ALL_TRACE_STATUS: - { - dlt_daemon_control_set_all_trace_status(sock, daemon, daemon_local, msg, verbose); - break; - } case DLT_SERVICE_ID_OFFLINE_LOGSTORAGE: { dlt_daemon_control_service_logstorage(sock, daemon, daemon_local, msg, verbose); @@ -663,6 +653,16 @@ int dlt_daemon_client_process_control(int sock, verbose); break; } + case DLT_SERVICE_ID_SET_ALL_LOG_LEVEL: + { + dlt_daemon_control_set_all_log_level(sock, daemon, daemon_local, msg, verbose); + break; + } + case DLT_SERVICE_ID_SET_ALL_TRACE_STATUS: + { + dlt_daemon_control_set_all_trace_status(sock, daemon, daemon_local, msg, verbose); + break; + } default: { dlt_daemon_control_service_response(sock, diff --git a/src/shared/dlt_protocol.c b/src/shared/dlt_protocol.c index 2468a89..fc6dea4 100644 --- a/src/shared/dlt_protocol.c +++ b/src/shared/dlt_protocol.c @@ -57,11 +57,15 @@ const char *const dlt_user_service_names[] = { "DLT_SERVICE_ID_TIMEZONE", "DLT_SERVICE_ID_MARKER", "DLT_SERVICE_ID_OFFLINE_LOGSTORAGE", - "DLT_SERVICE_ID_SET_FILTER_LEVEL", - "DLT_SERVICE_ID_GET_FILTER_STATUS", "DLT_SERVICE_ID_PASSIVE_NODE_CONNECT", "DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS", - "DLT_SERVICE_ID_SET_ALL_LOG_LEVEL" + "DLT_SERVICE_ID_SET_ALL_LOG_LEVEL", + "DLT_SERVICE_ID_SET_ALL_TRACE_STATUS", + "DLT_SERVICE_ID_UNDEFINED", /* 0xF0A is not defined */ + "DLT_SERVICE_ID_RESERVED", + "DLT_SERVICE_ID_RESERVED", + "DLT_SERVICE_ID_RESERVED", + "DLT_SERVICE_ID_RESERVED" }; const char *dlt_get_service_name(unsigned int id) -- cgit v1.2.1