automotive-dlt
dlt_gateway_types.h
Go to the documentation of this file.
1 /*
2  * @licence app begin@
3  * SPDX license identifier: MPL-2.0
4  *
5  * Copyright (C) 2015 Advanced Driver Information Technology.
6  * This code is developed by Advanced Driver Information Technology.
7  * Copyright of Advanced Driver Information Technology, Bosch and DENSO.
8  *
9  * This file is part of GENIVI Project DLT - Diagnostic Log and Trace.
10  *
11  * This Source Code Form is subject to the terms of the
12  * Mozilla Public License (MPL), v. 2.0.
13  * If a copy of the MPL was not distributed with this file,
14  * You can obtain one at http://mozilla.org/MPL/2.0/.
15  *
16  * For further information see http://www.genivi.org/.
17  * @licence end@
18  */
19 
30 /*******************************************************************************
31 ** **
32 ** SRC-MODULE: dlt_gateway_types.h **
33 ** **
34 ** TARGET : linux **
35 ** **
36 ** PROJECT : DLT **
37 ** **
38 ** AUTHOR : Christoph Lipka clipka@jp.adit-jv.com **
39 ** PURPOSE : **
40 ** **
41 ** REMARKS : **
42 ** **
43 ** PLATFORM DEPENDANT [yes/no]: yes **
44 ** **
45 ** TO BE CHANGED BY USER [yes/no]: no **
46 ** **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Author Identity **
51 ********************************************************************************
52 ** **
53 ** Initials Name Company **
54 ** -------- ------------------------- ---------------------------------- **
55 ** cl Christoph Lipka ADIT **
56 *******************************************************************************/
57 
58 #ifndef DLT_GATEWAY_TYPES_H_
59 #define DLT_GATEWAY_TYPES_H_
60 
61 #include "dlt_client.h"
62 
63 #define DLT_GATEWAY_CONFIG_PATH CONFIGURATION_FILES_DIR "/dlt_gateway.conf"
64 #define DLT_GATEWAY_TIMER_INTERVAL 1
65 
66 #define DLT_GATEWAY_RECONNECT_MAX 1 /* reconnect once after connection loss */
67 
68 /* maximum number of control messages that can be send after connection is
69  * established */
70 #define DLT_GATEWAY_MAX_STARTUP_CTRL_MSG 10
71 
72 typedef enum
73 {
79 
80 typedef enum
81 {
83  DLT_GATEWAY_ON_STARTUP, /* connect directly on startup */
84  DLT_GATEWAY_ON_DEMAND, /* connect on demand only */
85  DLT_GATEWAY_DISABLED /* disable this connection due to problems */
87 
88 /* DLT Gateway connection structure */
89 typedef struct {
90  int handle; /* connection handle */
91  connection_status status; /* connected/disconnected */
92  char *ecuid; /* name of passive node */
93  char *ip_address; /* IP address */
94  int sock_domain; /* socket domain */
95  int sock_type; /* socket type */
96  int sock_protocol; /* socket protocol */
97  int port; /* port */
98  connection_trigger trigger; /* connection trigger */
99  int timeout; /* connection timeout */
100  int timeout_cnt; /* connection timeout counter */
101  int reconnect_cnt; /* reconnection counter */
102  int control_msgs[DLT_GATEWAY_MAX_STARTUP_CTRL_MSG]; /* msg IDs send on startup */
103  int send_serial; /* Send serial header with control messages */
104  DltClient client; /* DltClient structure */
106 
107 /* DltGateway structure */
108 typedef struct
109 {
110  int send_serial; /* Default: Send serial header with control messages */
111  DltGatewayConnection *connections; /* pointer to connections */
112  int num_connections; /* number of connections */
113 } DltGateway;
114 
115 #endif /* DLT_GATEWAY_TYPES_H_ */
connection_status
connection_trigger
connection_trigger trigger
DltGatewayConnection * connections
connection_status status
#define DLT_GATEWAY_MAX_STARTUP_CTRL_MSG