hi,I am a starter of QNX,i want to develop a USB camera driver.but i don’t have a USB DDK,it seems like i should pay for the ddk.
so i can just use the IDE’s help doc,and i had a problem when i use it:
A class driver typically performs the following operations:
1.Connect to the USB stack (usbd_connect()) and provide two callbacks: one for insertion and one for removal.
2.In the insertion callback:
1.Connect to the USB device (usbd_attach()).
2.Get descriptors (usbd_descriptor()).
3.Select the configuration (usbd_select_config()) and interface (usbd_select_interface()).
4.Set up communications pipes to the appropriate endpoint (usbd_open_pipe()).
3.In the removal callback, detach from the USB device (usbd_detach()).
4.Set up all data communications (e.g. reading and writing data, sending and receiving control information, etc.) via the usbd_setup_* () functions (usbd_setup_bulk(), usbd_setup_interrupt(), etc.).
5.Initiate data transfer using the usbd_io() function (with completion callbacks if required).
that are the steps the help doc provide to create a class driver,and my questiom is that how the functions in step3,4,5 to use the variable created in the insertion callback?for example,a struct usbd_device *device is created in usbd_attach(),how the usbd_detach() use the *device,i mean that the insertion callback and the removal callback do not have any parameter passing or the *device is a global variable? please give me some advices,thanks.