summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2010-11-17 20:48:07 +0300
committerNikolai Kondrashov <spbnick@gmail.com>2010-11-17 20:48:07 +0300
commit4fb9dfd60bd99c1ddaad1f33c8d02ab3dd6182a6 (patch)
treec8ded8a70200081365cdb0c6b935ae9e27bf8407 /lib
parentfbb23a3cb06b0bc528c4cf9345646f7e82756949 (diff)
downloadusbhid-dump-4fb9dfd60bd99c1ddaad1f33c8d02ab3dd6182a6.tar.gz
Move common generic constants to a separate file
Move common generic constants to a separate header file misc.h.
Diffstat (limited to 'lib')
-rw-r--r--lib/dev_list.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/dev_list.c b/lib/dev_list.c
index 3318b4f..e23686e 100644
--- a/lib/dev_list.c
+++ b/lib/dev_list.c
@@ -24,6 +24,7 @@
* @(#) $Id$
*/
+#include "uhd/misc.h"
#include "uhd/dev_list.h"
#include <assert.h>
#include <stdlib.h>
@@ -96,19 +97,21 @@ uhd_dev_list_open(libusb_context *ctx,
lusb_dev = lusb_list[idx];
/* Skip devices not matching bus_num/dev_addr mask */
- if ((bus_num != 0 && libusb_get_bus_number(lusb_dev) != bus_num) ||
- (dev_addr != 0 && libusb_get_device_address(lusb_dev) != dev_addr))
+ if ((bus_num != UHD_BUS_NUM_ANY &&
+ libusb_get_bus_number(lusb_dev) != bus_num) ||
+ (dev_addr != UHD_DEV_ADDR_ANY &&
+ libusb_get_device_address(lusb_dev) != dev_addr))
continue;
/* Skip devices not matching vendor/product mask */
- if (vendor != 0 || product != 0)
+ if (vendor != UHD_VID_ANY || product != UHD_PID_ANY)
{
err = libusb_get_device_descriptor(lusb_dev, &desc);
if (err != LIBUSB_SUCCESS)
goto cleanup;
- if ((vendor != 0 && vendor != desc.idVendor) ||
- (product != 0 && product != desc.idProduct))
+ if ((vendor != UHD_VID_ANY && vendor != desc.idVendor) ||
+ (product != UHD_PID_ANY && product != desc.idProduct))
continue;
}