C, Sagar (GE Healthcare | 1 Apr 07:57 2009
Picon

usb_find_devices() in libusb winxp


hello all,
i am working on a method to read data from USB device using libusb win32
package.
i am trying to use the bulk.c program provided in zip file of the libusb
download.
i am using Borland c++ compiler in winxp os.

the problem is that the function
usb_find_busses() is working giving me the no of busses on my pc but
usb_find_devices() is not working. it is not showing me any data on how
many USB devices connected to  the busses.i have a usb mouse connected
to my pc.

int main(void)
{
  usb_dev_handle *dev ; /* the device handle */
  char tmp[BUF_SIZE];
  int a;

  usb_init();  /* initialize the library */
  usb_find_busses(); /* find all busses */
  usb_find_devices(); /* find all connected devices */
  a=usb_find_devices();
  printf("%d\n",a);
}

when i print the variable a it is showing as 0;

please help me.. thanks in advance.
(Continue reading)

neeraj dubey | 1 Apr 20:33 2009
Picon

Re: usb_find_devices() in libusb winxp

it only shows true or false value , if any device is there matchinf libusb driver or not..

On Wed, Apr 1, 2009 at 11:27 AM, C, Sagar (GE Healthcare) <Sagar.C <at> ge.com> wrote:


hello all,
i am working on a method to read data from USB device using libusb win32
package.
i am trying to use the bulk.c program provided in zip file of the libusb
download.
i am using Borland c++ compiler in winxp os.

the problem is that the function
usb_find_busses() is working giving me the no of busses on my pc but
usb_find_devices() is not working. it is not showing me any data on how
many USB devices connected to  the busses.i have a usb mouse connected
to my pc.


int main(void)
{
 usb_dev_handle *dev ; /* the device handle */
 char tmp[BUF_SIZE];
 int a;

 usb_init();  /* initialize the library */
 usb_find_busses(); /* find all busses */
 usb_find_devices(); /* find all connected devices */
 a=usb_find_devices();
 printf("%d\n",a);
}

when i print the variable a it is showing as 0;

please help me.. thanks in advance.



------------------------------------------------------------------------------
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

------------------------------------------------------------------------------
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
ragasgupta | 2 Apr 06:05 2009
Picon

Re: usb_find_devices() in libusb winxp


thanks for the reply..
is there any function in libusb that can find the no:of devices attached??

neerajdub wrote:
> 
> it only shows true or false value , if any device is there matchinf libusb
> driver or not..
> 
> On Wed, Apr 1, 2009 at 11:27 AM, C, Sagar (GE Healthcare)
> <Sagar.C <at> ge.com>wrote:
> 
>>
>>
>> hello all,
>> i am working on a method to read data from USB device using libusb win32
>> package.
>> i am trying to use the bulk.c program provided in zip file of the libusb
>> download.
>> i am using Borland c++ compiler in winxp os.
>>
>> the problem is that the function
>> usb_find_busses() is working giving me the no of busses on my pc but
>> usb_find_devices() is not working. it is not showing me any data on how
>> many USB devices connected to  the busses.i have a usb mouse connected
>> to my pc.
>>
>>
>> int main(void)
>> {
>>  usb_dev_handle *dev ; /* the device handle */
>>  char tmp[BUF_SIZE];
>>  int a;
>>
>>  usb_init();  /* initialize the library */
>>  usb_find_busses(); /* find all busses */
>>  usb_find_devices(); /* find all connected devices */
>>  a=usb_find_devices();
>>  printf("%d\n",a);
>> }
>>
>> when i print the variable a it is showing as 0;
>>
>> please help me.. thanks in advance.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Libusb-win32-devel mailing list
>> Libusb-win32-devel <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>
> 
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> 
> 

--

-- 
View this message in context: http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22840491.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Xiaofan Chen | 2 Apr 07:01 2009
Picon

Re: usb_find_devices() in libusb winxp

On Wed, Apr 1, 2009 at 1:57 PM, C, Sagar (GE Healthcare) <Sagar.C <at> ge.com> wrote:
> the problem is that the function
> usb_find_busses() is working giving me the no of busses on my pc but
> usb_find_devices() is not working. it is not showing me any data on how
> many USB devices connected to  the busses.i have a usb mouse connected
> to my pc.

Have you installed the device driver for your device (using the INF file
wizard)? What does the test program (testlibusb-win.exe) say?

Xiaofan

------------------------------------------------------------------------------
neeraj dubey | 2 Apr 08:53 2009
Picon

Re: usb_find_devices() in libusb winxp

HI sagar,
i am not aware of any such function, any way you can use some dll reader and see the functions it supports or browse through the usb.h file .

On 4/2/09, ragasgupta <sagar.c <at> ge.com> wrote:

thanks for the reply..
is there any function in libusb that can find the no:of devices attached??


neerajdub wrote:
>
> it only shows true or false value , if any device is there matchinf libusb
> driver or not..
>
> On Wed, Apr 1, 2009 at 11:27 AM, C, Sagar (GE Healthcare)
> <Sagar.C <at> ge.com>wrote:
>
>>
>>
>> hello all,
>> i am working on a method to read data from USB device using libusb win32
>> package.
>> i am trying to use the bulk.c program provided in zip file of the libusb
>> download.
>> i am using Borland c++ compiler in winxp os.
>>
>> the problem is that the function
>> usb_find_busses() is working giving me the no of busses on my pc but
>> usb_find_devices() is not working. it is not showing me any data on how
>> many USB devices connected to  the busses.i have a usb mouse connected
>> to my pc.
>>
>>
>> int main(void)
>> {
>>  usb_dev_handle *dev ; /* the device handle */
>>  char tmp[BUF_SIZE];
>>  int a;
>>
>>  usb_init();  /* initialize the library */
>>  usb_find_busses(); /* find all busses */
>>  usb_find_devices(); /* find all connected devices */
>>  a=usb_find_devices();
>>  printf("%d\n",a);
>> }
>>
>> when i print the variable a it is showing as 0;
>>
>> please help me.. thanks in advance.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Libusb-win32-devel mailing list
>> Libusb-win32-devel <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>
>


--
View this message in context: http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22840491.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.



------------------------------------------------------------------------------
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

------------------------------------------------------------------------------
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
ragasgupta | 2 Apr 09:52 2009
Picon

Re: usb_find_devices() in libusb winxp


thanks for reply.
ya i have installed the device driver using the inf file wizard and checked
with the test program(testlibusb-win.exe). i shows me the details of the
mouse connected to the usb port. but my doubt was to get the data from the
program bulk.c in borland compliler.. is there any such function in libusb
which can tel me the no:of devices inserted.??

Xiaofan Chen wrote:
> 
> On Wed, Apr 1, 2009 at 1:57 PM, C, Sagar (GE Healthcare) <Sagar.C <at> ge.com>
> wrote:
>> the problem is that the function
>> usb_find_busses() is working giving me the no of busses on my pc but
>> usb_find_devices() is not working. it is not showing me any data on how
>> many USB devices connected to  the busses.i have a usb mouse connected
>> to my pc.
> 
> Have you installed the device driver for your device (using the INF file
> wizard)? What does the test program (testlibusb-win.exe) say?
> 
> Xiaofan
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> 
> 

--

-- 
View this message in context: http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22842724.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
ragasgupta | 2 Apr 09:53 2009
Picon

Re: usb_find_devices() in libusb winxp


oki will look into that.. 

neerajdub wrote:
> 
> HI sagar,
> i am not aware of any such function, any way you can use some dll reader
> and
> see the functions it supports or browse through the usb.h file .
> 
> On 4/2/09, ragasgupta <sagar.c <at> ge.com> wrote:
>>
>>
>> thanks for the reply..
>> is there any function in libusb that can find the no:of devices
>> attached??
>>
>>
>> neerajdub wrote:
>> >
>> > it only shows true or false value , if any device is there matchinf
>> libusb
>> > driver or not..
>> >
>> > On Wed, Apr 1, 2009 at 11:27 AM, C, Sagar (GE Healthcare)
>> > <Sagar.C <at> ge.com>wrote:
>> >
>> >>
>> >>
>> >> hello all,
>> >> i am working on a method to read data from USB device using libusb
>> win32
>> >> package.
>> >> i am trying to use the bulk.c program provided in zip file of the
>> libusb
>> >> download.
>> >> i am using Borland c++ compiler in winxp os.
>> >>
>> >> the problem is that the function
>> >> usb_find_busses() is working giving me the no of busses on my pc but
>> >> usb_find_devices() is not working. it is not showing me any data on
>> how
>> >> many USB devices connected to  the busses.i have a usb mouse connected
>> >> to my pc.
>> >>
>> >>
>> >> int main(void)
>> >> {
>> >>  usb_dev_handle *dev ; /* the device handle */
>> >>  char tmp[BUF_SIZE];
>> >>  int a;
>> >>
>> >>  usb_init();  /* initialize the library */
>> >>  usb_find_busses(); /* find all busses */
>> >>  usb_find_devices(); /* find all connected devices */
>> >>  a=usb_find_devices();
>> >>  printf("%d\n",a);
>> >> }
>> >>
>> >> when i print the variable a it is showing as 0;
>> >>
>> >> please help me.. thanks in advance.
>> >>
>> >>
>> >>
>> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> _______________________________________________
>> >> Libusb-win32-devel mailing list
>> >> Libusb-win32-devel <at> lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>> >>
>> >
>> >
>> ------------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Libusb-win32-devel mailing list
>> > Libusb-win32-devel <at> lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>> >
>> >
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22840491.html
>> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Libusb-win32-devel mailing list
>> Libusb-win32-devel <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>
> 
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> 
> 

--

-- 
View this message in context: http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22842735.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Xiaofan Chen | 2 Apr 11:40 2009
Picon

Re: usb_find_devices() in libusb winxp

On Thu, Apr 2, 2009 at 3:52 PM, ragasgupta <sagar.c <at> ge.com> wrote:
>
> thanks for reply.
> ya i have installed the device driver using the inf file wizard and checked
> with the test program(testlibusb-win.exe). i shows me the details of the
> mouse connected to the usb port. but my doubt was to get the data from the
> program bulk.c in borland compliler.. is there any such function in libusb
> which can tel me the no:of devices inserted.??

What is the output of the testlibusb-win.exe? If it is real mouse, it will
not use bulk transfer but interrupt transfer. And I think it is not a good
idea to use libusb-win32 to interface with a mouse.

Xiaofan

------------------------------------------------------------------------------
ragasgupta | 2 Apr 12:15 2009
Picon

Re: usb_find_devices() in libusb winxp


hi , i am using the interrupt read function of libusb. will it create any
problem if i use the mouse with libusb??
and wen i try to read the data using interrupt read where will the data from
the endpoint be stored.??

Xiaofan Chen wrote:
> 
> On Thu, Apr 2, 2009 at 3:52 PM, ragasgupta <sagar.c <at> ge.com> wrote:
>>
>> thanks for reply.
>> ya i have installed the device driver using the inf file wizard and
>> checked
>> with the test program(testlibusb-win.exe). i shows me the details of the
>> mouse connected to the usb port. but my doubt was to get the data from
>> the
>> program bulk.c in borland compliler.. is there any such function in
>> libusb
>> which can tel me the no:of devices inserted.??
> 
> What is the output of the testlibusb-win.exe? If it is real mouse, it will
> not use bulk transfer but interrupt transfer. And I think it is not a good
> idea to use libusb-win32 to interface with a mouse.
> 
> Xiaofan
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> 
> 

--

-- 
View this message in context: http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22844761.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------
ragasgupta | 2 Apr 14:08 2009
Picon

Re: usb_find_devices() in libusb winxp


hi a little more help from you.. thanks.
i am trying to read from the hid mouse by using the interrupt read function.

usb_interrupt_read(dev,0x81,tmp,sizeof(tmp),5000)..

i am printing the tmp variable in my program but it is giving null..

is it the correct variable where the endpoint data is returned??

Xiaofan Chen wrote:
> 
> On Thu, Apr 2, 2009 at 3:52 PM, ragasgupta <sagar.c <at> ge.com> wrote:
>>
>> thanks for reply.
>> ya i have installed the device driver using the inf file wizard and
>> checked
>> with the test program(testlibusb-win.exe). i shows me the details of the
>> mouse connected to the usb port. but my doubt was to get the data from
>> the
>> program bulk.c in borland compliler.. is there any such function in
>> libusb
>> which can tel me the no:of devices inserted.??
> 
> What is the output of the testlibusb-win.exe? If it is real mouse, it will
> not use bulk transfer but interrupt transfer. And I think it is not a good
> idea to use libusb-win32 to interface with a mouse.
> 
> Xiaofan
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> 
> 

--

-- 
View this message in context: http://www.nabble.com/usb_find_devices%28%29-in-libusb-winxp-tp22819699p22846396.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------

Gmane