diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-09-27 15:26:38 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-09-27 15:26:38 +0200 |
commit | 9e988e62b4a4c88621f34e053c3ab8567d8c299a (patch) | |
tree | 085d554eacb682633ff8d6c121da1a4faa5f6333 /src | |
parent | 2f6a373dc9d71ce47cf13d086726e91e6bd7d021 (diff) | |
download | DLT-daemon-9e988e62b4a4c88621f34e053c3ab8567d8c299a.tar.gz |
[GSW-13] Support for keep-alive messages as configuration parameter
Diffstat (limited to 'src')
-rwxr-xr-x | src/daemon/dlt-daemon.c | 14 | ||||
-rwxr-xr-x | src/daemon/dlt-daemon.h | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index 19115b2..3a71138 100755 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -226,6 +226,7 @@ int option_file_parser(DltDaemonLocal *daemon_local) /* set default values for configuration */ daemon_local->flags.sharedMemorySize = DLT_SHM_SIZE; + daemon_local->flags.sendMessageTime = 0; /* open configuration file */ if(daemon_local->flags.cvalue[0]) @@ -303,6 +304,11 @@ int option_file_parser(DltDaemonLocal *daemon_local) daemon_local->flags.rflag = atoi(value); printf("Option: %s=%s\n",token,value); } + else if(strcmp(token,"SendMessageTime")==0) + { + daemon_local->flags.sendMessageTime = atoi(value); + printf("Option: %s=%s\n",token,value); + } else if(strcmp(token,"RS232SyncSerialHeader")==0) { daemon_local->flags.mflag = atoi(value); @@ -619,7 +625,13 @@ int dlt_daemon_local_init_p2(DltDaemon *daemon, DltDaemonLocal *daemon_local, in dlt_log(LOG_WARNING, "Setting of default thread stack size failed!\n"); } } - + + /* configure sending timing packets */ + if (daemon_local->flags.sendMessageTime) + { + daemon->timingpackets = 1; + } + /* Binary semaphore for thread */ if (sem_init(&dlt_daemon_mutex, 0, 1)==-1) { diff --git a/src/daemon/dlt-daemon.h b/src/daemon/dlt-daemon.h index 7ddccdd..6a84008 100755 --- a/src/daemon/dlt-daemon.h +++ b/src/daemon/dlt-daemon.h @@ -104,7 +104,8 @@ typedef struct char yvalue[256]; /**< (String: Devicename) Additional support for serial device */
char ivalue[256]; /**< (String: Directory) Directory where to store the persistant configuration (Default: /tmp) */
char cvalue[256]; /**< (String: Directory) Filename of DLT configuration file (Default: /etc/dlt.conf) */
- int sharedMemorySize; /**< (String: Directory) FSize of shared memory (Default: 100000 */
+ int sharedMemorySize; /**< (String: Directory) FSize of shared memory (Default: 100000) */
+ int sendMessageTime; /**< (Boolean) Send periodic Message Time if client is connected (Default: 0) */
} DltDaemonFlags;
/**
|