1 Reply Latest reply: Aug 20, 2008 9:16 AM by 807567 RSS

    Help for building a driver and newbie questions in the area.

    807567
      Hello,
      i�m currently needing to develop a driver for a usb device, a link cable. I allready know (at least i think i know) the process to depevelop such driver.
      The process would be something link this (dind put any arguments in functions to be faster):

      - usb_client_attach (dev_info_t * dip, USB_DRIVER_VERSION, FLAGS); - for system reconiction of device

      - usb_get_dev_data (); - for having the main/control pipe
      - usb_lookup_ep_data(); - for get endpoint
      - usb_open_pipe(); - opening the pipe (can be done several times for several pipes)
      - read/write/bulk transfers(); - exchanging data throuh input/output pipes if such exists
      - usb_close_pipe(); - closing all pipes other than the main one
      - usb_client_dettach () - dettaching device from system

      i think this is the general order of events/routines.
      My problem is in the first routine, the usb_client_attach(). How do i know that i�m connecting the right device. (let�s say i�d like to connect a USB PEN for example), the dev_info_t * dip is an empty structure, how do i fill it with the device information for the device i�d like to connect? For example how come do i know if the device info in the "DIP" structure belongs to the USB PEN i�d like to connect and not to any other USB device connected?

      I searched all documentation (the online one) and could not find an example of how could i do such a thing.
      Is there any way to do that?

      Thanks in advance for any help, i�m really needing to have some clarification in this matter.

      Miguel