Change in simtrace2[master]: remsim: allow selecting pcsc reader number

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/.

Hoernchen gerrit-no-reply at lists.osmocom.org
Wed Jan 29 13:45:43 UTC 2020


Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/17059 )


Change subject: remsim: allow selecting pcsc reader number
......................................................................

remsim: allow selecting pcsc reader number

The number can be queried using pcsc_scan -n

Change-Id: I9d347501a9f181f68e74799ad04a810553eb2c9e
---
M host/src/simtrace2-remsim.c
1 file changed, 8 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/59/17059/1

diff --git a/host/src/simtrace2-remsim.c b/host/src/simtrace2-remsim.c
index 03d11df..d27ba07 100644
--- a/host/src/simtrace2-remsim.c
+++ b/host/src/simtrace2-remsim.c
@@ -182,6 +182,7 @@
 		"\t-i\t--gsmtap-ip\tA.B.C.D\n"
 		"\t-a\t--skip-atr\n"
 		"\t-k\t--keep-running\n"
+		"\t-n\t--pcsc-reader-num\n"
 		"\t-V\t--usb-vendor\tVENDOR_ID\n"
 		"\t-P\t--usb-product\tPRODUCT_ID\n"
 		"\t-C\t--usb-config\tCONFIG_ID\n"
@@ -200,6 +201,7 @@
 	{ "skip-atr", 0, 0, 'a' },
 	{ "help", 0, 0, 'h' },
 	{ "keep-running", 0, 0, 'k' },
+	{ "pcsc-reader-num", 1, 0, 'n' },
 	{ "usb-vendor", 1, 0, 'V' },
 	{ "usb-product", 1, 0, 'P' },
 	{ "usb-config", 1, 0, 'C' },
@@ -285,6 +287,7 @@
 	int remote_udp_port = 52342;
 	int if_num = 0, vendor_id = -1, product_id = -1;
 	int config_id = -1, altsetting = 0, addr = -1;
+	int reader_num = 0;
 	char *remote_udp_host = NULL;
 	char *path = NULL;
 	struct osim_reader_hdl *reader;
@@ -295,7 +298,7 @@
 	while (1) {
 		int option_index = 0;
 
-		c = getopt_long(argc, argv, "r:p:hi:V:P:C:I:S:A:H:ak", opts, &option_index);
+		c = getopt_long(argc, argv, "r:p:hi:V:P:C:I:S:A:H:akn:", opts, &option_index);
 		if (c == -1)
 			break;
 		switch (c) {
@@ -318,6 +321,9 @@
 		case 'k':
 			keep_running = 1;
 			break;
+		case 'n':
+			reader_num = atoi(optarg);
+			break;
 		case 'V':
 			vendor_id = strtol(optarg, NULL, 16);
 			break;
@@ -373,7 +379,7 @@
 		goto close_exit;
 	}
 
-	reader = osim_reader_open(OSIM_READER_DRV_PCSC, 0, "", NULL);
+	reader = osim_reader_open(OSIM_READER_DRV_PCSC, reader_num, "", NULL);
 	if (!reader) {
 		perror("unable to open PC/SC reader");
 		goto close_exit;

-- 
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/17059
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I9d347501a9f181f68e74799ad04a810553eb2c9e
Gerrit-Change-Number: 17059
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200129/d319ae0c/attachment.htm>


More information about the gerrit-log mailing list