lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/43347?usp=email )
Change subject: remsim_client: only set usb parameters if given by config ......................................................................
remsim_client: only set usb parameters if given by config
Change-Id: I30f27b166db72fa8796aa4da98f9fc01e348c87a --- M src/client/user_simtrace2.c 1 file changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/47/43347/1
diff --git a/src/client/user_simtrace2.c b/src/client/user_simtrace2.c index 2535efb..1e847c0 100644 --- a/src/client/user_simtrace2.c +++ b/src/client/user_simtrace2.c @@ -415,12 +415,18 @@ bc->cardem = ci;
memset(ifm, 0, sizeof(*ifm)); - ifm->vendor = cfg->usb.vendor_id; - ifm->product = cfg->usb.product_id; - ifm->configuration = cfg->usb.config_id; - ifm->interface = cfg->usb.if_num; - ifm->altsetting = cfg->usb.altsetting; - ifm->addr = cfg->usb.addr; + if (cfg->usb.vendor_id >= 0) + ifm->vendor = cfg->usb.vendor_id; + if (cfg->usb.product_id >= 0) + ifm->product = cfg->usb.product_id; + if (cfg->usb.config_id >= 0) + ifm->configuration = cfg->usb.config_id; + if (cfg->usb.if_num >= 0) + ifm->interface = cfg->usb.if_num; + if (cfg->usb.altsetting >= 0) + ifm->altsetting = cfg->usb.altsetting; + if (cfg->usb.addr >= 0) + ifm->addr = cfg->usb.addr; if (cfg->usb.path) osmo_strlcpy(ifm->path, cfg->usb.path, sizeof(ifm->path)); transp->udp_fd = -1;