diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2021-07-06 15:54:04 +0900 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-10-05 11:19:26 +0900 |
commit | 9bcaa7536af1c63ffdb470348460a643814972e3 (patch) | |
tree | ee261143b280cb5c05744dcc975a69284af67693 | |
parent | 50a385e6afea50922569828438194477537a768b (diff) | |
download | DLT-daemon-9bcaa7536af1c63ffdb470348460a643814972e3.tar.gz |
dlt-control: Add option to config port
Add -p option to dlt-control so that IP port can be configured in case
of TCP.
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
-rw-r--r-- | doc/dlt-control.1.md | 6 | ||||
-rw-r--r-- | src/console/dlt-control.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/doc/dlt-control.1.md b/doc/dlt-control.1.md index ab509fe..e06c5a9 100644 --- a/doc/dlt-control.1.md +++ b/doc/dlt-control.1.md @@ -6,7 +6,7 @@ # SYNOPSIS -**dlt-control** \[**-v**\] \[**-h**\] \[**-S**\] \[**-R**\] \[**-y**\] \[**-b** baudrate\] \[**-e** ecuid\] \[**-a** id\] \[**-c** id\] \[**-s** id\] \[**-m** message\] \[**-x** message\] \[**-t** milliseconds\] \[**-l** level\] \[**-r** tracestatus\] \[**-d** loglevel\] \[**-f** tracestatus\] \[**-i** enable\] \[**-o**\] \[**-g**\] \[**-j**\] \[**-u**\] hostname/serial\_device\_name +**dlt-control** \[**-v**\] \[**-h**\] \[**-S**\] \[**-R**\] \[**-y**\] \[**-b** baudrate\] \[**-e** ecuid\] \[**-a** id\] \[**-c** id\] \[**-s** id\] \[**-m** message\] \[**-x** message\] \[**-t** milliseconds\] \[**-l** level\] \[**-r** tracestatus\] \[**-d** loglevel\] \[**-f** tracestatus\] \[**-i** enable\] \[**-o**\] \[**-g**\] \[**-j**\] \[**-u**\] \[**-p** port\] hostname/serial\_device\_name # DESCRIPTION @@ -126,6 +126,10 @@ is used. See example for detail. -u : unix port +-p + +: Port for TCP communication (Default: 3490). + # EXAMPLES Change log level of application "APP1" to DEBUG with unix port diff --git a/src/console/dlt-control.c b/src/console/dlt-control.c index 4474bac..7bf091a 100644 --- a/src/console/dlt-control.c +++ b/src/console/dlt-control.c @@ -104,6 +104,7 @@ typedef struct { int jvalue; int kvalue; int bvalue; + int port; int sendSerialHeaderFlag; int resyncSerialHeaderFlag; char ecuid[4]; @@ -163,6 +164,8 @@ void usage() printf(" -j Get log info\n"); printf(" -k Get software version\n"); printf(" -u unix port\n"); + printf(" -p port Use the given port instead the default port\n"); + printf(" Cannot be used with serial devices\n"); } /** * Function for sending get log info ctrl msg and printing the response. @@ -301,6 +304,7 @@ int main(int argc, char *argv[]) .ivalue = -1, .oflag = -1, .gflag = -1, + .port = 3490 }; /* Fetch command line arguments */ @@ -309,7 +313,7 @@ int main(int argc, char *argv[]) /* Default return value */ ret = 0; - while ((c = getopt (argc, argv, "vhSRye:b:a:c:s:m:x:t:l:r:d:f:i:ogjku")) != -1) + while ((c = getopt (argc, argv, "vhSRye:b:a:c:s:m:x:t:l:r:d:f:i:ogjkup:")) != -1) switch (c) { case 'v': { @@ -451,6 +455,11 @@ int main(int argc, char *argv[]) dltdata.yflag = DLT_CLIENT_MODE_UNIX; break; } + case 'p': + { + dltdata.port = atoi(optarg); + break; + } case '?': { if ((optopt == 'o') || (optopt == 'f')) @@ -492,6 +501,7 @@ int main(int argc, char *argv[]) } if (g_dltclient.mode == DLT_CLIENT_MODE_TCP) { + g_dltclient.port = dltdata.port; for (index = optind; index < argc; index++) if (dlt_client_set_server_ip(&g_dltclient, argv[index]) == -1) { pr_error("set server ip didn't succeed\n"); |