summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorManikandanChockalingam <manikandan.chockalingam@in.bosch.com>2018-05-18 11:17:31 +0530
committerChristoph Lipka <clipka@users.noreply.github.com>2018-05-18 07:47:31 +0200
commitda6eefe5cac244421c5af413c54e420717e11c9e (patch)
treee7eb7745fbc5e0edd3e2bede4d008a05250f1a18 /include
parentf549f5527148b32a15489aae75c9e4557e19cbd4 (diff)
downloadDLT-daemon-da6eefe5cac244421c5af413c54e420717e11c9e.tar.gz
IPC: Unix socket added (#43)
* IPC: Unix socket added The user can select either FIFO or UNIX socket as IPC between user library and daemon through CMakelist option. Socket path configurable for both FIFO and Unix Socket now configurable in CMake Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
Diffstat (limited to 'include')
-rw-r--r--include/dlt/dlt_common.h14
-rw-r--r--include/dlt/dlt_types.h10
-rw-r--r--include/dlt/dlt_user.h1
3 files changed, 25 insertions, 0 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h
index 550cc10..0b9fd8d 100644
--- a/include/dlt/dlt_common.h
+++ b/include/dlt/dlt_common.h
@@ -337,6 +337,11 @@ enum {
#define DLT_ENTRY_MAX 100
/**
+ * Maximal IPC path len
+ */
+#define DLT_IPC_PATH_MAX 100
+
+/**
* Provision to test static function
*/
#ifndef DLT_UNIT_TESTS
@@ -1085,6 +1090,13 @@ extern "C"
*/
int dlt_receiver_receive_fd(DltReceiver *receiver);
/**
+ * Receive data from file/fifo/socket, calls corresponding function based on
+ * CMake configuration.
+ * @param receiver pointer to dlt receiver structure
+ * @return number of received bytes or negative value if there was an error
+ */
+ int dlt_receiver_receive(DltReceiver *receiver);
+ /**
* Remove a specific size of bytes from the received data
* @param receiver pointer to dlt receiver structure
* @param size amount of bytes to be removed
@@ -1384,11 +1396,13 @@ extern "C"
*/
void dlt_check_envvar();
+#ifndef DLT_USE_UNIX_SOCKET_IPC
/**
* Create the specified path, recursive if necessary
* behaves like calling mkdir -p <dir> on the console
*/
int dlt_mkdir_recursive(const char *dir);
+#endif
#ifdef __cplusplus
}
diff --git a/include/dlt/dlt_types.h b/include/dlt/dlt_types.h
index 03cd036..2393174 100644
--- a/include/dlt/dlt_types.h
+++ b/include/dlt/dlt_types.h
@@ -178,4 +178,14 @@ typedef enum
typedef float float32_t;
typedef double float64_t;
+/**
+ * Definition Library connection state
+ */
+typedef enum
+{
+ DLT_USER_NOT_CONNECTED = 0,
+ DLT_USER_CONNECTED,
+ DLT_USER_RETRY_CONNECT
+} DltUserConnectionState;
+
#endif /* DLT_TYPES_H */
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h
index c5cc1ce..7b0aa8d 100644
--- a/include/dlt/dlt_user.h
+++ b/include/dlt/dlt_user.h
@@ -235,6 +235,7 @@ typedef struct
int corrupt_message_size;
int16_t corrupt_message_size_size;
#endif
+ DltUserConnectionState connection_state;
} DltUser;
/**************************************************************************************************