diff options
author | S. Hameed <shameed@jp.adit-jv.com> | 2015-03-20 18:01:24 +0900 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2015-04-01 10:13:01 +0200 |
commit | 2cec5d20ae0b5361a84bfb8170335f2502ddd88f (patch) | |
tree | 553b38fee8d08e13fec37ce7e47eab2a3cef18a9 | |
parent | 3c89cdf9ca2aae9e0a602997ed0245692ddf976a (diff) | |
download | DLT-daemon-2cec5d20ae0b5361a84bfb8170335f2502ddd88f.tar.gz |
Add Service ID Last entry to avoid further modifications in dependent code
Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
-rwxr-xr-x | include/dlt/dlt_protocol.h | 1 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_client.c | 2 | ||||
-rwxr-xr-x | src/shared/dlt_common.c | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/include/dlt/dlt_protocol.h b/include/dlt/dlt_protocol.h index b4fff5c..7bf8b1c 100755 --- a/include/dlt/dlt_protocol.h +++ b/include/dlt/dlt_protocol.h @@ -189,6 +189,7 @@ #define DLT_SERVICE_ID_SET_DEFAULT_TRACE_STATUS 0x12 /**< Service ID: Set default trace status */
#define DLT_SERVICE_ID_GET_SOFTWARE_VERSION 0x13 /**< Service ID: Get software version */
#define DLT_SERVICE_ID_MESSAGE_BUFFER_OVERFLOW 0x14 /**< Service ID: Message buffer overflow */
+#define DLT_SERVICE_ID_LAST_ENTRY 0x15 /**< Service ID: Last entry to avoid any further modifications in dependent code */ #define DLT_SERVICE_ID_UNREGISTER_CONTEXT 0xf01 /**< Service ID: Message unregister context */
#define DLT_SERVICE_ID_CONNECTION_INFO 0xf02 /**< Service ID: Message connection info */
#define DLT_SERVICE_ID_TIMEZONE 0xf03 /**< Service ID: Timezone */
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 00ad5b9..6fde373 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -299,7 +299,7 @@ int dlt_daemon_client_process_control(int sock, DltDaemon *daemon, DltDaemonLoca id_tmp = *((uint32_t*)(msg->databuffer)); id=DLT_ENDIAN_GET_32(msg->standardheader->htyp ,id_tmp); - if ((id > 0) && (id <= DLT_SERVICE_ID_MESSAGE_BUFFER_OVERFLOW)) + if ((id > 0) && (id < DLT_SERVICE_ID_LAST_ENTRY)) { /* Control message handling */ switch (id) diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 194f548..dce48c6 100755 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -953,7 +953,7 @@ int dlt_message_payload(DltMessage *msg,char *text,int textlength,int type,int v /* process message id / service id */ if (DLT_MSG_IS_CONTROL(msg)) { - if (id > 0 && id <= DLT_SERVICE_ID_MESSAGE_BUFFER_OVERFLOW) + if (id > 0 && id < DLT_SERVICE_ID_LAST_ENTRY) { snprintf(text+strlen(text),textlength-strlen(text),"%s",service_id[id]); /* service id */ } |