use local variables in outgoing_send() to avoid starnge printf values
This commit is contained in:
parent
00d2616a2c
commit
f6559dbdb6
|
@ -326,12 +326,14 @@ unsigned int USB__PT_PROVIDER::usbhdl_by_dev(libusb_device_handle *dh)
|
||||||
void USB__PT_PROVIDER::outgoing_send(const USB__open__vid__pid& send_par)
|
void USB__PT_PROVIDER::outgoing_send(const USB__open__vid__pid& send_par)
|
||||||
{
|
{
|
||||||
unsigned int device_hdl = send_par.device__hdl();
|
unsigned int device_hdl = send_par.device__hdl();
|
||||||
|
unsigned int vendor_id = send_par.vendor__id();
|
||||||
|
unsigned int product_id = send_par.product__id();
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
libusb_device_handle *dh;
|
libusb_device_handle *dh;
|
||||||
dh = libusb_open_device_with_vid_pid(mCtx, send_par.vendor__id(), send_par.product__id());
|
dh = libusb_open_device_with_vid_pid(mCtx, vendor_id, product_id);
|
||||||
if (!dh) {
|
if (!dh) {
|
||||||
log("Error opening VID/PID %04x:%04x", send_par.vendor__id(), send_par.product__id());
|
log("Error opening VID/PID %04x:%04x", vendor_id, product_id);
|
||||||
rc = -1;
|
rc = -1;
|
||||||
} else {
|
} else {
|
||||||
USB_Device *dev = new USB_Device(this, dh, device_hdl);
|
USB_Device *dev = new USB_Device(this, dh, device_hdl);
|
||||||
|
|
Loading…
Reference in New Issue