diff options
Diffstat (limited to 'lib/libusb/libusb20.c')
-rw-r--r-- | lib/libusb/libusb20.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index aa45991..644eda4 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -24,13 +24,17 @@ * SUCH DAMAGE. */ -#include <sys/queue.h> - +#ifdef LIBUSB_GLOBAL_INCLUDE_FILE +#include LIBUSB_GLOBAL_INCLUDE_FILE +#else #include <ctype.h> #include <poll.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> +#include <sys/queue.h> +#endif #include "libusb20.h" #include "libusb20_desc.h" @@ -71,6 +75,7 @@ dummy_callback(struct libusb20_transfer *xfer) #define dummy_check_connected (void *)dummy_int #define dummy_set_power_mode (void *)dummy_int #define dummy_get_power_mode (void *)dummy_int +#define dummy_get_power_usage (void *)dummy_int #define dummy_kernel_driver_active (void *)dummy_int #define dummy_detach_kernel_driver (void *)dummy_int #define dummy_do_request_sync (void *)dummy_int @@ -717,6 +722,18 @@ libusb20_dev_get_power_mode(struct libusb20_device *pdev) return (power_mode); } +uint16_t +libusb20_dev_get_power_usage(struct libusb20_device *pdev) +{ + int error; + uint16_t power_usage; + + error = pdev->methods->get_power_usage(pdev, &power_usage); + if (error) + power_usage = 0; + return (power_usage); +} + int libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t ifaceIndex, uint8_t altIndex) { |