summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorLutz Helwing <lutz_helwing@mentor.com>2015-07-13 16:52:14 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2015-07-21 12:48:27 +0200
commit98e932adee2a76bda3c2630f348196216549a45a (patch)
tree1658983ac5940b71c158da20421db9054f9500ca /src/daemon
parent199ff0e7f736d848a7e01a12f04ddb21ecf36d74 (diff)
downloadDLT-daemon-98e932adee2a76bda3c2630f348196216549a45a.tar.gz
Removed all trailing whitespaces
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/dlt-daemon.c62
-rwxr-xr-xsrc/daemon/dlt-daemon_cfg.h12
-rw-r--r--src/daemon/dlt.conf2
-rw-r--r--src/daemon/dlt_daemon_client.c4
-rw-r--r--src/daemon/dlt_daemon_common.c14
-rwxr-xr-xsrc/daemon/dlt_daemon_common_cfg.h6
6 files changed, 50 insertions, 50 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 675d958..41cc807 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -214,7 +214,7 @@ int option_file_parser(DltDaemonLocal *daemon_local)
pch = strtok (line," =\r\n");
token[0]=0;
value[0]=0;
-
+
while (pch != NULL)
{
if(strcmp(pch,"#")==0)
@@ -234,7 +234,7 @@ int option_file_parser(DltDaemonLocal *daemon_local)
pch = strtok (NULL, " =\r\n");
}
-
+
if(token[0] && value[0])
{
/* parse arguments here */
@@ -393,7 +393,7 @@ int option_file_parser(DltDaemonLocal *daemon_local)
else
{
fprintf(stderr, "Cannot open configuration file: %s\n",filename);
- }
+ }
return 0;
}
@@ -425,7 +425,7 @@ int main(int argc, char* argv[])
}
return -1;
}
-
+
/* Initialize internal logging facility */
dlt_log_set_filename(daemon_local.flags.loggingFilename);
dlt_log_set_level(daemon_local.flags.loggingLevel);
@@ -489,8 +489,8 @@ int main(int argc, char* argv[])
create_timer_fd(&daemon_local, 60, 60, &daemon_local.timer_sixty_s, "ECU version");
}
- // For offline tracing we still can use the same states
- // as for socket sending. Using this trick we see the traces
+ // For offline tracing we still can use the same states
+ // as for socket sending. Using this trick we see the traces
// In the offline trace AND in the socket stream.
if(daemon_local.flags.yvalue[0])
dlt_daemon_change_state(&daemon,DLT_DAEMON_STATE_SEND_DIRECT);
@@ -705,7 +705,7 @@ int dlt_daemon_local_init_p1(DltDaemon *daemon, DltDaemonLocal *daemon_local, in
signal(SIGHUP, dlt_daemon_signal_handler); /* hangup signal */
signal(SIGQUIT, dlt_daemon_signal_handler);
signal(SIGINT, dlt_daemon_signal_handler);
-
+
return 0;
}
@@ -757,7 +757,7 @@ int dlt_daemon_local_init_p2(DltDaemon *daemon, DltDaemonLocal *daemon_local, in
return -1;
}
#endif
-
+
/* prepare main loop */
if (dlt_message_init(&(daemon_local->msg),daemon_local->flags.vflag)==-1)
{
@@ -783,13 +783,13 @@ int dlt_daemon_local_init_p2(DltDaemon *daemon, DltDaemonLocal *daemon_local, in
return -1;
}
}
-
+
/* configure sending timing packets */
- if (daemon_local->flags.sendMessageTime)
+ if (daemon_local->flags.sendMessageTime)
{
daemon->timingpackets = 1;
}
-
+
/* Binary semaphore for thread */
if (sem_init(&dlt_daemon_mutex, 0, 1)==-1)
{
@@ -1152,10 +1152,10 @@ void dlt_daemon_daemonize(int verbose)
} /* dlt_daemon_daemonize() */
/* This function logs str to the configured output sink (socket, serial, offline trace).
- To avoid recursion this function must be called only from DLT highlevel functions.
+ To avoid recursion this function must be called only from DLT highlevel functions.
E. g. calling it to output a failure when the open of the offline trace file fails
would cause an endless loop because dlt_daemon_log_internal() would itself again try
- to open the offline trace file.
+ to open the offline trace file.
This is a dlt-daemon only function. The libdlt has no equivalent function available. */
int dlt_daemon_log_internal(DltDaemon *daemon, DltDaemonLocal *daemon_local, char *str, int verbose)
{
@@ -1166,18 +1166,18 @@ int dlt_daemon_log_internal(DltDaemon *daemon, DltDaemonLocal *daemon_local, cha
uint16_t uiSize;
uint32_t uiExtraSize;
int ret;
-
+
PRINT_FUNCTION_VERBOSE(verbose);
// Set storageheader
msg.storageheader = (DltStorageHeader *)(msg.headerbuffer);
dlt_set_storageheader(msg.storageheader, daemon->ecuid);
- // Set standardheader
+ // Set standardheader
msg.standardheader = (DltStandardHeader *)(msg.headerbuffer + sizeof(DltStorageHeader));
msg.standardheader->htyp = DLT_HTYP_UEH | DLT_HTYP_WEID | DLT_HTYP_WSID | DLT_HTYP_WTMS | DLT_HTYP_PROTOCOL_VERSION1;
msg.standardheader->mcnt = uiMsgCount++;
-
+
uiExtraSize = DLT_STANDARD_HEADER_EXTRA_SIZE(msg.standardheader->htyp)+(DLT_IS_HTYP_UEH(msg.standardheader->htyp) ? sizeof(DltExtendedHeader) : 0);
msg.headersize = sizeof(DltStorageHeader) + sizeof(DltStandardHeader) + uiExtraSize;
@@ -1247,7 +1247,7 @@ int dlt_daemon_log_internal(DltDaemon *daemon, DltDaemonLocal *daemon_local, cha
}
free(msg.databuffer);
-
+
return 0;
}
@@ -1333,7 +1333,7 @@ int dlt_daemon_process_client_connect(DltDaemon *daemon, DltDaemonLocal *daemon_
dlt_log(LOG_WARNING,"Can't send contents of ringbuffer to clients\n");
return -1;
}
-
+
/* send new log state to all applications */
daemon->connectionState = 1;
dlt_daemon_user_send_all_log_state(daemon,verbose);
@@ -2104,12 +2104,12 @@ int dlt_daemon_process_user_message_log(DltDaemon *daemon, DltDaemonLocal *daemo
{
if(ret!=DLT_MESSAGE_ERROR_SIZE)
{
- /* This is a normal usecase: The daemon reads the data in 10kb chunks.
+ /* This is a normal usecase: The daemon reads the data in 10kb chunks.
Thus the last trace in this chunk is probably not complete and will be completed
with the next chunk read. This happens always when the FIFO is filled with more than 10kb before
- the daemon is able to read from the FIFO.
- Thus the loglevel of this message is set to DEBUG.
- A cleaner solution would be to check more in detail whether the message is not complete (normal usecase)
+ the daemon is able to read from the FIFO.
+ Thus the loglevel of this message is set to DEBUG.
+ A cleaner solution would be to check more in detail whether the message is not complete (normal usecase)
or the headers are corrupted (error case). */
dlt_log(LOG_DEBUG,"Can't read messages from receiver\n");
}
@@ -2235,10 +2235,10 @@ int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *d
}
userheader = (DltUserHeader*) (daemon_local->receiver.buf);
-
+
//dlt_shm_status(&(daemon_local->dlt_shm));
while (1)
- {
+ {
/* log message in SHM */
if((size = dlt_shm_copy(&(daemon_local->dlt_shm),rcv_buffer,10000)) <= 0)
break;
@@ -2246,13 +2246,13 @@ int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *d
break;
dlt_log(LOG_WARNING,"Can't read messages from shm\n");
return -1;
- }
+ }
bytes_to_be_removed = daemon_local->msg.headersize+daemon_local->msg.datasize-sizeof(DltStorageHeader)+sizeof(DltUserHeader);
if (daemon_local->msg.found_serialheader)
{
bytes_to_be_removed += sizeof(dltSerialHeader);
}
-
+
/* set overwrite ecu id */
if (daemon_local->flags.evalue[0])
{
@@ -2381,14 +2381,14 @@ int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *d
if(userheader->message == DLT_USER_MESSAGE_LOG_SHM) {
/* dlt message was sent, remove from buffer if log message from shm */
dlt_shm_remove(&(daemon_local->dlt_shm));
- }
+ }
}
else
{
/* dlt message was not sent, keep in buffer */
break;
}
-
+
}
/* keep not read data in buffer */
@@ -2397,7 +2397,7 @@ int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *d
dlt_log(LOG_WARNING,"Can't remove bytes from receiver for user message overflow\n");
return -1;
}
-
+
return 0;
}
#endif
@@ -2680,8 +2680,8 @@ int dlt_daemon_close_socket(int sock, DltDaemon *daemon, DltDaemonLocal *daemon_
daemon->connectionState = 0;
dlt_daemon_user_send_all_log_state(daemon,verbose);
- // For offline tracing we still can use the same states
- // as for socket sending. Using this trick we see the traces
+ // For offline tracing we still can use the same states
+ // as for socket sending. Using this trick we see the traces
// In the offline trace AND in the socket stream.
if(daemon_local->flags.yvalue[0] == 0)
dlt_daemon_change_state(daemon,DLT_DAEMON_STATE_BUFFER);
diff --git a/src/daemon/dlt-daemon_cfg.h b/src/daemon/dlt-daemon_cfg.h
index b92c595..8870217 100755
--- a/src/daemon/dlt-daemon_cfg.h
+++ b/src/daemon/dlt-daemon_cfg.h
@@ -79,11 +79,11 @@
#define DLT_DAEMON_ECU_VERSION_THREAD_STACKSIZE 100000
/* Size of receive buffer for fifo connection (from user application) */
-#define DLT_DAEMON_RCVBUFSIZE 10024
+#define DLT_DAEMON_RCVBUFSIZE 10024
/* Size of receive buffer for socket connection (from dlt client) */
-#define DLT_DAEMON_RCVBUFSIZESOCK 10024
+#define DLT_DAEMON_RCVBUFSIZESOCK 10024
/* Size of receive buffer for serial connection (from dlt client) */
-#define DLT_DAEMON_RCVBUFSIZESERIAL 10024
+#define DLT_DAEMON_RCVBUFSIZESERIAL 10024
/* Size of buffer for text output */
#define DLT_DAEMON_TEXTSIZE 10024
@@ -95,15 +95,15 @@
#define DLT_DAEMON_DESCSIZE 256
/* Name of daemon lock file, contain process id of dlt daemon instance */
-#define DLT_DAEMON_LOCK_FILE "dltd.lock"
+#define DLT_DAEMON_LOCK_FILE "dltd.lock"
/* Umask of daemon, creates files with permission 750 */
-#define DLT_DAEMON_UMASK 027
+#define DLT_DAEMON_UMASK 027
/* Permissions of daemon lock file */
#define DLT_DAEMON_LOCK_FILE_PERM 0640
/* Default ECU ID, used in storage header and transmitted to client*/
-#define DLT_DAEMON_ECU_ID "ECU1"
+#define DLT_DAEMON_ECU_ID "ECU1"
/* Default baudrate for serial interface */
#define DLT_DAEMON_SERIAL_DEFAULT_BAUDRATE 115200
diff --git a/src/daemon/dlt.conf b/src/daemon/dlt.conf
index 1032a9a..d3ba7f3 100644
--- a/src/daemon/dlt.conf
+++ b/src/daemon/dlt.conf
@@ -41,7 +41,7 @@ LoggingLevel = 6
# The logging filename if internal logging mode is log to file (Default: /tmp/dlt.log)
LoggingFilename = /tmp/dlt.log
-# Timeout on send to client (sec)
+# Timeout on send to client (sec)
TimeOutOnSend = 4
# The minimum size of the Ringbuffer, used for storing temporary DLT messages, until client is connected (Default: 500000)
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c
index a41dba7..c28f098 100644
--- a/src/daemon/dlt_daemon_client.c
+++ b/src/daemon/dlt_daemon_client.c
@@ -101,8 +101,8 @@ int dlt_daemon_client_send(int sock,DltDaemon *daemon,DltDaemonLocal *daemon_loc
}
/* write message to offline trace */
- // In the SEND_BUFFER state we must skip offline tracing because the offline traces
- // are going without buffering directly to the offline trace. Thus we have to filter out
+ // In the SEND_BUFFER state we must skip offline tracing because the offline traces
+ // are going without buffering directly to the offline trace. Thus we have to filter out
// the traces that are coming from the buffer.
if ((sock!=DLT_DAEMON_SEND_FORCE) && (daemon->state != DLT_DAEMON_STATE_SEND_BUFFER))
{
diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c
index 8cb97a4..ad1256e 100644
--- a/src/daemon/dlt_daemon_common.c
+++ b/src/daemon/dlt_daemon_common.c
@@ -146,7 +146,7 @@ int dlt_daemon_init(DltDaemon *daemon,unsigned long RingbufferMinSize,unsigned l
daemon->overflow_counter = 0;
daemon->runtime_context_cfg_loaded = 0;
-
+
daemon->mode = DLT_USER_MODE_EXTERNAL;
daemon->connectionState = 0; /* no logger connected */
@@ -200,10 +200,10 @@ int dlt_daemon_init(DltDaemon *daemon,unsigned long RingbufferMinSize,unsigned l
{
daemon->runtime_context_cfg_loaded = 1;
}
-
+
/* load configuration if available */
dlt_daemon_configuration_load(daemon,daemon->runtime_configuration, verbose);
-
+
daemon->sendserialheader = 0;
daemon->timingpackets = 0;
@@ -1061,7 +1061,7 @@ int dlt_daemon_configuration_load(DltDaemon *daemon,const char *filename, int ve
pch = strtok (line," =\r\n");
token[0]=0;
value[0]=0;
-
+
while (pch != NULL)
{
if(strcmp(pch,"#")==0)
@@ -1081,7 +1081,7 @@ int dlt_daemon_configuration_load(DltDaemon *daemon,const char *filename, int ve
pch = strtok (NULL, " =\r\n");
}
-
+
if(token[0] && value[0])
{
/* parse arguments here */
@@ -1109,8 +1109,8 @@ int dlt_daemon_configuration_load(DltDaemon *daemon,const char *filename, int ve
{
snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE,"Cannot open configuration file: %s\n",filename);
dlt_log(LOG_WARNING, str);
- }
-
+ }
+
return 0;
}
diff --git a/src/daemon/dlt_daemon_common_cfg.h b/src/daemon/dlt_daemon_common_cfg.h
index f7718ef..e0f99da 100755
--- a/src/daemon/dlt_daemon_common_cfg.h
+++ b/src/daemon/dlt_daemon_common_cfg.h
@@ -96,14 +96,14 @@
/* Context ID used when the dlt daemon creates a control message */
#define DLT_DAEMON_CTRL_CTID "DC1"
-/* Number of entries to be allocated at one in application table,
+/* Number of entries to be allocated at one in application table,
when no more entries are available */
#define DLT_DAEMON_APPL_ALLOC_SIZE 500
-/* Number of entries to be allocated at one in context table,
+/* Number of entries to be allocated at one in context table,
when no more entries are available */
#define DLT_DAEMON_CONTEXT_ALLOC_SIZE 1000
-/* Debug get log info function,
+/* Debug get log info function,
set to 1 to enable, 0 to disable debugging */
#define DLT_DEBUG_GETLOGINFO 0