From 6f44dc8f84cd0d482a48c96a9234327417f79cf6 Mon Sep 17 00:00:00 2001 From: johan Date: Wed, 13 Nov 2013 23:29:19 +0100 Subject: [PATCH] Added more print statements Former-commit-id: 6c3a6662097bfe25b11bcf3c057cb267569f01ca --- libsrc/hyperion/device/LedDeviceLightpack.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsrc/hyperion/device/LedDeviceLightpack.cpp b/libsrc/hyperion/device/LedDeviceLightpack.cpp index 2be0f9f0..475148ee 100644 --- a/libsrc/hyperion/device/LedDeviceLightpack.cpp +++ b/libsrc/hyperion/device/LedDeviceLightpack.cpp @@ -96,6 +96,8 @@ int LedDeviceLightpack::open() if ((deviceDescriptor.idVendor == USB_VENDOR_ID && deviceDescriptor.idProduct == USB_PRODUCT_ID) || (deviceDescriptor.idVendor == USB_OLD_VENDOR_ID && deviceDescriptor.idProduct == USB_OLD_PRODUCT_ID)) { + std::cout << "Found a lightpack device. Retrieving more information..." << std::endl; + // get the hardware address int busNumber = libusb_get_bus_number(deviceList[i]); int addressNumber = libusb_get_device_address(deviceList[i]); @@ -187,6 +189,10 @@ int LedDeviceLightpack::open() _ledBuffer = std::vector(1 + _ledCount * 6, 0); _ledBuffer[0] = CMD_UPDATE_LEDS; } + else + { + std::cerr << "No Lightpack device has been found" << std::endl; + } return _deviceHandle == nullptr ? -1 : 0; } @@ -221,6 +227,8 @@ int LedDeviceLightpack::switchOff() int LedDeviceLightpack::writeBytes(uint8_t *data, int size) { + std::cout << "Writing " << size << " bytes to Lightpack device" << std::endl; + return libusb_control_transfer(_deviceHandle, LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE, 0x09,