summaryrefslogtreecommitdiff
path: root/include
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
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')
-rw-r--r--include/dlt/dlt_client.h27
-rw-r--r--include/dlt/dlt_common.h103
-rw-r--r--include/dlt/dlt_protocol.h9
3 files changed, 139 insertions, 0 deletions
diff --git a/include/dlt/dlt_client.h b/include/dlt/dlt_client.h
index 8943184..e56c9ff 100644
--- a/include/dlt/dlt_client.h
+++ b/include/dlt/dlt_client.h
@@ -180,6 +180,18 @@ DltReturnValue dlt_client_send_log_level(DltClient *client, char *apid, char *ct
*/
int dlt_client_get_log_info(DltClient *client);
/**
+ * Send an request to get default log level to the dlt daemon
+ * @param client pointer to dlt client structure
+ * @return negative value if there was an error
+ */
+DltReturnValue dlt_client_get_default_log_level(DltClient *client);
+/**
+ * Send an request to get software version to the dlt daemon
+ * @param client pointer to dlt client structure
+ * @return negative value if there was an error
+ */
+int dlt_client_get_software_version(DltClient *client);
+/**
* Initialise get log info structure
* @param void
* @return void
@@ -280,6 +292,21 @@ int dlt_client_set_serial_device(DltClient *client, char *serial_device);
*/
int dlt_client_set_socket_path(DltClient *client, char *socket_path);
+/**
+ * Parse GET_LOG_INFO response text
+ * @param resp GET_LOG_INFO response
+ * @param resp_text response text represented by ASCII
+ * @return 0 on success, -1 otherwise
+ */
+int dlt_client_parse_get_log_info_resp_text(DltServiceGetLogInfoResponse *resp,
+ char *resp_text);
+
+/**
+ * Free memory allocated for get log info message
+ * @param resp response
+ * @return 0 on success, -1 otherwise
+ */
+int dlt_client_cleanup_get_log_info(DltServiceGetLogInfoResponse *resp);
#ifdef __cplusplus
}
#endif
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
diff --git a/include/dlt/dlt_protocol.h b/include/dlt/dlt_protocol.h
index 7c194b1..53dea25 100644
--- a/include/dlt/dlt_protocol.h
+++ b/include/dlt/dlt_protocol.h
@@ -221,6 +221,15 @@
#define DLT_CONNECTION_STATUS_DISCONNECTED 0x01 /**< Client is disconnected */
#define DLT_CONNECTION_STATUS_CONNECTED 0x02 /**< Client is connected */
+/*
+ * Definitions of DLT GET_LOG_INFO status
+ */
+#define GET_LOG_INFO_STATUS_MIN 3
+#define GET_LOG_INFO_STATUS_MAX 7
+#define GET_LOG_INFO_STATUS_NO_MATCHING_CTX 8
+#define GET_LOG_INFO_STATUS_RESP_DATA_OVERFLOW 9
+
+
/**
\}
*/