Given this from the libusb documentation:
usb_control_msg -- Send a control message to a device
Description
int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout);
usb_control_msg performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. Returns number of bytes written/read or < 0 on error.
And, given this (only slightly modified version of a program from Linux Journal):
/*
*
* ------------------------------------------------
* - camera interface program -
* - -
* - This program and it's source are free and -
* - anyone can do what ever they want with it, -
* - noting that some pieces of code are from -
* - Set LED Copyright Greg Kroah-Hartman 2004 -
* - (greg@kroah.com). Those pieces are under -
* - the GNU GPL as published by the Free -
* - Software Foundation, version 2 of the license-
* - -
* - -
* ------------------------------------------------
*
*
*/
#include <stdio.h>
#include <string.h>
#include <usb.h>
#define LED_VENDOR_ID_CAMCORDER 0x167b
#define LED_PRODUCT_ID_CAMCORDER 0x0101
#define LED_VENDOR_ID_CAMERA 0x0dca
#define LED_PRODUCT_ID_CAMERA 0x0027
static void change_color
(struct usb_dev_handle *handle,
unsigned char color)
{
char *dummy;
usb_control_msg(handle,
0x000000c8,
0x00000012,
(0x02 * 0x100) + 0x0a,
0xff & (~color),
dummy,
0x00000008,
5000);
}
static struct usb_device *device_init(void)
{
struct usb_bus *usb_bus;
struct usb_device *dev;
usb_init();
usb_find_busses();
usb_find_devices();
for (usb_bus = usb_busses;
usb_bus;
usb_bus = usb_bus->next) {
for (dev = usb_bus->devices;
dev;
dev = dev->next) {
if ((dev->descriptor.idVendor
== LED_VENDOR_ID_CAMCORDER) &&
(dev->descriptor.idProduct
== LED_PRODUCT_ID_CAMCORDER))
{
fprintf(stderr,"Found Camcorder....\n");
return dev;
}
else
if ((dev->descriptor.idVendor
== LED_VENDOR_ID_CAMERA) &&
(dev->descriptor.idProduct
== LED_PRODUCT_ID_CAMERA))
{
fprintf(stderr,"Found Camera....\n");
return dev;
}
}
}
return NULL;
}
int main(int argc, char **argv)
{
struct usb_device *usb_dev;
struct usb_dev_handle *usb_handle;
int retval = 1;
int i;
usb_dev = device_init();
if (usb_dev == NULL) {
fprintf(stderr, "Device not foundn\n");
goto exit;
}
usb_handle = usb_open(usb_dev);
if (usb_handle == NULL) {
fprintf(stderr,
"Not able to claim the USB device\n");
goto exit;
}
*
*
* check lock status
*
*
retval = 0;
exit:
usb_close(usb_handle);
fprintf(stderr,"Closed and released camera....\n");
return retval;
}
And given the usb commands given at:
http://www.maushammer.com/systems/cvscamcorder/usb.html
What is the code that would be needed to the authentication challenge as shown on that webpage using the 0xfe?
I can get the code (nothing I wrote!!) to recognize that either the camcorder or the still camera is plugged in and can be opened. A little help with a very foggy C programmer would be appreciated, as I think (I know - that's dangerous!! :) ) I might be able to figure out more of it from there and try to at least unlock the device. Anything beyond that will leave me out in la-la land for a while! :).
BTW - is it possible they removed the old kernel stuff and went purely with libusb now, and that is causing a problem?
I really appreciate the help you've been and continue to be!! :) :)