summaryrefslogtreecommitdiff
path: root/include/dlt/dlt_common.h
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 /include/dlt/dlt_common.h
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 'include/dlt/dlt_common.h')
-rw-r--r--include/dlt/dlt_common.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h
index 0b9fd8d..d76d190 100644
--- a/include/dlt/dlt_common.h
+++ b/include/dlt/dlt_common.h
@@ -208,6 +208,25 @@ enum {
#define DLT_SIZE_WTMS (sizeof(uint32_t))
/**
+ * Definitions for GET_LOG_INFO
+ */
+#define DLT_RECEIVE_TEXTBUFSIZE 1024 /* Size of buffer for text output */
+#define DLT_GET_LOG_INFO_HEADER 18 /*Get log info header size in response text */
+#define GET_LOG_INFO_LENGTH 13
+#define SERVICE_OPT_LENGTH 3
+
+/* checks if received size is big enough for expected data */
+#define DLT_CHECK_RCV_DATA_SIZE(received, required) \
+ ({ \
+ int _ret = DLT_RETURN_OK; \
+ if (((int)received - (int)required) < 0) { \
+ dlt_vlog(LOG_WARNING, "%s: Received data not complete\n", __func__); \
+ _ret = DLT_RETURN_ERROR; \
+ } \
+ _ret; \
+ })
+
+/**
* Get the size of extra header parameters, depends on htyp.
*/
#define DLT_STANDARD_HEADER_EXTRA_SIZE(htyp) ( (DLT_IS_HTYP_WEID(htyp) ? DLT_SIZE_WEID : 0) + (DLT_IS_HTYP_WSID(htyp) ? DLT_SIZE_WSID : 0) + (DLT_IS_HTYP_WTMS(htyp) ? DLT_SIZE_WTMS : 0) )
@@ -452,6 +471,46 @@ typedef struct
char com[DLT_ID_SIZE]; /**< communication interface */
} PACKED DltServiceGetLogInfoRequest;
+typedef struct
+{
+ uint32_t service_id; /**< service ID */
+} PACKED DltServiceGetDefaultLogLevelRequest;
+
+/**
+ * The structure of the DLT Service Get Log Info response.
+ */
+typedef struct
+{
+ char context_id[DLT_ID_SIZE];
+ int16_t log_level;
+ int16_t trace_status;
+ uint16_t len_context_description;
+ char *context_description;
+} ContextIDsInfoType;
+
+typedef struct
+{
+ char app_id[DLT_ID_SIZE];
+ uint16_t count_context_ids;
+ ContextIDsInfoType *context_id_info; /**< holds info about a specific con id */
+ uint16_t len_app_description;
+ char *app_description;
+} AppIDsType;
+
+typedef struct
+{
+ uint16_t count_app_ids;
+ AppIDsType *app_ids; /**< holds info about a specific app id */
+} LogInfoType;
+
+typedef struct
+{
+ uint32_t service_id; /**< service ID */
+ uint8_t status; /**< type of request */
+ LogInfoType log_info_type; /**< log info type */
+ char com[DLT_ID_SIZE]; /**< communication interface */
+} DltServiceGetLogInfoResponse;
+
/**
* The structure of the DLT Service Set Log Level.
*/
@@ -1396,6 +1455,50 @@ extern "C"
*/
void dlt_check_envvar();
+ /**
+ * Parse the response text and identifying service id and its options.
+ *
+ * @param resp_text char *
+ * @param service_id int *
+ * @param service_opt int *
+ * @return pointer to resp_text
+ */
+ int dlt_set_loginfo_parse_service_id(char *resp_text, uint32_t *service_id, uint8_t *service_opt);
+
+ /**
+ * Convert get log info from ASCII to uint16
+ *
+ * @param rp char
+ * @param rp_count int
+ * @return length
+ */
+ int16_t dlt_getloginfo_conv_ascii_to_uint16_t(char *rp, int *rp_count);
+
+ /**
+ * Convert get log info from ASCII to int16
+ *
+ * @param rp char
+ * @param rp_count int
+ * @return length
+ */
+ int16_t dlt_getloginfo_conv_ascii_to_int16_t(char *rp, int *rp_count);
+
+ /**
+ * Convert get log info from ASCII to ID
+ *
+ * @param rp char
+ * @param rp_count int
+ */
+ void dlt_getloginfo_conv_ascii_to_id(char *rp, int *rp_count, char *wp, int len);
+
+ /**
+ * Convert from hex ASCII to binary
+ * @param ptr const char
+ * @param binary uint8_t
+ * @param size int
+ */
+ void dlt_hex_ascii_to_binary(const char *ptr, uint8_t *binary, int *size);
+
#ifndef DLT_USE_UNIX_SOCKET_IPC
/**
* Create the specified path, recursive if necessary