summaryrefslogtreecommitdiff
path: root/tests/dlt_test_receiver.c
diff options
context:
space:
mode:
authorStefan Held <stefan_held@mentor.com>2015-06-24 15:50:04 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2015-07-21 12:47:02 +0200
commitfb8cb3735e3b69695289f0ddb8917c1f425a402a (patch)
tree67b1e00f002cd2e8ca7b61db054b42fe5218e168 /tests/dlt_test_receiver.c
parented0e6711ce3e2937de348a1475d70f9d41bcd487 (diff)
downloadDLT-daemon-fb8cb3735e3b69695289f0ddb8917c1f425a402a.tar.gz
Add start_system_logger_test.sh Modify start_filetransfer_test.sh Modify start_systemd_journal_test.sh
Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'tests/dlt_test_receiver.c')
-rw-r--r--tests/dlt_test_receiver.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/dlt_test_receiver.c b/tests/dlt_test_receiver.c
index 46b194b..c17716a 100644
--- a/tests/dlt_test_receiver.c
+++ b/tests/dlt_test_receiver.c
@@ -97,6 +97,7 @@ typedef struct {
int bvalue;
int filetransfervalue;
int systemjournalvalue;
+ int systemloggervalue;
char ecuid[4];
int ohandle;
DltFile file;
@@ -125,6 +126,7 @@ void usage()
printf(" -y Serial device mode\n");
printf(" -f Activate filetransfer test case\n");
printf(" -s Activate systemd journal test case\n");
+ printf(" -l Activate system logger test case");
printf(" -b baudrate Serial device baudrate (Default: 115200)\n");
printf(" -e ecuid Set ECU ID (Default: RECV)\n");
printf(" -o filename Output messages in new DLT file\n");
@@ -153,7 +155,7 @@ int main(int argc, char* argv[])
/* Fetch command line arguments */
opterr = 0;
- while ((c = getopt (argc, argv, "vshyfa:o:e:b:")) != -1)
+ while ((c = getopt (argc, argv, "vshyfla:o:e:b:")) != -1)
switch (c)
{
case 'v':
@@ -181,6 +183,11 @@ int main(int argc, char* argv[])
dltdata.systemjournalvalue = 1;
break;
}
+ case 'l':
+ {
+ dltdata.systemloggervalue = 1;
+ break;
+ }
case 'o':
{
dltdata.ovalue = optarg;
@@ -406,6 +413,28 @@ int dlt_receive_filetransfer_callback(DltMessage *message, void *data)
}
}
+ if(dltdata->systemloggervalue)
+ {
+ dlt_message_print_ascii(message, text, DLT_RECEIVE_TEXTBUFSIZE, dltdata->vflag);
+ // 1st find the relevant packages
+ char * tmp = message->extendedheader->ctid;
+ tmp[4] = '\0';
+ const char * substring = text;
+ const char * founding = "Test Systemlogger";
+ int length = strlen(founding);
+ if( strcmp( tmp , (const char *) "PROC") == 0)
+ {
+ substring = strstr(text, founding);
+ while (substring != NULL)
+ {
+ result ++;
+ substring +=length;
+ if(result == 1000)
+ exit(159);
+ }
+ }
+ }
+
/* if file output enabled write message */
if (dltdata->ovalue)
{