On Sat, 1 Jul 2000, Jeroen Vreeken wrote:
> Is there someone who can show me how to implement for example urb
> 5 or 6?
>>>>>>> URB 5 going down...
-- URB_FUNCTION_VENDOR_DEVICE:
TransferFlags = 00000000 (USBD_TRANSFER_DIRECTION_OUT, ~USBD_SHORT_TRANSFER_OK)
TransferBufferLength = 00000000
TransferBuffer = c961f8f8
TransferBufferMDL = 00000000
UrbLink = 00000000
RequestTypeReservedBits = 00
Request = 57
Value = 0001
Index = 0000
int vendor_device_request_send(...)
{
unsigned char req;
unsigned short value;
unsigned short index;
unsigned char cp[...] = {
... whatever you want to send if anything ...
};
unsigned short cpLen;
req = 57; /* Decimal or Hex? */
value = 1;
index = 0;
cpLen = 0;
i = usb_control_msg(
cam->dev,
usb_sndctrlpipe(cam->dev, 0),
req,
/* 1st byte of setup packet (bmRequest) */
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
cp, /* Or NULL */
cpLen, /* Or just 0 */
HZ /* Or other timeout */
);
return i;
}
This particular message does not use data buffer (cp) - this is OK for
control messages, they often carry information only in
request/index/value fields.
This was an example from ibmcam.c - there is one for reading too. Look
for usb_ibmcam_veio(). However you need RECIP_DEVICE, and ibmcam needs
RECIP_ENDPOINT.
Dmitri
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]