how to detemine the "request" parameter in function usbd_set

I am trying to write a class drive so I studied the ddk docs and the sample
codes.However,i just cant understand how to determine the value of request
in function usbd_setup_vendor
the prototype is:
int usbd_setup_vendor( struct usbd_urb *urb,
_uint32 flags, _uint16 request,
_uint16 rtype, _uint16 value,
_uint16 index, void *addr,
_uint32 len );

in sample code prn.c,it is called for 3 times:

  1. usbd_setup_vendor( urb, URB_DIR_IN, 0, USB_TYPE_CLASS |
    USB_RECIPIENT_INTERFACE, 0, 0, buffer, length );
  2. usbd_setup_vendor( urb, URB_DIR_OUT, PRN_SOFT_RESET /=2/,
    USB_TYPE_CLASS |
    ( ( prn->bcdUSB & 0x10 ) ? USB_RECIPIENT_INTERFACE :
    USB_RECIPIENT_OTHER ),
  3. usbd_setup_vendor( urb, URB_DIR_IN, 1, USB_TYPE_CLASS |
    USB_RECIPIENT_INTERFACE, 0, 0, buffer, 1 );

As I can’t find other sample source codes, could anyone kindly tell me how
to make the decision? Thanks very much.

I have replied to you by mail…

Having a look to my posts about snoopy pro should be enough to understand
what you are searching for…

Ps: Open the snoopy logs with snoopy pro and the results will be more easy
to read… :wink:

“Meg Dai” <zzdai@ms.mmit.stc.sh.cn> a écrit dans le message news:
bj1l81$f9b$1@inn.qnx.com

I am trying to write a class drive so I studied the ddk docs and the
sample
codes.However,i just cant understand how to determine the value of request
in function usbd_setup_vendor
the prototype is:
int usbd_setup_vendor( struct usbd_urb *urb,
_uint32 flags, _uint16 request,
_uint16 rtype, _uint16 value,
_uint16 index, void *addr,
_uint32 len );

in sample code prn.c,it is called for 3 times:

  1. usbd_setup_vendor( urb, URB_DIR_IN, 0, USB_TYPE_CLASS |
    USB_RECIPIENT_INTERFACE, 0, 0, buffer, length );
  2. usbd_setup_vendor( urb, URB_DIR_OUT, PRN_SOFT_RESET /=2/,
    USB_TYPE_CLASS |
    ( ( prn->bcdUSB & 0x10 ) ? USB_RECIPIENT_INTERFACE :
    USB_RECIPIENT_OTHER ),
  3. usbd_setup_vendor( urb, URB_DIR_IN, 1, USB_TYPE_CLASS |
    USB_RECIPIENT_INTERFACE, 0, 0, buffer, 1 );

As I can’t find other sample source codes, could anyone kindly tell me how
to make the decision? Thanks very much.