remsim-client: Query + Store the USB device path
While the user may have specified a USB path at the command line
(or not), let's make sure we obtain the actual path after opening
the respective USB device.
Change-Id: I7e707c74647f4c5db06d495d369b2e69e2fc7c97
diff --git a/src/client/simtrace2-remsim_client.c b/src/client/simtrace2-remsim_client.c
index 173b890..846ce85 100644
--- a/src/client/simtrace2-remsim_client.c
+++ b/src/client/simtrace2-remsim_client.c
@@ -87,6 +87,7 @@
/* slot on which this card emulation instance runs */
struct st_slot *slot;
struct cardemu_usb_msg_status last_status;
+ char *usb_path;
};
/* global GSMTAP instance */
@@ -993,6 +994,10 @@
return;
}
+ /* (re)determine the USB path of the opened device */
+ talloc_free(ci->usb_path);
+ ci->usb_path = osmo_libusb_dev_get_path_c(ci, libusb_get_device(transp->usb_devh));
+
rc = libusb_claim_interface(transp->usb_devh, cfg->usb.if_num);
if (rc < 0) {
fprintf(stderr, "can't claim interface %d; rc=%d\n", cfg->usb.if_num, rc);