summaryrefslogtreecommitdiff
path: root/src/gateway/dlt_gateway_types.h
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>2020-02-20 18:11:43 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commitc215d96ee6543fbc9429a1962c7d7b58593977ea (patch)
tree94da4773639060f6efdcd4001d7053155902a287 /src/gateway/dlt_gateway_types.h
parent1d448c10b397e262c813d70864d05fdedeb66062 (diff)
downloadDLT-daemon-c215d96ee6543fbc9429a1962c7d7b58593977ea.tar.gz
gateway: Configurable interval time
- Introduce "General" section for dlt_gateway.conf - In new section, the interval is used for gateway timer. This entry is optional. By default, it is set to 1 second as the existing hardcoded value. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
Diffstat (limited to 'src/gateway/dlt_gateway_types.h')
-rw-r--r--src/gateway/dlt_gateway_types.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gateway/dlt_gateway_types.h b/src/gateway/dlt_gateway_types.h
index 0fca7cf..1a7f645 100644
--- a/src/gateway/dlt_gateway_types.h
+++ b/src/gateway/dlt_gateway_types.h
@@ -60,7 +60,8 @@
#include "dlt_client.h"
#define DLT_GATEWAY_CONFIG_PATH CONFIGURATION_FILES_DIR "/dlt_gateway.conf"
-#define DLT_GATEWAY_TIMER_INTERVAL 1
+#define DLT_GATEWAY_TIMER_DEFAULT_INTERVAL 1
+#define DLT_GATEWAY_GENERAL_SECTION_NAME "General"
#define DLT_GATEWAY_RECONNECT_MAX 1 /* reconnect once after connection loss */
@@ -139,6 +140,7 @@ typedef struct
int send_serial; /* Default: Send serial header with control messages */
DltGatewayConnection *connections; /* pointer to connections */
int num_connections; /* number of connections */
+ int interval; /* interval of retry connection */
} DltGateway;
typedef struct {
@@ -147,6 +149,12 @@ typedef struct {
int is_opt; /* If the configuration is optional or not */
} DltGatewayConf;
+typedef struct {
+ char *key; /* The configuration key*/
+ int (*func)(DltGateway *gateway, char *value); /* Conf handler */
+ int is_opt; /* If the configuration is optional or not */
+} DltGatewayGeneralConf;
+
typedef enum {
GW_CONF_IP_ADDRESS = 0,
GW_CONF_PORT,
@@ -159,4 +167,9 @@ typedef enum {
GW_CONF_COUNT
} DltGatewayConfType;
+typedef enum {
+ GW_CONF_GENERAL_INTERVAL = 0,
+ GW_CONF_GENEREL_COUNT
+} DltGatewayGeneralConfType;
+
#endif /* DLT_GATEWAY_TYPES_H_ */