summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVo Trung Chi <Chi.VoTrung@vn.bosch.com>2018-12-26 15:23:09 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-10-05 11:19:26 +0900
commit0ee7fdff3d6bb2f2055e7083fa48728f4d274661 (patch)
treee191edd9e2736a6a2ebc642769a8b9c67ad60060 /tests
parentcc4d1e04fe4a8b57b137c347ad9fd66166b6250a (diff)
downloadDLT-daemon-0ee7fdff3d6bb2f2055e7083fa48728f4d274661.tar.gz
console: provides args option to enable send/receive serial header
Provides argument option to enable send and resync serial header via command line. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/dlt_test_receiver.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/dlt_test_receiver.c b/tests/dlt_test_receiver.c
index 9698d15..23e827c 100644
--- a/tests/dlt_test_receiver.c
+++ b/tests/dlt_test_receiver.c
@@ -95,6 +95,8 @@ typedef struct {
int systemloggervalue;
char ecuid[4];
int ohandle;
+ int sendSerialHeaderFlag;
+ int resyncSerialHeaderFlag;
DltFile file;
DltFilter filter;
} DltReceiveData;
@@ -118,6 +120,8 @@ void usage()
printf("Options:\n");
printf(" -v Verbose mode\n");
printf(" -h Usage\n");
+ printf(" -S Send message with serial header (Default: Without serial header)\n");
+ printf(" -R Enable resync serial header\n");
printf(" -y Serial device mode\n");
printf(" -f Activate filetransfer test case\n");
printf(" -s Activate systemd journal test case\n");
@@ -143,6 +147,8 @@ int main(int argc, char *argv[])
dltdata.ovalue = 0;
dltdata.evalue = 0;
dltdata.bvalue = 0;
+ dltdata.sendSerialHeaderFlag = 0;
+ dltdata.resyncSerialHeaderFlag = 0;
dltdata.ohandle = -1;
dltdata.filetransfervalue = 0;
dltdata.systemjournalvalue = 0;
@@ -150,7 +156,7 @@ int main(int argc, char *argv[])
/* Fetch command line arguments */
opterr = 0;
- while ((c = getopt (argc, argv, "vshyfla:o:e:b:")) != -1)
+ while ((c = getopt (argc, argv, "vshSRyfla:o:e:b:")) != -1)
switch (c) {
case 'v':
{
@@ -162,6 +168,16 @@ int main(int argc, char *argv[])
usage();
return -1;
}
+ case 'S':
+ {
+ dltdata.sendSerialHeaderFlag = 1;
+ break;
+ }
+ case 'R':
+ {
+ dltdata.resyncSerialHeaderFlag = 1;
+ break;
+ }
case 'y':
{
dltdata.yflag = 1;
@@ -262,6 +278,10 @@ int main(int argc, char *argv[])
dlt_client_setbaudrate(&dltclient, dltdata.bvalue);
}
+ /* Update the send and resync serial header flags based on command line option */
+ dltclient.send_serial_header = dltdata.sendSerialHeaderFlag;
+ dltclient.resync_serial_header = dltdata.resyncSerialHeaderFlag;
+
/* initialise structure to use DLT file */
dlt_file_init(&(dltdata.file), dltdata.vflag);