Change in ...osmo-ccid-firmware[master]: cuart_[fsm]_test: Avoid hard-coded 'ttyUSB5'; use command line arg

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Oct 10 09:23:36 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/15744 )

Change subject: cuart_[fsm]_test: Avoid hard-coded 'ttyUSB5'; use command line arg
......................................................................

cuart_[fsm]_test: Avoid hard-coded 'ttyUSB5'; use command line arg

Change-Id: I0b66ed7c037376e4a5a9283cb972012594bc35d2
---
M ccid_host/cuart_fsm_test.c
M ccid_host/cuart_test.c
2 files changed, 16 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ccid_host/cuart_fsm_test.c b/ccid_host/cuart_fsm_test.c
index 92f3437..1151b34 100644
--- a/ccid_host/cuart_fsm_test.c
+++ b/ccid_host/cuart_fsm_test.c
@@ -61,7 +61,14 @@
 
 	signal(SIGUSR1, &signal_handler);
 
-	rc = card_uart_open(&g_cuart, "tty", "/dev/ttyUSB5");
+	if (argc < 2) {
+		fprintf(stderr, "You must specify the UART tty device as argument\n");
+		exit(2);
+	}
+
+	printf("Opening UART device %s\n", argv[1]);
+
+	rc = card_uart_open(&g_cuart, "tty", argv[1]);
 	if (rc < 0) {
 		perror("opening UART");
 		exit(1);
diff --git a/ccid_host/cuart_test.c b/ccid_host/cuart_test.c
index 0ed6614..e2b1ce2 100644
--- a/ccid_host/cuart_test.c
+++ b/ccid_host/cuart_test.c
@@ -58,8 +58,15 @@
 	uint8_t atr[64];
 	int rc;
 
+	if (argc < 2) {
+		fprintf(stderr, "You must specify the UART tty device as argument\n");
+		exit(2);
+	}
+
+	printf("Opening UART device %s\n", argv[1]);
+
 	g_cuart.handle_event = &handle_event;
-	rc = card_uart_open(&g_cuart, "tty", "/dev/ttyUSB5");
+	rc = card_uart_open(&g_cuart, "tty", argv[1]);
 	if (rc < 0) {
 		perror("opening UART");
 		exit(1);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/15744
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I0b66ed7c037376e4a5a9283cb972012594bc35d2
Gerrit-Change-Number: 15744
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191010/e2283c5e/attachment.htm>


More information about the gerrit-log mailing list