You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(27) |
Dec
(9) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(2) |
Feb
(19) |
Mar
(13) |
Apr
(15) |
May
(11) |
Jun
(17) |
Jul
(31) |
Aug
(45) |
Sep
(10) |
Oct
(40) |
Nov
(39) |
Dec
(45) |
| 2005 |
Jan
(113) |
Feb
(45) |
Mar
(38) |
Apr
(53) |
May
(11) |
Jun
(42) |
Jul
(56) |
Aug
(50) |
Sep
(32) |
Oct
(32) |
Nov
(47) |
Dec
(22) |
| 2006 |
Jan
(19) |
Feb
(32) |
Mar
(40) |
Apr
(40) |
May
(41) |
Jun
(44) |
Jul
(37) |
Aug
(51) |
Sep
(30) |
Oct
(30) |
Nov
(51) |
Dec
(20) |
| 2007 |
Jan
(7) |
Feb
(20) |
Mar
(17) |
Apr
(67) |
May
(13) |
Jun
(73) |
Jul
(16) |
Aug
(58) |
Sep
(29) |
Oct
(5) |
Nov
(74) |
Dec
(9) |
| 2008 |
Jan
(17) |
Feb
(12) |
Mar
(65) |
Apr
(22) |
May
(40) |
Jun
(32) |
Jul
(11) |
Aug
(8) |
Sep
(3) |
Oct
(41) |
Nov
(34) |
Dec
(12) |
| 2009 |
Jan
(44) |
Feb
(33) |
Mar
(16) |
Apr
(109) |
May
(11) |
Jun
(22) |
Jul
(21) |
Aug
(37) |
Sep
(5) |
Oct
(23) |
Nov
(7) |
Dec
(7) |
| 2010 |
Jan
(36) |
Feb
(40) |
Mar
(35) |
Apr
(45) |
May
(42) |
Jun
(104) |
Jul
(135) |
Aug
(50) |
Sep
(65) |
Oct
(110) |
Nov
(129) |
Dec
(75) |
| 2011 |
Jan
(105) |
Feb
(48) |
Mar
(93) |
Apr
(166) |
May
(169) |
Jun
(188) |
Jul
(106) |
Aug
(33) |
Sep
(85) |
Oct
(46) |
Nov
(102) |
Dec
(105) |
| 2012 |
Jan
(81) |
Feb
(115) |
Mar
(56) |
Apr
(93) |
May
(56) |
Jun
(77) |
Jul
(88) |
Aug
(52) |
Sep
(72) |
Oct
(16) |
Nov
(70) |
Dec
(70) |
| 2013 |
Jan
(23) |
Feb
(85) |
Mar
(38) |
Apr
(48) |
May
(40) |
Jun
(49) |
Jul
(33) |
Aug
(28) |
Sep
(66) |
Oct
(28) |
Nov
(28) |
Dec
(16) |
| 2014 |
Jan
(33) |
Feb
(58) |
Mar
(17) |
Apr
(50) |
May
(16) |
Jun
(24) |
Jul
(19) |
Aug
(32) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(10) |
| 2015 |
Jan
(11) |
Feb
(2) |
Mar
(4) |
Apr
(14) |
May
(1) |
Jun
(6) |
Jul
(16) |
Aug
(29) |
Sep
(6) |
Oct
(26) |
Nov
(10) |
Dec
|
| 2016 |
Jan
|
Feb
(20) |
Mar
(6) |
Apr
|
May
(3) |
Jun
(3) |
Jul
|
Aug
(16) |
Sep
(6) |
Oct
|
Nov
(15) |
Dec
|
| 2017 |
Jan
(1) |
Feb
(2) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2018 |
Jan
|
Feb
(8) |
Mar
(10) |
Apr
(16) |
May
|
Jun
(15) |
Jul
|
Aug
(3) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(3) |
Aug
|
Sep
(6) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
(11) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(3) |
Dec
|
|
From: Adam K. <akr...@ro...> - 2007-06-06 21:35:04
|
Par Lofgren wrote: > You can use INFINITE in calls with timeout property. > > WaitForSingleObject(c->ol.hEvent, INFINITE); > > INFINIT == 0xFFFFFFFF Ideally libusb-win32 would do this under the hood when the caller supplies a timeout of 0, to match Linux behvaior. But we should check other libusb implementations first; the Linux behvaior is not necessarily the correct one. --Adam |
|
From: Par L. <par...@ls...> - 2007-06-06 20:50:27
|
Hi You can use INFINITE in calls with timeout property. WaitForSingleObject(c->ol.hEvent, INFINITE); INFINIT == 0xFFFFFFFF This will solve your problem with infinite timeout pär lib...@li... wrote: > Send Libusb-win32-devel mailing list submissions to > lib...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > or, via email, send a message with subject or body 'help' to > lib...@li... > > You can reach the person managing the list at > lib...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Libusb-win32-devel digest..." > > > Today's Topics: > > 1. usb_interrupt_read timeouts (Dave Higton) > 2. Re: usb_interrupt_read timeouts (Dan Ellis) > 3. Re: Help, please (Bertrik Sikken) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 6 Jun 2007 16:54:55 +0100 > From: "Dave Higton" <DAV...@ni...> > Subject: [Libusb-win32-devel] usb_interrupt_read timeouts > To: <lib...@li...> > Message-ID: > <B71...@so...> > Content-Type: text/plain; charset="US-ASCII" > > In the Linux version of libusb, the usb_interrupt_read () function can > accept a value of 0 for the timeout, which is interpreted as "infinite". > In the win32 version, this is not accepted. OK, I can put any finite > timeout that I choose, and loop round infinitely on a separate thread, > putting any resulting input into a FIFO. > > But what happens if a USB message comes in immediately after the > timeout, but before the new call? Is any such message lost? > > Dave > > > ************************************************************************************************************************************************************************************************************************************************* > > NICE CTI Systems UK Limited ("NICE") is registered in England under company number, 3403044. The registered office of NICE is at Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP. > > Confidentiality: This communication and any attachments are intended for the above-named persons only and may be confidential and/or legally privileged. Any opinions expressed in this communication are not necessarily those of NICE. If this communication has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender by e-mail immediately. > > Monitoring: NICE may monitor incoming and outgoing e-mails. > > Viruses: Although we have taken steps toward ensuring that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. > > **************************************************************************************************************************************************************************************************************************************************** > > > > > > > ------------------------------ > > Message: 2 > Date: Wed, 06 Jun 2007 17:34:30 +0100 > From: Dan Ellis <dan...@ne...> > Subject: Re: [Libusb-win32-devel] usb_interrupt_read timeouts > To: lib...@li... > Message-ID: <466...@ne...> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Dave Higton wrote: > >> In the Linux version of libusb, the usb_interrupt_read () function can >> accept a value of 0 for the timeout, which is interpreted as "infinite". >> In the win32 version, this is not accepted. OK, I can put any finite >> timeout that I choose, and loop round infinitely on a separate thread, >> putting any resulting input into a FIFO. >> >> But what happens if a USB message comes in immediately after the >> timeout, but before the new call? Is any such message lost? >> >> > After the timeout, the host will no longer be sending IN requests, so > the device will not be able to return any data. > > There's possibly a tiny hole - after the timeout has elapsed, libusb > then cancels the IO. The IO could have validly completed between these 2 > events, but the data would be lost. > > if(WaitForSingleObject(c->ol.hEvent, timeout) == WAIT_TIMEOUT) > { > /* request timed out */ > if(cancel) > { > _usb_cancel_io(c); > > /* wait until the request is cancelled */ > WaitForSingleObject(c->ol.hEvent, 0); > } > > usb_error("usb_reap: timeout error"); > return -ETIMEDOUT; > } > > > Dan. > > > > ------------------------------ > > Message: 3 > Date: Wed, 06 Jun 2007 18:53:13 +0200 > From: Bertrik Sikken <be...@si...> > Subject: Re: [Libusb-win32-devel] Help, please > To: lib...@li... > Message-ID: <466...@si...> > Content-Type: text/plain; charset=ISO-8859-1 > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Stephan Meyer wrote: > >> Try to replace: >> >> uci = usb_claim_interface (udev, 0); >> >> with >> >> usb_set_configuation(udev, 1); >> uci = usb_claim_interface (udev, 0); >> >> It should work then. >> > > I think I recently saw a recommendation on the libusb list to NOT > do an explicit usb_set_configuration. If I remember correctly > Linux already picks a configuration for you (usually devices > only have one configuration anyway). > > What is the proper thing to do when writing something for > both Linux and Windows? > > Bertrik > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGZuZ5ETD6mlrWxPURAtnYAKC7W8MBiP9BX7T0hAO+FmkkYWwiTwCffRzX > 8sYXDF1I8zqjbrFgAzgi3nA= > =YZxP > -----END PGP SIGNATURE----- > > > > ------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > ------------------------------ > > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > > > End of Libusb-win32-devel Digest, Vol 13, Issue 6 > ************************************************* > > |
|
From: Bertrik S. <be...@si...> - 2007-06-06 16:53:28
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stephan Meyer wrote: > Try to replace: > > uci = usb_claim_interface (udev, 0); > > with > > usb_set_configuation(udev, 1); > uci = usb_claim_interface (udev, 0); > > It should work then. I think I recently saw a recommendation on the libusb list to NOT do an explicit usb_set_configuration. If I remember correctly Linux already picks a configuration for you (usually devices only have one configuration anyway). What is the proper thing to do when writing something for both Linux and Windows? Bertrik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZuZ5ETD6mlrWxPURAtnYAKC7W8MBiP9BX7T0hAO+FmkkYWwiTwCffRzX 8sYXDF1I8zqjbrFgAzgi3nA= =YZxP -----END PGP SIGNATURE----- |
|
From: Dan E. <dan...@ne...> - 2007-06-06 16:34:38
|
Dave Higton wrote:
>
> In the Linux version of libusb, the usb_interrupt_read () function can
> accept a value of 0 for the timeout, which is interpreted as "infinite".
> In the win32 version, this is not accepted. OK, I can put any finite
> timeout that I choose, and loop round infinitely on a separate thread,
> putting any resulting input into a FIFO.
>
> But what happens if a USB message comes in immediately after the
> timeout, but before the new call? Is any such message lost?
>
After the timeout, the host will no longer be sending IN requests, so
the device will not be able to return any data.
There's possibly a tiny hole - after the timeout has elapsed, libusb
then cancels the IO. The IO could have validly completed between these 2
events, but the data would be lost.
if(WaitForSingleObject(c->ol.hEvent, timeout) == WAIT_TIMEOUT)
{
/* request timed out */
if(cancel)
{
_usb_cancel_io(c);
/* wait until the request is cancelled */
WaitForSingleObject(c->ol.hEvent, 0);
}
usb_error("usb_reap: timeout error");
return -ETIMEDOUT;
}
Dan.
|
|
From: Dave H. <DAV...@ni...> - 2007-06-06 15:55:04
|
In the Linux version of libusb, the usb_interrupt_read () function can
accept a value of 0 for the timeout, which is interpreted as "infinite".
In the win32 version, this is not accepted. OK, I can put any finite
timeout that I choose, and loop round infinitely on a separate thread,
putting any resulting input into a FIFO.
But what happens if a USB message comes in immediately after the
timeout, but before the new call? Is any such message lost?
Dave
***************************************************************************=
***************************************************************************=
***************************************************************************=
****************
NICE CTI Systems UK Limited ("NICE") is registered in England under company=
number, 3403044. The registered office of NICE is at Tollbar Way, Hedge E=
nd, Southampton, Hampshire SO30 2ZP.
Confidentiality: This communication and any attachments are intended for th=
e above-named persons only and may be confidential and/or legally privilege=
d. Any opinions expressed in this communication are not necessarily those o=
f NICE. If this communication has come to you in error you must take no act=
ion based on it, nor must you copy or show it to anyone; please delete/dest=
roy and inform the sender by e-mail immediately.
Monitoring: NICE may monitor incoming and outgoing e-mails.
Viruses: Although we have taken steps toward ensuring that this e-mail and=
attachments are free from any virus, we advise that in keeping with good c=
omputing practice the recipient should ensure they are actually virus free.
***************************************************************************=
***************************************************************************=
***************************************************************************=
*******************
=20
|
|
From: Par L. <par...@ls...> - 2007-06-06 15:51:04
|
Hi When we encountered errorcode -22 we found finally we had an alignment problem with the structures. All structure shall be packed without byte fillouts! This is accomplished by the use of include file in usb.h. I have not checked the real reason but replacing the include file with #pragma pack directive directly solved the problem. The include files worked on one of three computers? We will compare the include files later and add information in this matter. We are using CBuilder 6. See previous Libusb-win32-devel Digest, Vol 12, Issue 5: Thanks for your quick reply This is what I did to make It work In the file usb.h I changed the line where #include <pshpack1.h> with #pragma pack(push, 1) and at the line where #include <poppack.h> with #pragma pack(pop, 1) I get some warnings but I will leave them so far best of luck Pär and Måns lib...@li... wrote: > Send Libusb-win32-devel mailing list submissions to > lib...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > or, via email, send a message with subject or body 'help' to > lib...@li... > > You can reach the person managing the list at > lib...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Libusb-win32-devel digest..." > > > Today's Topics: > > 1. Re: Help, please (Stephan Meyer) > 2. Re: Help, please (Stephan Meyer) > 3. Re: Help, please (Dave Higton) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 6 Jun 2007 16:43:33 +0200 > From: Stephan Meyer <Ste...@ia...> > Subject: Re: [Libusb-win32-devel] Help, please > To: lib...@li... > Message-ID: > <OF2...@re...> > Content-Type: text/plain; charset="US-ASCII" > > Check the 'ep' parameter. This parameter must be the > full endpoint address including the direction bit (bit7). > > Stephan > > > > >> I just checked the return value of the usb_interrupt_read () call - it's >> always -22. >> >> Dave >> >> >>> -----Original Message----- >>> From: lib...@li... >>> [mailto:lib...@li...] On >>> Behalf Of Dave Higton >>> Sent: 2007 June 06 15:20 >>> To: lib...@li... >>> Subject: Re: [Libusb-win32-devel] Help, please >>> >>> Wow, what a rapid reply! Thanks. I tried your fix, and it has got me >>> one step further. >>> >>> (I note that usb_set_configuration (udev, 0) gives the same >>> error -22 as >>> not calling it. The only configuration I have is numbered 0; is this >>> OK?) >>> >>> Setting configuration to 1 makes the call return 0, so it looks like >>> it's working, but it fails at the next step. In the main loop, I do: >>> >>> printf ("Starting...\n"); >>> while (1) >>> { >>> if (usb_interrupt_read (contact_closure_usb_dev, >>> contact_closure_usb_input_endpoint, >>> cBuf, >>> 4, >>> 0) > 0) >>> { >>> printf ("Got some\n"); >>> } >>> } >>> >>> but the printf statement is never executed, although I am doing things >>> that should cause the interface to send messages - which are 4 bytes >>> each. >>> >>> Any more ideas? >>> >>> Dave >>> >>> >>>> -----Original Message----- >>>> From: lib...@li... >>>> [mailto:lib...@li...] On >>>> Behalf Of Stephan Meyer >>>> Sent: 2007 June 06 14:05 >>>> To: lib...@li... >>>> Subject: Re: [Libusb-win32-devel] Help, please >>>> >>>> Try to replace: >>>> >>>> uci = usb_claim_interface (udev, 0); >>>> >>>> with >>>> >>>> usb_set_configuation(udev, 1); >>>> uci = usb_claim_interface (udev, 0); >>>> >>>> It should work then. >>>> >>>> >>>> Stephan >>>> >>>> >>>> >>>> >>>> >>>>> Help, please. I've started writing a programme to use >>>>> >>>> libusb-win32, but >>>> >>>>> I'm getting an error right at the start. >>>>> >>>>> First, some background. I've used libusb under Linux >>>>> >>>> (Fedora Core 5) >>>> >>>>> successfully, to write driver functions for the first USB >>>>> >>>> device that I >>>> >>>>> wrote firmware for. That device works entirely happily >>>>> >>>> under FC5 and >>>> >>>>> under RISC O (yes, the Acorn/Pace/Castle one). I have now written >>>>> firmware for a second device. Perhaps unsurprisingly, >>>>> >>> this device's >>> >>>>> firmware is very heavily based on the previous one. This >>>>> >>>> device also >>>> >>>>> works entirely happily under RISC OS. I thought I'd try >>>>> >>>> this Windows >>>> >>>>> thing, but I'm having no success. >>>>> >>>>> The entire programme is here: >>>>> >>>>> // Can I get this system to do what I want? >>>>> #include <usb.h> >>>>> #include <stdio.h> >>>>> >>>>> #define VENDOR_ID_NICE 0x16A8 >>>>> #define PRODUCT_ID_CONTACT_CLOSURE 0x0004 >>>>> >>>>> int init (void) >>>>> { >>>>> //int usb_busses; >>>>> struct usb_bus* bus; >>>>> struct usb_device* dev; >>>>> usb_dev_handle *udev; >>>>> int retval = -1; >>>>> int uci; >>>>> int done = 0; >>>>> >>>>> printf ("Hello\n"); >>>>> >>>>> usb_init (); >>>>> usb_find_busses (); >>>>> usb_find_devices (); >>>>> for (bus = usb_get_busses (); bus; bus = bus->next) >>>>> { >>>>> for (dev = bus->devices; dev && (done == 0); dev = >>>>> dev->next) >>>>> { >>>>> udev = usb_open (dev); >>>>> printf ("udev = %p\n", udev); >>>>> if ((dev->descriptor.idVendor == VENDOR_ID_NICE) >>>>> && (dev->descriptor.idProduct == >>>>> PRODUCT_ID_CONTACT_CLOSURE)) >>>>> { >>>>> printf ("Found it!\n"); >>>>> uci = usb_claim_interface (udev, 0); >>>>> printf ("Return value from >>>>> usb_claim_interface: %d\n", uci); >>>>> retval = uci; >>>>> done = 1; >>>>> } >>>>> else >>>>> { >>>>> printf ("Not ours, VID = %04X, PID = >>>>> %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct); >>>>> usb_close (udev); >>>>> printf ("Closed: %p\n", udev); >>>>> } >>>>> } >>>>> } >>>>> return retval; >>>>> } >>>>> >>>>> int main (void) >>>>> { >>>>> int init_result; >>>>> >>>>> init_result = init (); >>>>> if (init_result == 0) >>>>> { >>>>> printf ("Starting...\n"); >>>>> } >>>>> else >>>>> { >>>>> printf ("Failed\n"); >>>>> } >>>>> } >>>>> >>>>> When I run it, I get a couple of "Not ours, VID = " etc. >>>>> >>>> messages for >>>> >>>>> other USB items I have, followed by "Found it!" But then >>>>> >>>> "Return value >>>> >>>>> from usb_claim_interface: -22" which I don't understand. >>>>> >>> I think it >>> >>>>> indicates an illegal parameter. udev must be OK, I assume. >>>>> >>>> My device >>>> >>>>> only has interface 0. It's a very simple device, with a >>>>> >>>> vendor-specific >>>> >>>>> protocol, specified at interface level. >>>>> >>>>> Can anyone see what I'm doing wrong, please? >>>>> >>>>> libusb-win32 downloaded from the main libusb-win32 site >>>>> >>>> this week. No >>>> >>>>> previous copy on this computer. Windows XP. >>>>> >>>>> Dave >>>>> >>>>> >>>>> >>>>> >>>> ************************************************************** >>>> ************************************************************** >>>> ************************************************************** >>>> ******************************************************* >>>> >>>>> NICE CTI Systems UK Limited ("NICE") is registered in >>>>> >>> England under >>> >>>>> company number, 3403044. The registered office of NICE is at >>>>> Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP. >>>>> >>>>> Confidentiality: This communication and any attachments >>>>> >>> are intended >>> >>>>> for the above-named persons only and may be confidential and/or >>>>> legally privileged. Any opinions expressed in this >>>>> >>> communication are >>> >>>>> not necessarily those of NICE. If this communication has >>>>> >>> come to you >>> >>>>> in error you must take no action based on it, nor must >>>>> >>> you copy or >>> >>>>> show it to anyone; please delete/destroy and inform the >>>>> >>> sender by e- >>> >>>>> mail immediately. >>>>> >>>>> Monitoring: NICE may monitor incoming and outgoing e-mails. >>>>> >>>>> Viruses: Although we have taken steps toward ensuring >>>>> >>> that this e- >>> >>>>> mail and attachments are free from any virus, we advise that in >>>>> keeping with good computing practice the recipient should ensure >>>>> they are actually virus free. >>>>> >>>>> >>>>> >>>> ************************************************************** >>>> ************************************************************** >>>> ************************************************************** >>>> ********************************************************** >>>> >>>>> >>>>> >>>>> >>>>> >>>> -------------------------------------------------------------- >>>> ----------- >>>> >>>>> This SF.net email is sponsored by DB2 Express >>>>> Download DB2 Express C - the FREE version of DB2 express and take >>>>> control of your XML. No limits. Just data. Click to get it now. >>>>> http://sourceforge.net/powerbar/db2/ >>>>> _______________________________________________ >>>>> Libusb-win32-devel mailing list >>>>> Lib...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >>>>> >>>> -------------------------------------------------------------- >>>> ----------- >>>> This SF.net email is sponsored by DB2 Express >>>> Download DB2 Express C - the FREE version of DB2 express and take >>>> control of your XML. No limits. Just data. Click to get it now. >>>> http://sourceforge.net/powerbar/db2/ >>>> _______________________________________________ >>>> Libusb-win32-devel mailing list >>>> Lib...@li... >>>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >>>> >>>> >>> -------------------------------------------------------------- >>> ----------- >>> This SF.net email is sponsored by DB2 Express >>> Download DB2 Express C - the FREE version of DB2 express and take >>> control of your XML. No limits. Just data. Click to get it now. >>> http://sourceforge.net/powerbar/db2/ >>> _______________________________________________ >>> Libusb-win32-devel mailing list >>> Lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >>> >>> >> > ------------------------------------------------------------------------- > >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Libusb-win32-devel mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >> > > > > > ------------------------------ > > Message: 2 > Date: Wed, 6 Jun 2007 16:45:12 +0200 > From: Stephan Meyer <Ste...@ia...> > Subject: Re: [Libusb-win32-devel] Help, please > To: lib...@li... > Message-ID: > <OFE...@re...> > Content-Type: text/plain; charset="US-ASCII" > > >> Wow, what a rapid reply! Thanks. I tried your fix, and it has got me >> one step further. >> >> (I note that usb_set_configuration (udev, 0) gives the same error -22 as >> not calling it. The only configuration I have is numbered 0; is this >> OK?) >> > > Yes, that's ok. The parameter is the configuaration value (from the > descriptor), NOT the configuaration index. > > >> Setting configuration to 1 makes the call return 0, so it looks like >> it's working, but it fails at the next step. In the main loop, I do: >> >> printf ("Starting...\n"); >> while (1) >> { >> if (usb_interrupt_read (contact_closure_usb_dev, >> contact_closure_usb_input_endpoint, >> cBuf, >> 4, >> 0) > 0) >> { >> printf ("Got some\n"); >> } >> } >> >> but the printf statement is never executed, although I am doing things >> that should cause the interface to send messages - which are 4 bytes >> each. >> >> Any more ideas? >> >> Dave >> >> >>> -----Original Message----- >>> From: lib...@li... >>> [mailto:lib...@li...] On >>> Behalf Of Stephan Meyer >>> Sent: 2007 June 06 14:05 >>> To: lib...@li... >>> Subject: Re: [Libusb-win32-devel] Help, please >>> >>> Try to replace: >>> >>> uci = usb_claim_interface (udev, 0); >>> >>> with >>> >>> usb_set_configuation(udev, 1); >>> uci = usb_claim_interface (udev, 0); >>> >>> It should work then. >>> >>> >>> Stephan >>> >>> >>> >>> >>> >>>> Help, please. I've started writing a programme to use >>>> >>> libusb-win32, but >>> >>>> I'm getting an error right at the start. >>>> >>>> First, some background. I've used libusb under Linux >>>> >>> (Fedora Core 5) >>> >>>> successfully, to write driver functions for the first USB >>>> >>> device that I >>> >>>> wrote firmware for. That device works entirely happily >>>> >>> under FC5 and >>> >>>> under RISC O (yes, the Acorn/Pace/Castle one). I have now written >>>> firmware for a second device. Perhaps unsurprisingly, this device's >>>> firmware is very heavily based on the previous one. This >>>> >>> device also >>> >>>> works entirely happily under RISC OS. I thought I'd try >>>> >>> this Windows >>> >>>> thing, but I'm having no success. >>>> >>>> The entire programme is here: >>>> >>>> // Can I get this system to do what I want? >>>> #include <usb.h> >>>> #include <stdio.h> >>>> >>>> #define VENDOR_ID_NICE 0x16A8 >>>> #define PRODUCT_ID_CONTACT_CLOSURE 0x0004 >>>> >>>> int init (void) >>>> { >>>> //int usb_busses; >>>> struct usb_bus* bus; >>>> struct usb_device* dev; >>>> usb_dev_handle *udev; >>>> int retval = -1; >>>> int uci; >>>> int done = 0; >>>> >>>> printf ("Hello\n"); >>>> >>>> usb_init (); >>>> usb_find_busses (); >>>> usb_find_devices (); >>>> for (bus = usb_get_busses (); bus; bus = bus->next) >>>> { >>>> for (dev = bus->devices; dev && (done == 0); dev = >>>> dev->next) >>>> { >>>> udev = usb_open (dev); >>>> printf ("udev = %p\n", udev); >>>> if ((dev->descriptor.idVendor == VENDOR_ID_NICE) >>>> && (dev->descriptor.idProduct == >>>> PRODUCT_ID_CONTACT_CLOSURE)) >>>> { >>>> printf ("Found it!\n"); >>>> uci = usb_claim_interface (udev, 0); >>>> printf ("Return value from >>>> usb_claim_interface: %d\n", uci); >>>> retval = uci; >>>> done = 1; >>>> } >>>> else >>>> { >>>> printf ("Not ours, VID = %04X, PID = >>>> %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct); >>>> usb_close (udev); >>>> printf ("Closed: %p\n", udev); >>>> } >>>> } >>>> } >>>> return retval; >>>> } >>>> >>>> int main (void) >>>> { >>>> int init_result; >>>> >>>> init_result = init (); >>>> if (init_result == 0) >>>> { >>>> printf ("Starting...\n"); >>>> } >>>> else >>>> { >>>> printf ("Failed\n"); >>>> } >>>> } >>>> >>>> When I run it, I get a couple of "Not ours, VID = " etc. >>>> >>> messages for >>> >>>> other USB items I have, followed by "Found it!" But then >>>> >>> "Return value >>> >>>> from usb_claim_interface: -22" which I don't understand. I think it >>>> indicates an illegal parameter. udev must be OK, I assume. >>>> >>> My device >>> >>>> only has interface 0. It's a very simple device, with a >>>> >>> vendor-specific >>> >>>> protocol, specified at interface level. >>>> >>>> Can anyone see what I'm doing wrong, please? >>>> >>>> libusb-win32 downloaded from the main libusb-win32 site >>>> >>> this week. No >>> >>>> previous copy on this computer. Windows XP. >>>> >>>> Dave >>>> >>>> >>>> >>>> >>> ************************************************************** >>> ************************************************************** >>> ************************************************************** >>> ******************************************************* >>> >>>> NICE CTI Systems UK Limited ("NICE") is registered in England under >>>> company number, 3403044. The registered office of NICE is at >>>> Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP. >>>> >>>> Confidentiality: This communication and any attachments are intended >>>> for the above-named persons only and may be confidential and/or >>>> legally privileged. Any opinions expressed in this communication are >>>> not necessarily those of NICE. If this communication has come to you >>>> in error you must take no action based on it, nor must you copy or >>>> show it to anyone; please delete/destroy and inform the sender by e- >>>> mail immediately. >>>> >>>> Monitoring: NICE may monitor incoming and outgoing e-mails. >>>> >>>> Viruses: Although we have taken steps toward ensuring that this e- >>>> mail and attachments are free from any virus, we advise that in >>>> keeping with good computing practice the recipient should ensure >>>> they are actually virus free. >>>> >>>> >>>> >>> ************************************************************** >>> ************************************************************** >>> ************************************************************** >>> ********************************************************** >>> >>>> >>>> >>>> >>>> >>> -------------------------------------------------------------- >>> ----------- >>> >>>> This SF.net email is sponsored by DB2 Express >>>> Download DB2 Express C - the FREE version of DB2 express and take >>>> control of your XML. No limits. Just data. Click to get it now. >>>> http://sourceforge.net/powerbar/db2/ >>>> _______________________________________________ >>>> Libusb-win32-devel mailing list >>>> Lib...@li... >>>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >>>> >>> -------------------------------------------------------------- >>> ----------- >>> This SF.net email is sponsored by DB2 Express >>> Download DB2 Express C - the FREE version of DB2 express and take >>> control of your XML. No limits. Just data. Click to get it now. >>> http://sourceforge.net/powerbar/db2/ >>> _______________________________________________ >>> Libusb-win32-devel mailing list >>> Lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >>> >>> >> > ------------------------------------------------------------------------- > >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Libusb-win32-devel mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >> > > > > > ------------------------------ > > Message: 3 > Date: Wed, 6 Jun 2007 15:47:37 +0100 > From: "Dave Higton" <DAV...@ni...> > Subject: Re: [Libusb-win32-devel] Help, please > To: <lib...@li...> > Message-ID: > <B71...@so...> > Content-Type: text/plain; charset="US-ASCII" > > OK, now it returns -116. What next? (What does -116 mean?) > > Thanks, > > Dave > > >> -----Original Message----- >> From: lib...@li... >> [mailto:lib...@li...] On >> Behalf Of Stephan Meyer >> Sent: 2007 June 06 15:44 >> To: lib...@li... >> Subject: Re: [Libusb-win32-devel] Help, please >> >> Check the 'ep' parameter. This parameter must be the >> full endpoint address including the direction bit (bit7). >> >> Stephan >> >> >> >> >>> I just checked the return value of the usb_interrupt_read >>> >> () call - it's >> >>> always -22. >>> >>> Dave >>> >>> >>>> -----Original Message----- >>>> From: lib...@li... >>>> [mailto:lib...@li...] On >>>> Behalf Of Dave Higton >>>> Sent: 2007 June 06 15:20 >>>> To: lib...@li... >>>> Subject: Re: [Libusb-win32-devel] Help, please >>>> >>>> Wow, what a rapid reply! Thanks. I tried your fix, and >>>> >> it has got me >> >>>> one step further. >>>> >>>> (I note that usb_set_configuration (udev, 0) gives the same >>>> error -22 as >>>> not calling it. The only configuration I have is >>>> >> numbered 0; is this >> >>>> OK?) >>>> >>>> Setting configuration to 1 makes the call return 0, so it >>>> >> looks like >> >>>> it's working, but it fails at the next step. In the main >>>> >> loop, I do: >> >>>> printf ("Starting...\n"); >>>> while (1) >>>> { >>>> if (usb_interrupt_read (contact_closure_usb_dev, >>>> contact_closure_usb_input_endpoint, >>>> cBuf, >>>> 4, >>>> 0) > 0) >>>> { >>>> printf ("Got some\n"); >>>> } >>>> } >>>> >>>> but the printf statement is never executed, although I am >>>> >> doing things >> >>>> that should cause the interface to send messages - which >>>> >> are 4 bytes >> >>>> each. >>>> >>>> Any more ideas? >>>> >>>> Dave >>>> >>>> >>>>> -----Original Message----- >>>>> From: lib...@li... >>>>> [mailto:lib...@li...] On >>>>> Behalf Of Stephan Meyer >>>>> Sent: 2007 June 06 14:05 >>>>> To: lib...@li... >>>>> Subject: Re: [Libusb-win32-devel] Help, please >>>>> >>>>> Try to replace: >>>>> >>>>> uci = usb_claim_interface (udev, 0); >>>>> >>>>> with >>>>> >>>>> usb_set_configuation(udev, 1); >>>>> uci = usb_claim_interface (udev, 0); >>>>> >>>>> It should work then. >>>>> >>>>> >>>>> Stephan >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> Help, please. I've started writing a programme to use >>>>>> >>>>> libusb-win32, but >>>>> >>>>>> I'm getting an error right at the start. >>>>>> >>>>>> First, some background. I've used libusb under Linux >>>>>> >>>>> (Fedora Core 5) >>>>> >>>>>> successfully, to write driver functions for the first USB >>>>>> >>>>> device that I >>>>> >>>>>> wrote firmware for. That device works entirely happily >>>>>> >>>>> under FC5 and >>>>> >>>>>> under RISC O (yes, the Acorn/Pace/Castle one). I >>>>>> >> have now written >> >>>>>> firmware for a second device. Perhaps unsurprisingly, >>>>>> >>>> this device's >>>> >>>>>> firmware is very heavily based on the previous one. This >>>>>> >>>>> device also >>>>> >>>>>> works entirely happily under RISC OS. I thought I'd try >>>>>> >>>>> this Windows >>>>> >>>>>> thing, but I'm having no success. >>>>>> >>>>>> The entire programme is here: >>>>>> >>>>>> // Can I get this system to do what I want? >>>>>> #include <usb.h> >>>>>> #include <stdio.h> >>>>>> >>>>>> #define VENDOR_ID_NICE 0x16A8 >>>>>> #define PRODUCT_ID_CONTACT_CLOSURE 0x0004 >>>>>> >>>>>> int init (void) >>>>>> { >>>>>> //int usb_busses; >>>>>> struct usb_bus* bus; >>>>>> struct usb_device* dev; >>>>>> usb_dev_handle *udev; >>>>>> int retval = -1; >>>>>> int uci; >>>>>> int done = 0; >>>>>> >>>>>> printf ("Hello\n"); >>>>>> >>>>>> usb_init (); >>>>>> usb_find_busses (); >>>>>> usb_find_devices (); >>>>>> for (bus = usb_get_busses (); bus; bus = bus->next) >>>>>> { >>>>>> for (dev = bus->devices; dev && (done == 0); dev = >>>>>> dev->next) >>>>>> { >>>>>> udev = usb_open (dev); >>>>>> printf ("udev = %p\n", udev); >>>>>> if ((dev->descriptor.idVendor == VENDOR_ID_NICE) >>>>>> && (dev->descriptor.idProduct == >>>>>> PRODUCT_ID_CONTACT_CLOSURE)) >>>>>> { >>>>>> printf ("Found it!\n"); >>>>>> uci = usb_claim_interface (udev, 0); >>>>>> printf ("Return value from >>>>>> usb_claim_interface: %d\n", uci); >>>>>> retval = uci; >>>>>> done = 1; >>>>>> } >>>>>> else >>>>>> { >>>>>> printf ("Not ours, VID = %04X, PID = >>>>>> %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct); >>>>>> usb_close (udev); >>>>>> printf ("Closed: %p\n", udev); >>>>>> } >>>>>> } >>>>>> } >>>>>> return retval; >>>>>> } >>>>>> >>>>>> int main (void) >>>>>> { >>>>>> int init_result; >>>>>> >>>>>> init_result = init (); >>>>>> if (init_result == 0) >>>>>> { >>>>>> printf ("Starting...\n"); >>>>>> } >>>>>> else >>>>>> { >>>>>> printf ("Failed\n"); >>>>>> } >>>>>> } >>>>>> >>>>>> When I run it, I get a couple of "Not ours, VID = " etc. >>>>>> >>>>> messages for >>>>> >>>>>> other USB items I have, followed by "Found it!" But then >>>>>> >>>>> "Return value >>>>> >>>>>> from usb_claim_interface: -22" which I don't understand. >>>>>> >>>> I think it >>>> >>>>>> indicates an illegal parameter. udev must be OK, I assume. >>>>>> >>>>> My device >>>>> >>>>>> only has interface 0. It's a very simple device, with a >>>>>> >>>>> vendor-specific >>>>> >>>>>> protocol, specified at interface level. >>>>>> >>>>>> Can anyone see what I'm doing wrong, please? >>>>>> >>>>>> libusb-win32 downloaded from the main libusb-win32 site >>>>>> >>>>> this week. No >>>>> >>>>>> previous copy on this computer. Windows XP. >>>>>> >>>>>> Dave >>>>>> > > > ************************************************************************************************************************************************************************************************************************************************* > > NICE CTI Systems UK Limited ("NICE") is registered in England under company number, 3403044. The registered office of NICE is at Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP. > > Confidentiality: This communication and any attachments are intended for the above-named persons only and may be confidential and/or legally privileged. Any opinions expressed in this communication are not necessarily those of NICE. If this communication has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender by e-mail immediately. > > Monitoring: NICE may monitor incoming and outgoing e-mails. > > Viruses: Although we have taken steps toward ensuring that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. > > **************************************************************************************************************************************************************************************************************************************************** > > > > > > > ------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > ------------------------------ > > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > > > End of Libusb-win32-devel Digest, Vol 13, Issue 4 > ************************************************* > > |
|
From: Dave H. <DAV...@ni...> - 2007-06-06 14:55:45
|
OK - got it (I should have looked for error 116 myself - timed out).
If I give a non-zero timeout, it works!
It's interesting to note how incompatible the Linux and win32 versions
of libusb are. The Linux version accepts and quite happily works with
endpoint numbers that don't need the top bit set for inputs; the
usb_interrupt_read () call also accepts a 0 value for timeout as being
infinite, where win32 seems to treat it as immediate.
Thanks, Stephan. You've got it going here!
Dave
> -----Original Message-----
> From: lib...@li...=20
> [mailto:lib...@li...] On=20
> Behalf Of Dave Higton
> Sent: 2007 June 06 15:48
> To: lib...@li...
> Subject: Re: [Libusb-win32-devel] Help, please
>=20
> OK, now it returns -116. What next? (What does -116 mean?)
>=20
> Thanks,
>=20
> Dave
>=20
> > -----Original Message-----
> > From: lib...@li...=20
> > [mailto:lib...@li...] On=20
> > Behalf Of Stephan Meyer
> > Sent: 2007 June 06 15:44
> > To: lib...@li...
> > Subject: Re: [Libusb-win32-devel] Help, please
> >=20
> > Check the 'ep' parameter. This parameter must be the
> > full endpoint address including the direction bit (bit7).
> >=20
> > Stephan
> >=20
> >=20
> >=20
> > > I just checked the return value of the usb_interrupt_read=20
> > () call - it's
> > > always -22.
> > >=20
> > > Dave
> > >=20
> > > > -----Original Message-----
> > > > From: lib...@li...=20
> > > > [mailto:lib...@li...] On=20
> > > > Behalf Of Dave Higton
> > > > Sent: 2007 June 06 15:20
> > > > To: lib...@li...
> > > > Subject: Re: [Libusb-win32-devel] Help, please
> > > >=20
> > > > Wow, what a rapid reply! Thanks. I tried your fix, and=20
> > it has got me
> > > > one step further.
> > > >=20
> > > > (I note that usb_set_configuration (udev, 0) gives the same=20
> > > > error -22 as
> > > > not calling it. The only configuration I have is=20
> > numbered 0; is this
> > > > OK?)
> > > >=20
> > > > Setting configuration to 1 makes the call return 0, so it=20
> > looks like
> > > > it's working, but it fails at the next step. In the main=20
> > loop, I do:
> > > >=20
> > > > printf ("Starting...\n");
> > > > while (1)
> > > > {
> > > > if (usb_interrupt_read (contact_closure_usb_dev,
> > > > contact_closure_usb_input_endpoint,
> > > > cBuf,
> > > > 4,
> > > > 0) > 0)
> > > > {
> > > > printf ("Got some\n");
> > > > }
> > > > }
> > > >=20
> > > > but the printf statement is never executed, although I am=20
> > doing things
> > > > that should cause the interface to send messages - which=20
> > are 4 bytes
> > > > each.
> > > >=20
> > > > Any more ideas?
> > > >=20
> > > > Dave
> > > >=20
> > > > > -----Original Message-----
> > > > > From: lib...@li...=20
> > > > > [mailto:lib...@li...] On=20
> > > > > Behalf Of Stephan Meyer
> > > > > Sent: 2007 June 06 14:05
> > > > > To: lib...@li...
> > > > > Subject: Re: [Libusb-win32-devel] Help, please
> > > > >=20
> > > > > Try to replace:
> > > > >=20
> > > > > uci =3D usb_claim_interface (udev, 0);
> > > > >=20
> > > > > with
> > > > >=20
> > > > > usb_set_configuation(udev, 1);
> > > > > uci =3D usb_claim_interface (udev, 0);
> > > > >=20
> > > > > It should work then.
> > > > >=20
> > > > >=20
> > > > > Stephan
> > > > >=20
> > > > >=20
> > > > >=20
> > > > >=20
> > > > > > Help, please. I've started writing a programme to use=20
> > > > > libusb-win32, but
> > > > > > I'm getting an error right at the start.
> > > > > >=20
> > > > > > First, some background. I've used libusb under Linux=20
> > > > > (Fedora Core 5)
> > > > > > successfully, to write driver functions for the first USB=20
> > > > > device that I
> > > > > > wrote firmware for. That device works entirely happily=20
> > > > > under FC5 and
> > > > > > under RISC O (yes, the Acorn/Pace/Castle one). I=20
> > have now written
> > > > > > firmware for a second device. Perhaps unsurprisingly,=20
> > > > this device's
> > > > > > firmware is very heavily based on the previous one. This=20
> > > > > device also
> > > > > > works entirely happily under RISC OS. I thought I'd try=20
> > > > > this Windows
> > > > > > thing, but I'm having no success.
> > > > > >=20
> > > > > > The entire programme is here:
> > > > > >=20
> > > > > > // Can I get this system to do what I want?
> > > > > > #include <usb.h>
> > > > > > #include <stdio.h>
> > > > > >=20
> > > > > > #define VENDOR_ID_NICE 0x16A8
> > > > > > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> > > > > >=20
> > > > > > int init (void)
> > > > > > {
> > > > > > //int usb_busses;
> > > > > > struct usb_bus* bus;
> > > > > > struct usb_device* dev;
> > > > > > usb_dev_handle *udev;
> > > > > > int retval =3D -1;
> > > > > > int uci;
> > > > > > int done =3D 0;
> > > > > >=20
> > > > > > printf ("Hello\n");
> > > > > >=20
> > > > > > usb_init ();
> > > > > > usb_find_busses ();
> > > > > > usb_find_devices ();
> > > > > > for (bus =3D usb_get_busses (); bus; bus =3D bus->next)
> > > > > > {
> > > > > > for (dev =3D bus->devices; dev && (done =3D=3D 0); dev =
=3D
> > > > > > dev->next)
> > > > > > {
> > > > > > udev =3D usb_open (dev);
> > > > > > printf ("udev =3D %p\n", udev);
> > > > > > if ((dev->descriptor.idVendor =3D=3D =
VENDOR_ID_NICE)
> > > > > > && (dev->descriptor.idProduct =3D=3D
> > > > > > PRODUCT_ID_CONTACT_CLOSURE))
> > > > > > {
> > > > > > printf ("Found it!\n");
> > > > > > uci =3D usb_claim_interface (udev, 0);
> > > > > > printf ("Return value from
> > > > > > usb_claim_interface: %d\n", uci);
> > > > > > retval =3D uci;
> > > > > > done =3D 1;
> > > > > > }
> > > > > > else
> > > > > > {
> > > > > > printf ("Not ours, VID =3D %04X, PID =3D
> > > > > > %04X\n", dev->descriptor.idVendor,=20
> dev->descriptor.idProduct);
> > > > > > usb_close (udev);
> > > > > > printf ("Closed: %p\n", udev);
> > > > > > }
> > > > > > }
> > > > > > }
> > > > > > return retval;
> > > > > > }
> > > > > >=20
> > > > > > int main (void)
> > > > > > {
> > > > > > int init_result;
> > > > > >=20
> > > > > > init_result =3D init ();
> > > > > > if (init_result =3D=3D 0)
> > > > > > {
> > > > > > printf ("Starting...\n");
> > > > > > }
> > > > > > else
> > > > > > {
> > > > > > printf ("Failed\n");
> > > > > > }
> > > > > > }
> > > > > >=20
> > > > > > When I run it, I get a couple of "Not ours, VID =3D " etc.=20
> > > > > messages for
> > > > > > other USB items I have, followed by "Found it!" But then=20
> > > > > "Return value
> > > > > > from usb_claim_interface: -22" which I don't understand.=20
> > > > I think it
> > > > > > indicates an illegal parameter. udev must be OK, I assume.=20
> > > > > My device
> > > > > > only has interface 0. It's a very simple device, with a=20
> > > > > vendor-specific
> > > > > > protocol, specified at interface level.
> > > > > >=20
> > > > > > Can anyone see what I'm doing wrong, please?
> > > > > >=20
> > > > > > libusb-win32 downloaded from the main libusb-win32 site=20
> > > > > this week. No
> > > > > > previous copy on this computer. Windows XP.
> > > > > >=20
> > > > > > Dave
>=20
>=20
> **************************************************************
> **************************************************************
> **************************************************************
> *******************************************************
>=20
> NICE CTI Systems UK Limited ("NICE") is registered in England=20
> under company number, 3403044. The registered office of NICE=20
> is at Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
>=20
> Confidentiality: This communication and any attachments are=20
> intended for the above-named persons only and may be=20
> confidential and/or legally privileged. Any opinions=20
> expressed in this communication are not necessarily those of=20
> NICE. If this communication has come to you in error you must=20
> take no action based on it, nor must you copy or show it to=20
> anyone; please delete/destroy and inform the sender by e-mail=20
> immediately.
>=20
> Monitoring: NICE may monitor incoming and outgoing e-mails.
>=20
> Viruses: Although we have taken steps toward ensuring that=20
> this e-mail and attachments are free from any virus, we=20
> advise that in keeping with good computing practice the=20
> recipient should ensure they are actually virus free.
>=20
> **************************************************************
> **************************************************************
> **************************************************************
> **********************************************************
>=20
> =20
>=20
>=20
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>=20
|
|
From: Stephan M. <Ste...@ia...> - 2007-06-06 14:54:08
|
ETIMEOUT - your request timed out.
Use a timeout parameter > 0 (on Windows '0' means 0ms not infinite)
Stephan
> OK, now it returns -116. What next? (What does -116 mean?)
>
> Thanks,
>
> Dave
>
> > -----Original Message-----
> > From: lib...@li...
> > [mailto:lib...@li...] On
> > Behalf Of Stephan Meyer
> > Sent: 2007 June 06 15:44
> > To: lib...@li...
> > Subject: Re: [Libusb-win32-devel] Help, please
> >
> > Check the 'ep' parameter. This parameter must be the
> > full endpoint address including the direction bit (bit7).
> >
> > Stephan
> >
> >
> >
> > > I just checked the return value of the usb_interrupt_read
> > () call - it's
> > > always -22.
> > >
> > > Dave
> > >
> > > > -----Original Message-----
> > > > From: lib...@li...
> > > > [mailto:lib...@li...] On
> > > > Behalf Of Dave Higton
> > > > Sent: 2007 June 06 15:20
> > > > To: lib...@li...
> > > > Subject: Re: [Libusb-win32-devel] Help, please
> > > >
> > > > Wow, what a rapid reply! Thanks. I tried your fix, and
> > it has got me
> > > > one step further.
> > > >
> > > > (I note that usb_set_configuration (udev, 0) gives the same
> > > > error -22 as
> > > > not calling it. The only configuration I have is
> > numbered 0; is this
> > > > OK?)
> > > >
> > > > Setting configuration to 1 makes the call return 0, so it
> > looks like
> > > > it's working, but it fails at the next step. In the main
> > loop, I do:
> > > >
> > > > printf ("Starting...\n");
> > > > while (1)
> > > > {
> > > > if (usb_interrupt_read (contact_closure_usb_dev,
> > > > contact_closure_usb_input_endpoint,
> > > > cBuf,
> > > > 4,
> > > > 0) > 0)
> > > > {
> > > > printf ("Got some\n");
> > > > }
> > > > }
> > > >
> > > > but the printf statement is never executed, although I am
> > doing things
> > > > that should cause the interface to send messages - which
> > are 4 bytes
> > > > each.
> > > >
> > > > Any more ideas?
> > > >
> > > > Dave
> > > >
> > > > > -----Original Message-----
> > > > > From: lib...@li...
> > > > > [mailto:lib...@li...] On
> > > > > Behalf Of Stephan Meyer
> > > > > Sent: 2007 June 06 14:05
> > > > > To: lib...@li...
> > > > > Subject: Re: [Libusb-win32-devel] Help, please
> > > > >
> > > > > Try to replace:
> > > > >
> > > > > uci = usb_claim_interface (udev, 0);
> > > > >
> > > > > with
> > > > >
> > > > > usb_set_configuation(udev, 1);
> > > > > uci = usb_claim_interface (udev, 0);
> > > > >
> > > > > It should work then.
> > > > >
> > > > >
> > > > > Stephan
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Help, please. I've started writing a programme to use
> > > > > libusb-win32, but
> > > > > > I'm getting an error right at the start.
> > > > > >
> > > > > > First, some background. I've used libusb under Linux
> > > > > (Fedora Core 5)
> > > > > > successfully, to write driver functions for the first USB
> > > > > device that I
> > > > > > wrote firmware for. That device works entirely happily
> > > > > under FC5 and
> > > > > > under RISC O (yes, the Acorn/Pace/Castle one). I
> > have now written
> > > > > > firmware for a second device. Perhaps unsurprisingly,
> > > > this device's
> > > > > > firmware is very heavily based on the previous one. This
> > > > > device also
> > > > > > works entirely happily under RISC OS. I thought I'd try
> > > > > this Windows
> > > > > > thing, but I'm having no success.
> > > > > >
> > > > > > The entire programme is here:
> > > > > >
> > > > > > // Can I get this system to do what I want?
> > > > > > #include <usb.h>
> > > > > > #include <stdio.h>
> > > > > >
> > > > > > #define VENDOR_ID_NICE 0x16A8
> > > > > > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> > > > > >
> > > > > > int init (void)
> > > > > > {
> > > > > > //int usb_busses;
> > > > > > struct usb_bus* bus;
> > > > > > struct usb_device* dev;
> > > > > > usb_dev_handle *udev;
> > > > > > int retval = -1;
> > > > > > int uci;
> > > > > > int done = 0;
> > > > > >
> > > > > > printf ("Hello\n");
> > > > > >
> > > > > > usb_init ();
> > > > > > usb_find_busses ();
> > > > > > usb_find_devices ();
> > > > > > for (bus = usb_get_busses (); bus; bus = bus->next)
> > > > > > {
> > > > > > for (dev = bus->devices; dev && (done == 0); dev =
> > > > > > dev->next)
> > > > > > {
> > > > > > udev = usb_open (dev);
> > > > > > printf ("udev = %p\n", udev);
> > > > > > if ((dev->descriptor.idVendor == VENDOR_ID_NICE)
> > > > > > && (dev->descriptor.idProduct ==
> > > > > > PRODUCT_ID_CONTACT_CLOSURE))
> > > > > > {
> > > > > > printf ("Found it!\n");
> > > > > > uci = usb_claim_interface (udev, 0);
> > > > > > printf ("Return value from
> > > > > > usb_claim_interface: %d\n", uci);
> > > > > > retval = uci;
> > > > > > done = 1;
> > > > > > }
> > > > > > else
> > > > > > {
> > > > > > printf ("Not ours, VID = %04X, PID =
> > > > > > %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> > > > > > usb_close (udev);
> > > > > > printf ("Closed: %p\n", udev);
> > > > > > }
> > > > > > }
> > > > > > }
> > > > > > return retval;
> > > > > > }
> > > > > >
> > > > > > int main (void)
> > > > > > {
> > > > > > int init_result;
> > > > > >
> > > > > > init_result = init ();
> > > > > > if (init_result == 0)
> > > > > > {
> > > > > > printf ("Starting...\n");
> > > > > > }
> > > > > > else
> > > > > > {
> > > > > > printf ("Failed\n");
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > When I run it, I get a couple of "Not ours, VID = " etc.
> > > > > messages for
> > > > > > other USB items I have, followed by "Found it!" But then
> > > > > "Return value
> > > > > > from usb_claim_interface: -22" which I don't understand.
> > > > I think it
> > > > > > indicates an illegal parameter. udev must be OK, I assume.
> > > > > My device
> > > > > > only has interface 0. It's a very simple device, with a
> > > > > vendor-specific
> > > > > > protocol, specified at interface level.
> > > > > >
> > > > > > Can anyone see what I'm doing wrong, please?
> > > > > >
> > > > > > libusb-win32 downloaded from the main libusb-win32 site
> > > > > this week. No
> > > > > > previous copy on this computer. Windows XP.
> > > > > >
> > > > > > Dave
>
>
>
*************************************************************************************************************************************************************************************************************************************************
>
> NICE CTI Systems UK Limited ("NICE") is registered in England under
> company number, 3403044. The registered office of NICE is at
> Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
>
> Confidentiality: This communication and any attachments are intended
> for the above-named persons only and may be confidential and/or
> legally privileged. Any opinions expressed in this communication are
> not necessarily those of NICE. If this communication has come to you
> in error you must take no action based on it, nor must you copy or
> show it to anyone; please delete/destroy and inform the sender by e-
> mail immediately.
>
> Monitoring: NICE may monitor incoming and outgoing e-mails.
>
> Viruses: Although we have taken steps toward ensuring that this e-
> mail and attachments are free from any virus, we advise that in
> keeping with good computing practice the recipient should ensure
> they are actually virus free.
>
>
****************************************************************************************************************************************************************************************************************************************************
>
>
>
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
|
|
From: Dave H. <DAV...@ni...> - 2007-06-06 14:47:46
|
OK, now it returns -116. What next? (What does -116 mean?)
Thanks,
Dave
> -----Original Message-----
> From: lib...@li...=20
> [mailto:lib...@li...] On=20
> Behalf Of Stephan Meyer
> Sent: 2007 June 06 15:44
> To: lib...@li...
> Subject: Re: [Libusb-win32-devel] Help, please
>=20
> Check the 'ep' parameter. This parameter must be the
> full endpoint address including the direction bit (bit7).
>=20
> Stephan
>=20
>=20
>=20
> > I just checked the return value of the usb_interrupt_read=20
> () call - it's
> > always -22.
> >=20
> > Dave
> >=20
> > > -----Original Message-----
> > > From: lib...@li...=20
> > > [mailto:lib...@li...] On=20
> > > Behalf Of Dave Higton
> > > Sent: 2007 June 06 15:20
> > > To: lib...@li...
> > > Subject: Re: [Libusb-win32-devel] Help, please
> > >=20
> > > Wow, what a rapid reply! Thanks. I tried your fix, and=20
> it has got me
> > > one step further.
> > >=20
> > > (I note that usb_set_configuration (udev, 0) gives the same=20
> > > error -22 as
> > > not calling it. The only configuration I have is=20
> numbered 0; is this
> > > OK?)
> > >=20
> > > Setting configuration to 1 makes the call return 0, so it=20
> looks like
> > > it's working, but it fails at the next step. In the main=20
> loop, I do:
> > >=20
> > > printf ("Starting...\n");
> > > while (1)
> > > {
> > > if (usb_interrupt_read (contact_closure_usb_dev,
> > > contact_closure_usb_input_endpoint,
> > > cBuf,
> > > 4,
> > > 0) > 0)
> > > {
> > > printf ("Got some\n");
> > > }
> > > }
> > >=20
> > > but the printf statement is never executed, although I am=20
> doing things
> > > that should cause the interface to send messages - which=20
> are 4 bytes
> > > each.
> > >=20
> > > Any more ideas?
> > >=20
> > > Dave
> > >=20
> > > > -----Original Message-----
> > > > From: lib...@li...=20
> > > > [mailto:lib...@li...] On=20
> > > > Behalf Of Stephan Meyer
> > > > Sent: 2007 June 06 14:05
> > > > To: lib...@li...
> > > > Subject: Re: [Libusb-win32-devel] Help, please
> > > >=20
> > > > Try to replace:
> > > >=20
> > > > uci =3D usb_claim_interface (udev, 0);
> > > >=20
> > > > with
> > > >=20
> > > > usb_set_configuation(udev, 1);
> > > > uci =3D usb_claim_interface (udev, 0);
> > > >=20
> > > > It should work then.
> > > >=20
> > > >=20
> > > > Stephan
> > > >=20
> > > >=20
> > > >=20
> > > >=20
> > > > > Help, please. I've started writing a programme to use=20
> > > > libusb-win32, but
> > > > > I'm getting an error right at the start.
> > > > >=20
> > > > > First, some background. I've used libusb under Linux=20
> > > > (Fedora Core 5)
> > > > > successfully, to write driver functions for the first USB=20
> > > > device that I
> > > > > wrote firmware for. That device works entirely happily=20
> > > > under FC5 and
> > > > > under RISC O (yes, the Acorn/Pace/Castle one). I=20
> have now written
> > > > > firmware for a second device. Perhaps unsurprisingly,=20
> > > this device's
> > > > > firmware is very heavily based on the previous one. This=20
> > > > device also
> > > > > works entirely happily under RISC OS. I thought I'd try=20
> > > > this Windows
> > > > > thing, but I'm having no success.
> > > > >=20
> > > > > The entire programme is here:
> > > > >=20
> > > > > // Can I get this system to do what I want?
> > > > > #include <usb.h>
> > > > > #include <stdio.h>
> > > > >=20
> > > > > #define VENDOR_ID_NICE 0x16A8
> > > > > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> > > > >=20
> > > > > int init (void)
> > > > > {
> > > > > //int usb_busses;
> > > > > struct usb_bus* bus;
> > > > > struct usb_device* dev;
> > > > > usb_dev_handle *udev;
> > > > > int retval =3D -1;
> > > > > int uci;
> > > > > int done =3D 0;
> > > > >=20
> > > > > printf ("Hello\n");
> > > > >=20
> > > > > usb_init ();
> > > > > usb_find_busses ();
> > > > > usb_find_devices ();
> > > > > for (bus =3D usb_get_busses (); bus; bus =3D bus->next)
> > > > > {
> > > > > for (dev =3D bus->devices; dev && (done =3D=3D 0); dev =3D
> > > > > dev->next)
> > > > > {
> > > > > udev =3D usb_open (dev);
> > > > > printf ("udev =3D %p\n", udev);
> > > > > if ((dev->descriptor.idVendor =3D=3D VENDOR_ID_NICE)
> > > > > && (dev->descriptor.idProduct =3D=3D
> > > > > PRODUCT_ID_CONTACT_CLOSURE))
> > > > > {
> > > > > printf ("Found it!\n");
> > > > > uci =3D usb_claim_interface (udev, 0);
> > > > > printf ("Return value from
> > > > > usb_claim_interface: %d\n", uci);
> > > > > retval =3D uci;
> > > > > done =3D 1;
> > > > > }
> > > > > else
> > > > > {
> > > > > printf ("Not ours, VID =3D %04X, PID =3D
> > > > > %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> > > > > usb_close (udev);
> > > > > printf ("Closed: %p\n", udev);
> > > > > }
> > > > > }
> > > > > }
> > > > > return retval;
> > > > > }
> > > > >=20
> > > > > int main (void)
> > > > > {
> > > > > int init_result;
> > > > >=20
> > > > > init_result =3D init ();
> > > > > if (init_result =3D=3D 0)
> > > > > {
> > > > > printf ("Starting...\n");
> > > > > }
> > > > > else
> > > > > {
> > > > > printf ("Failed\n");
> > > > > }
> > > > > }
> > > > >=20
> > > > > When I run it, I get a couple of "Not ours, VID =3D " etc.=20
> > > > messages for
> > > > > other USB items I have, followed by "Found it!" But then=20
> > > > "Return value
> > > > > from usb_claim_interface: -22" which I don't understand.=20
> > > I think it
> > > > > indicates an illegal parameter. udev must be OK, I assume.=20
> > > > My device
> > > > > only has interface 0. It's a very simple device, with a=20
> > > > vendor-specific
> > > > > protocol, specified at interface level.
> > > > >=20
> > > > > Can anyone see what I'm doing wrong, please?
> > > > >=20
> > > > > libusb-win32 downloaded from the main libusb-win32 site=20
> > > > this week. No
> > > > > previous copy on this computer. Windows XP.
> > > > >=20
> > > > > Dave
***************************************************************************=
***************************************************************************=
***************************************************************************=
****************
NICE CTI Systems UK Limited ("NICE") is registered in England under company=
number, 3403044. The registered office of NICE is at Tollbar Way, Hedge E=
nd, Southampton, Hampshire SO30 2ZP.
Confidentiality: This communication and any attachments are intended for th=
e above-named persons only and may be confidential and/or legally privilege=
d. Any opinions expressed in this communication are not necessarily those o=
f NICE. If this communication has come to you in error you must take no act=
ion based on it, nor must you copy or show it to anyone; please delete/dest=
roy and inform the sender by e-mail immediately.
Monitoring: NICE may monitor incoming and outgoing e-mails.
Viruses: Although we have taken steps toward ensuring that this e-mail and=
attachments are free from any virus, we advise that in keeping with good c=
omputing practice the recipient should ensure they are actually virus free.
***************************************************************************=
***************************************************************************=
***************************************************************************=
*******************
=20
|
|
From: Stephan M. <Ste...@ia...> - 2007-06-06 14:45:38
|
> Wow, what a rapid reply! Thanks. I tried your fix, and it has got me
> one step further.
>
> (I note that usb_set_configuration (udev, 0) gives the same error -22 as
> not calling it. The only configuration I have is numbered 0; is this
> OK?)
Yes, that's ok. The parameter is the configuaration value (from the
descriptor), NOT the configuaration index.
>
> Setting configuration to 1 makes the call return 0, so it looks like
> it's working, but it fails at the next step. In the main loop, I do:
>
> printf ("Starting...\n");
> while (1)
> {
> if (usb_interrupt_read (contact_closure_usb_dev,
> contact_closure_usb_input_endpoint,
> cBuf,
> 4,
> 0) > 0)
> {
> printf ("Got some\n");
> }
> }
>
> but the printf statement is never executed, although I am doing things
> that should cause the interface to send messages - which are 4 bytes
> each.
>
> Any more ideas?
>
> Dave
>
> > -----Original Message-----
> > From: lib...@li...
> > [mailto:lib...@li...] On
> > Behalf Of Stephan Meyer
> > Sent: 2007 June 06 14:05
> > To: lib...@li...
> > Subject: Re: [Libusb-win32-devel] Help, please
> >
> > Try to replace:
> >
> > uci = usb_claim_interface (udev, 0);
> >
> > with
> >
> > usb_set_configuation(udev, 1);
> > uci = usb_claim_interface (udev, 0);
> >
> > It should work then.
> >
> >
> > Stephan
> >
> >
> >
> >
> > > Help, please. I've started writing a programme to use
> > libusb-win32, but
> > > I'm getting an error right at the start.
> > >
> > > First, some background. I've used libusb under Linux
> > (Fedora Core 5)
> > > successfully, to write driver functions for the first USB
> > device that I
> > > wrote firmware for. That device works entirely happily
> > under FC5 and
> > > under RISC O (yes, the Acorn/Pace/Castle one). I have now written
> > > firmware for a second device. Perhaps unsurprisingly, this device's
> > > firmware is very heavily based on the previous one. This
> > device also
> > > works entirely happily under RISC OS. I thought I'd try
> > this Windows
> > > thing, but I'm having no success.
> > >
> > > The entire programme is here:
> > >
> > > // Can I get this system to do what I want?
> > > #include <usb.h>
> > > #include <stdio.h>
> > >
> > > #define VENDOR_ID_NICE 0x16A8
> > > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> > >
> > > int init (void)
> > > {
> > > //int usb_busses;
> > > struct usb_bus* bus;
> > > struct usb_device* dev;
> > > usb_dev_handle *udev;
> > > int retval = -1;
> > > int uci;
> > > int done = 0;
> > >
> > > printf ("Hello\n");
> > >
> > > usb_init ();
> > > usb_find_busses ();
> > > usb_find_devices ();
> > > for (bus = usb_get_busses (); bus; bus = bus->next)
> > > {
> > > for (dev = bus->devices; dev && (done == 0); dev =
> > > dev->next)
> > > {
> > > udev = usb_open (dev);
> > > printf ("udev = %p\n", udev);
> > > if ((dev->descriptor.idVendor == VENDOR_ID_NICE)
> > > && (dev->descriptor.idProduct ==
> > > PRODUCT_ID_CONTACT_CLOSURE))
> > > {
> > > printf ("Found it!\n");
> > > uci = usb_claim_interface (udev, 0);
> > > printf ("Return value from
> > > usb_claim_interface: %d\n", uci);
> > > retval = uci;
> > > done = 1;
> > > }
> > > else
> > > {
> > > printf ("Not ours, VID = %04X, PID =
> > > %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> > > usb_close (udev);
> > > printf ("Closed: %p\n", udev);
> > > }
> > > }
> > > }
> > > return retval;
> > > }
> > >
> > > int main (void)
> > > {
> > > int init_result;
> > >
> > > init_result = init ();
> > > if (init_result == 0)
> > > {
> > > printf ("Starting...\n");
> > > }
> > > else
> > > {
> > > printf ("Failed\n");
> > > }
> > > }
> > >
> > > When I run it, I get a couple of "Not ours, VID = " etc.
> > messages for
> > > other USB items I have, followed by "Found it!" But then
> > "Return value
> > > from usb_claim_interface: -22" which I don't understand. I think it
> > > indicates an illegal parameter. udev must be OK, I assume.
> > My device
> > > only has interface 0. It's a very simple device, with a
> > vendor-specific
> > > protocol, specified at interface level.
> > >
> > > Can anyone see what I'm doing wrong, please?
> > >
> > > libusb-win32 downloaded from the main libusb-win32 site
> > this week. No
> > > previous copy on this computer. Windows XP.
> > >
> > > Dave
> > >
> > >
> > >
> > **************************************************************
> > **************************************************************
> > **************************************************************
> > *******************************************************
> > >
> > > NICE CTI Systems UK Limited ("NICE") is registered in England under
> > > company number, 3403044. The registered office of NICE is at
> > > Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
> > >
> > > Confidentiality: This communication and any attachments are intended
> > > for the above-named persons only and may be confidential and/or
> > > legally privileged. Any opinions expressed in this communication are
> > > not necessarily those of NICE. If this communication has come to you
> > > in error you must take no action based on it, nor must you copy or
> > > show it to anyone; please delete/destroy and inform the sender by e-
> > > mail immediately.
> > >
> > > Monitoring: NICE may monitor incoming and outgoing e-mails.
> > >
> > > Viruses: Although we have taken steps toward ensuring that this e-
> > > mail and attachments are free from any virus, we advise that in
> > > keeping with good computing practice the recipient should ensure
> > > they are actually virus free.
> > >
> > >
> > **************************************************************
> > **************************************************************
> > **************************************************************
> > **********************************************************
> > >
> > >
> > >
> > >
> > >
> > --------------------------------------------------------------
> > -----------
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Lib...@li...
> > > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
> > --------------------------------------------------------------
> > -----------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Lib...@li...
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
|
|
From: Stephan M. <Ste...@ia...> - 2007-06-06 14:44:03
|
Check the 'ep' parameter. This parameter must be the
full endpoint address including the direction bit (bit7).
Stephan
> I just checked the return value of the usb_interrupt_read () call - it's
> always -22.
>
> Dave
>
> > -----Original Message-----
> > From: lib...@li...
> > [mailto:lib...@li...] On
> > Behalf Of Dave Higton
> > Sent: 2007 June 06 15:20
> > To: lib...@li...
> > Subject: Re: [Libusb-win32-devel] Help, please
> >
> > Wow, what a rapid reply! Thanks. I tried your fix, and it has got me
> > one step further.
> >
> > (I note that usb_set_configuration (udev, 0) gives the same
> > error -22 as
> > not calling it. The only configuration I have is numbered 0; is this
> > OK?)
> >
> > Setting configuration to 1 makes the call return 0, so it looks like
> > it's working, but it fails at the next step. In the main loop, I do:
> >
> > printf ("Starting...\n");
> > while (1)
> > {
> > if (usb_interrupt_read (contact_closure_usb_dev,
> > contact_closure_usb_input_endpoint,
> > cBuf,
> > 4,
> > 0) > 0)
> > {
> > printf ("Got some\n");
> > }
> > }
> >
> > but the printf statement is never executed, although I am doing things
> > that should cause the interface to send messages - which are 4 bytes
> > each.
> >
> > Any more ideas?
> >
> > Dave
> >
> > > -----Original Message-----
> > > From: lib...@li...
> > > [mailto:lib...@li...] On
> > > Behalf Of Stephan Meyer
> > > Sent: 2007 June 06 14:05
> > > To: lib...@li...
> > > Subject: Re: [Libusb-win32-devel] Help, please
> > >
> > > Try to replace:
> > >
> > > uci = usb_claim_interface (udev, 0);
> > >
> > > with
> > >
> > > usb_set_configuation(udev, 1);
> > > uci = usb_claim_interface (udev, 0);
> > >
> > > It should work then.
> > >
> > >
> > > Stephan
> > >
> > >
> > >
> > >
> > > > Help, please. I've started writing a programme to use
> > > libusb-win32, but
> > > > I'm getting an error right at the start.
> > > >
> > > > First, some background. I've used libusb under Linux
> > > (Fedora Core 5)
> > > > successfully, to write driver functions for the first USB
> > > device that I
> > > > wrote firmware for. That device works entirely happily
> > > under FC5 and
> > > > under RISC O (yes, the Acorn/Pace/Castle one). I have now written
> > > > firmware for a second device. Perhaps unsurprisingly,
> > this device's
> > > > firmware is very heavily based on the previous one. This
> > > device also
> > > > works entirely happily under RISC OS. I thought I'd try
> > > this Windows
> > > > thing, but I'm having no success.
> > > >
> > > > The entire programme is here:
> > > >
> > > > // Can I get this system to do what I want?
> > > > #include <usb.h>
> > > > #include <stdio.h>
> > > >
> > > > #define VENDOR_ID_NICE 0x16A8
> > > > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> > > >
> > > > int init (void)
> > > > {
> > > > //int usb_busses;
> > > > struct usb_bus* bus;
> > > > struct usb_device* dev;
> > > > usb_dev_handle *udev;
> > > > int retval = -1;
> > > > int uci;
> > > > int done = 0;
> > > >
> > > > printf ("Hello\n");
> > > >
> > > > usb_init ();
> > > > usb_find_busses ();
> > > > usb_find_devices ();
> > > > for (bus = usb_get_busses (); bus; bus = bus->next)
> > > > {
> > > > for (dev = bus->devices; dev && (done == 0); dev =
> > > > dev->next)
> > > > {
> > > > udev = usb_open (dev);
> > > > printf ("udev = %p\n", udev);
> > > > if ((dev->descriptor.idVendor == VENDOR_ID_NICE)
> > > > && (dev->descriptor.idProduct ==
> > > > PRODUCT_ID_CONTACT_CLOSURE))
> > > > {
> > > > printf ("Found it!\n");
> > > > uci = usb_claim_interface (udev, 0);
> > > > printf ("Return value from
> > > > usb_claim_interface: %d\n", uci);
> > > > retval = uci;
> > > > done = 1;
> > > > }
> > > > else
> > > > {
> > > > printf ("Not ours, VID = %04X, PID =
> > > > %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> > > > usb_close (udev);
> > > > printf ("Closed: %p\n", udev);
> > > > }
> > > > }
> > > > }
> > > > return retval;
> > > > }
> > > >
> > > > int main (void)
> > > > {
> > > > int init_result;
> > > >
> > > > init_result = init ();
> > > > if (init_result == 0)
> > > > {
> > > > printf ("Starting...\n");
> > > > }
> > > > else
> > > > {
> > > > printf ("Failed\n");
> > > > }
> > > > }
> > > >
> > > > When I run it, I get a couple of "Not ours, VID = " etc.
> > > messages for
> > > > other USB items I have, followed by "Found it!" But then
> > > "Return value
> > > > from usb_claim_interface: -22" which I don't understand.
> > I think it
> > > > indicates an illegal parameter. udev must be OK, I assume.
> > > My device
> > > > only has interface 0. It's a very simple device, with a
> > > vendor-specific
> > > > protocol, specified at interface level.
> > > >
> > > > Can anyone see what I'm doing wrong, please?
> > > >
> > > > libusb-win32 downloaded from the main libusb-win32 site
> > > this week. No
> > > > previous copy on this computer. Windows XP.
> > > >
> > > > Dave
> > > >
> > > >
> > > >
> > > **************************************************************
> > > **************************************************************
> > > **************************************************************
> > > *******************************************************
> > > >
> > > > NICE CTI Systems UK Limited ("NICE") is registered in
> > England under
> > > > company number, 3403044. The registered office of NICE is at
> > > > Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
> > > >
> > > > Confidentiality: This communication and any attachments
> > are intended
> > > > for the above-named persons only and may be confidential and/or
> > > > legally privileged. Any opinions expressed in this
> > communication are
> > > > not necessarily those of NICE. If this communication has
> > come to you
> > > > in error you must take no action based on it, nor must
> > you copy or
> > > > show it to anyone; please delete/destroy and inform the
> > sender by e-
> > > > mail immediately.
> > > >
> > > > Monitoring: NICE may monitor incoming and outgoing e-mails.
> > > >
> > > > Viruses: Although we have taken steps toward ensuring
> > that this e-
> > > > mail and attachments are free from any virus, we advise that in
> > > > keeping with good computing practice the recipient should ensure
> > > > they are actually virus free.
> > > >
> > > >
> > > **************************************************************
> > > **************************************************************
> > > **************************************************************
> > > **********************************************************
> > > >
> > > >
> > > >
> > > >
> > > >
> > > --------------------------------------------------------------
> > > -----------
> > > > This SF.net email is sponsored by DB2 Express
> > > > Download DB2 Express C - the FREE version of DB2 express and take
> > > > control of your XML. No limits. Just data. Click to get it now.
> > > > http://sourceforge.net/powerbar/db2/
> > > > _______________________________________________
> > > > Libusb-win32-devel mailing list
> > > > Lib...@li...
> > > > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > >
> > >
> > > --------------------------------------------------------------
> > > -----------
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Lib...@li...
> > > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > >
> >
> > --------------------------------------------------------------
> > -----------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Lib...@li...
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
|
|
From: Dave H. <DAV...@ni...> - 2007-06-06 14:30:34
|
I just checked the return value of the usb_interrupt_read () call - it's
always -22.
Dave
> -----Original Message-----
> From: lib...@li...=20
> [mailto:lib...@li...] On=20
> Behalf Of Dave Higton
> Sent: 2007 June 06 15:20
> To: lib...@li...
> Subject: Re: [Libusb-win32-devel] Help, please
>=20
> Wow, what a rapid reply! Thanks. I tried your fix, and it has got me
> one step further.
>=20
> (I note that usb_set_configuration (udev, 0) gives the same=20
> error -22 as
> not calling it. The only configuration I have is numbered 0; is this
> OK?)
>=20
> Setting configuration to 1 makes the call return 0, so it looks like
> it's working, but it fails at the next step. In the main loop, I do:
>=20
> printf ("Starting...\n");
> while (1)
> {
> if (usb_interrupt_read (contact_closure_usb_dev,
> contact_closure_usb_input_endpoint,
> cBuf,
> 4,
> 0) > 0)
> {
> printf ("Got some\n");
> }
> }
>=20
> but the printf statement is never executed, although I am doing things
> that should cause the interface to send messages - which are 4 bytes
> each.
>=20
> Any more ideas?
>=20
> Dave
>=20
> > -----Original Message-----
> > From: lib...@li...=20
> > [mailto:lib...@li...] On=20
> > Behalf Of Stephan Meyer
> > Sent: 2007 June 06 14:05
> > To: lib...@li...
> > Subject: Re: [Libusb-win32-devel] Help, please
> >=20
> > Try to replace:
> >=20
> > uci =3D usb_claim_interface (udev, 0);
> >=20
> > with
> >=20
> > usb_set_configuation(udev, 1);
> > uci =3D usb_claim_interface (udev, 0);
> >=20
> > It should work then.
> >=20
> >=20
> > Stephan
> >=20
> >=20
> >=20
> >=20
> > > Help, please. I've started writing a programme to use=20
> > libusb-win32, but
> > > I'm getting an error right at the start.
> > >=20
> > > First, some background. I've used libusb under Linux=20
> > (Fedora Core 5)
> > > successfully, to write driver functions for the first USB=20
> > device that I
> > > wrote firmware for. That device works entirely happily=20
> > under FC5 and
> > > under RISC O (yes, the Acorn/Pace/Castle one). I have now written
> > > firmware for a second device. Perhaps unsurprisingly,=20
> this device's
> > > firmware is very heavily based on the previous one. This=20
> > device also
> > > works entirely happily under RISC OS. I thought I'd try=20
> > this Windows
> > > thing, but I'm having no success.
> > >=20
> > > The entire programme is here:
> > >=20
> > > // Can I get this system to do what I want?
> > > #include <usb.h>
> > > #include <stdio.h>
> > >=20
> > > #define VENDOR_ID_NICE 0x16A8
> > > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> > >=20
> > > int init (void)
> > > {
> > > //int usb_busses;
> > > struct usb_bus* bus;
> > > struct usb_device* dev;
> > > usb_dev_handle *udev;
> > > int retval =3D -1;
> > > int uci;
> > > int done =3D 0;
> > >=20
> > > printf ("Hello\n");
> > >=20
> > > usb_init ();
> > > usb_find_busses ();
> > > usb_find_devices ();
> > > for (bus =3D usb_get_busses (); bus; bus =3D bus->next)
> > > {
> > > for (dev =3D bus->devices; dev && (done =3D=3D 0); dev =3D
> > > dev->next)
> > > {
> > > udev =3D usb_open (dev);
> > > printf ("udev =3D %p\n", udev);
> > > if ((dev->descriptor.idVendor =3D=3D VENDOR_ID_NICE)
> > > && (dev->descriptor.idProduct =3D=3D
> > > PRODUCT_ID_CONTACT_CLOSURE))
> > > {
> > > printf ("Found it!\n");
> > > uci =3D usb_claim_interface (udev, 0);
> > > printf ("Return value from
> > > usb_claim_interface: %d\n", uci);
> > > retval =3D uci;
> > > done =3D 1;
> > > }
> > > else
> > > {
> > > printf ("Not ours, VID =3D %04X, PID =3D
> > > %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> > > usb_close (udev);
> > > printf ("Closed: %p\n", udev);
> > > }
> > > }
> > > }
> > > return retval;
> > > }
> > >=20
> > > int main (void)
> > > {
> > > int init_result;
> > >=20
> > > init_result =3D init ();
> > > if (init_result =3D=3D 0)
> > > {
> > > printf ("Starting...\n");
> > > }
> > > else
> > > {
> > > printf ("Failed\n");
> > > }
> > > }
> > >=20
> > > When I run it, I get a couple of "Not ours, VID =3D " etc.=20
> > messages for
> > > other USB items I have, followed by "Found it!" But then=20
> > "Return value
> > > from usb_claim_interface: -22" which I don't understand. =20
> I think it
> > > indicates an illegal parameter. udev must be OK, I assume.=20
> > My device
> > > only has interface 0. It's a very simple device, with a=20
> > vendor-specific
> > > protocol, specified at interface level.
> > >=20
> > > Can anyone see what I'm doing wrong, please?
> > >=20
> > > libusb-win32 downloaded from the main libusb-win32 site=20
> > this week. No
> > > previous copy on this computer. Windows XP.
> > >=20
> > > Dave
> > >=20
> > >=20
> > >=20
> > **************************************************************
> > **************************************************************
> > **************************************************************
> > *******************************************************
> > >=20
> > > NICE CTI Systems UK Limited ("NICE") is registered in=20
> England under=20
> > > company number, 3403044. The registered office of NICE is at=20
> > > Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
> > >=20
> > > Confidentiality: This communication and any attachments=20
> are intended
> > > for the above-named persons only and may be confidential and/or=20
> > > legally privileged. Any opinions expressed in this=20
> communication are
> > > not necessarily those of NICE. If this communication has=20
> come to you
> > > in error you must take no action based on it, nor must=20
> you copy or=20
> > > show it to anyone; please delete/destroy and inform the=20
> sender by e-
> > > mail immediately.
> > >=20
> > > Monitoring: NICE may monitor incoming and outgoing e-mails.
> > >=20
> > > Viruses: Although we have taken steps toward ensuring=20
> that this e-
> > > mail and attachments are free from any virus, we advise that in=20
> > > keeping with good computing practice the recipient should ensure=20
> > > they are actually virus free.
> > >=20
> > >=20
> > **************************************************************
> > **************************************************************
> > **************************************************************
> > **********************************************************
> > >=20
> > >=20
> > >=20
> > >=20
> > >=20
> > --------------------------------------------------------------
> > -----------
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Lib...@li...
> > > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >=20
> >=20
> > --------------------------------------------------------------
> > -----------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Lib...@li...
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >=20
>=20
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>=20
|
|
From: Dave H. <DAV...@ni...> - 2007-06-06 14:20:26
|
Wow, what a rapid reply! Thanks. I tried your fix, and it has got me
one step further.
(I note that usb_set_configuration (udev, 0) gives the same error -22 as
not calling it. The only configuration I have is numbered 0; is this
OK?)
Setting configuration to 1 makes the call return 0, so it looks like
it's working, but it fails at the next step. In the main loop, I do:
printf ("Starting...\n");
while (1)
{
if (usb_interrupt_read (contact_closure_usb_dev,
contact_closure_usb_input_endpoint,
cBuf,
4,
0) > 0)
{
printf ("Got some\n");
}
}
but the printf statement is never executed, although I am doing things
that should cause the interface to send messages - which are 4 bytes
each.
Any more ideas?
Dave
> -----Original Message-----
> From: lib...@li...=20
> [mailto:lib...@li...] On=20
> Behalf Of Stephan Meyer
> Sent: 2007 June 06 14:05
> To: lib...@li...
> Subject: Re: [Libusb-win32-devel] Help, please
>=20
> Try to replace:
>=20
> uci =3D usb_claim_interface (udev, 0);
>=20
> with
>=20
> usb_set_configuation(udev, 1);
> uci =3D usb_claim_interface (udev, 0);
>=20
> It should work then.
>=20
>=20
> Stephan
>=20
>=20
>=20
>=20
> > Help, please. I've started writing a programme to use=20
> libusb-win32, but
> > I'm getting an error right at the start.
> >=20
> > First, some background. I've used libusb under Linux=20
> (Fedora Core 5)
> > successfully, to write driver functions for the first USB=20
> device that I
> > wrote firmware for. That device works entirely happily=20
> under FC5 and
> > under RISC O (yes, the Acorn/Pace/Castle one). I have now written
> > firmware for a second device. Perhaps unsurprisingly, this device's
> > firmware is very heavily based on the previous one. This=20
> device also
> > works entirely happily under RISC OS. I thought I'd try=20
> this Windows
> > thing, but I'm having no success.
> >=20
> > The entire programme is here:
> >=20
> > // Can I get this system to do what I want?
> > #include <usb.h>
> > #include <stdio.h>
> >=20
> > #define VENDOR_ID_NICE 0x16A8
> > #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
> >=20
> > int init (void)
> > {
> > //int usb_busses;
> > struct usb_bus* bus;
> > struct usb_device* dev;
> > usb_dev_handle *udev;
> > int retval =3D -1;
> > int uci;
> > int done =3D 0;
> >=20
> > printf ("Hello\n");
> >=20
> > usb_init ();
> > usb_find_busses ();
> > usb_find_devices ();
> > for (bus =3D usb_get_busses (); bus; bus =3D bus->next)
> > {
> > for (dev =3D bus->devices; dev && (done =3D=3D 0); dev =3D
> > dev->next)
> > {
> > udev =3D usb_open (dev);
> > printf ("udev =3D %p\n", udev);
> > if ((dev->descriptor.idVendor =3D=3D VENDOR_ID_NICE)
> > && (dev->descriptor.idProduct =3D=3D
> > PRODUCT_ID_CONTACT_CLOSURE))
> > {
> > printf ("Found it!\n");
> > uci =3D usb_claim_interface (udev, 0);
> > printf ("Return value from
> > usb_claim_interface: %d\n", uci);
> > retval =3D uci;
> > done =3D 1;
> > }
> > else
> > {
> > printf ("Not ours, VID =3D %04X, PID =3D
> > %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> > usb_close (udev);
> > printf ("Closed: %p\n", udev);
> > }
> > }
> > }
> > return retval;
> > }
> >=20
> > int main (void)
> > {
> > int init_result;
> >=20
> > init_result =3D init ();
> > if (init_result =3D=3D 0)
> > {
> > printf ("Starting...\n");
> > }
> > else
> > {
> > printf ("Failed\n");
> > }
> > }
> >=20
> > When I run it, I get a couple of "Not ours, VID =3D " etc.=20
> messages for
> > other USB items I have, followed by "Found it!" But then=20
> "Return value
> > from usb_claim_interface: -22" which I don't understand. I think it
> > indicates an illegal parameter. udev must be OK, I assume.=20
> My device
> > only has interface 0. It's a very simple device, with a=20
> vendor-specific
> > protocol, specified at interface level.
> >=20
> > Can anyone see what I'm doing wrong, please?
> >=20
> > libusb-win32 downloaded from the main libusb-win32 site=20
> this week. No
> > previous copy on this computer. Windows XP.
> >=20
> > Dave
> >=20
> >=20
> >=20
> **************************************************************
> **************************************************************
> **************************************************************
> *******************************************************
> >=20
> > NICE CTI Systems UK Limited ("NICE") is registered in England under=20
> > company number, 3403044. The registered office of NICE is at=20
> > Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
> >=20
> > Confidentiality: This communication and any attachments are intended
> > for the above-named persons only and may be confidential and/or=20
> > legally privileged. Any opinions expressed in this communication are
> > not necessarily those of NICE. If this communication has come to you
> > in error you must take no action based on it, nor must you copy or=20
> > show it to anyone; please delete/destroy and inform the sender by e-
> > mail immediately.
> >=20
> > Monitoring: NICE may monitor incoming and outgoing e-mails.
> >=20
> > Viruses: Although we have taken steps toward ensuring that this e-
> > mail and attachments are free from any virus, we advise that in=20
> > keeping with good computing practice the recipient should ensure=20
> > they are actually virus free.
> >=20
> >=20
> **************************************************************
> **************************************************************
> **************************************************************
> **********************************************************
> >=20
> >=20
> >=20
> >=20
> >=20
> --------------------------------------------------------------
> -----------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Lib...@li...
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>=20
>=20
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>=20
|
|
From: Stephan M. <Ste...@ia...> - 2007-06-06 13:04:52
|
Try to replace:
uci = usb_claim_interface (udev, 0);
with
usb_set_configuation(udev, 1);
uci = usb_claim_interface (udev, 0);
It should work then.
Stephan
> Help, please. I've started writing a programme to use libusb-win32, but
> I'm getting an error right at the start.
>
> First, some background. I've used libusb under Linux (Fedora Core 5)
> successfully, to write driver functions for the first USB device that I
> wrote firmware for. That device works entirely happily under FC5 and
> under RISC O (yes, the Acorn/Pace/Castle one). I have now written
> firmware for a second device. Perhaps unsurprisingly, this device's
> firmware is very heavily based on the previous one. This device also
> works entirely happily under RISC OS. I thought I'd try this Windows
> thing, but I'm having no success.
>
> The entire programme is here:
>
> // Can I get this system to do what I want?
> #include <usb.h>
> #include <stdio.h>
>
> #define VENDOR_ID_NICE 0x16A8
> #define PRODUCT_ID_CONTACT_CLOSURE 0x0004
>
> int init (void)
> {
> //int usb_busses;
> struct usb_bus* bus;
> struct usb_device* dev;
> usb_dev_handle *udev;
> int retval = -1;
> int uci;
> int done = 0;
>
> printf ("Hello\n");
>
> usb_init ();
> usb_find_busses ();
> usb_find_devices ();
> for (bus = usb_get_busses (); bus; bus = bus->next)
> {
> for (dev = bus->devices; dev && (done == 0); dev =
> dev->next)
> {
> udev = usb_open (dev);
> printf ("udev = %p\n", udev);
> if ((dev->descriptor.idVendor == VENDOR_ID_NICE)
> && (dev->descriptor.idProduct ==
> PRODUCT_ID_CONTACT_CLOSURE))
> {
> printf ("Found it!\n");
> uci = usb_claim_interface (udev, 0);
> printf ("Return value from
> usb_claim_interface: %d\n", uci);
> retval = uci;
> done = 1;
> }
> else
> {
> printf ("Not ours, VID = %04X, PID =
> %04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
> usb_close (udev);
> printf ("Closed: %p\n", udev);
> }
> }
> }
> return retval;
> }
>
> int main (void)
> {
> int init_result;
>
> init_result = init ();
> if (init_result == 0)
> {
> printf ("Starting...\n");
> }
> else
> {
> printf ("Failed\n");
> }
> }
>
> When I run it, I get a couple of "Not ours, VID = " etc. messages for
> other USB items I have, followed by "Found it!" But then "Return value
> from usb_claim_interface: -22" which I don't understand. I think it
> indicates an illegal parameter. udev must be OK, I assume. My device
> only has interface 0. It's a very simple device, with a vendor-specific
> protocol, specified at interface level.
>
> Can anyone see what I'm doing wrong, please?
>
> libusb-win32 downloaded from the main libusb-win32 site this week. No
> previous copy on this computer. Windows XP.
>
> Dave
>
>
>
*************************************************************************************************************************************************************************************************************************************************
>
> NICE CTI Systems UK Limited ("NICE") is registered in England under
> company number, 3403044. The registered office of NICE is at
> Tollbar Way, Hedge End, Southampton, Hampshire SO30 2ZP.
>
> Confidentiality: This communication and any attachments are intended
> for the above-named persons only and may be confidential and/or
> legally privileged. Any opinions expressed in this communication are
> not necessarily those of NICE. If this communication has come to you
> in error you must take no action based on it, nor must you copy or
> show it to anyone; please delete/destroy and inform the sender by e-
> mail immediately.
>
> Monitoring: NICE may monitor incoming and outgoing e-mails.
>
> Viruses: Although we have taken steps toward ensuring that this e-
> mail and attachments are free from any virus, we advise that in
> keeping with good computing practice the recipient should ensure
> they are actually virus free.
>
>
****************************************************************************************************************************************************************************************************************************************************
>
>
>
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
|
|
From: Dave H. <DAV...@ni...> - 2007-06-06 12:59:23
|
Help, please. I've started writing a programme to use libusb-win32, but
I'm getting an error right at the start.
First, some background. I've used libusb under Linux (Fedora Core 5)
successfully, to write driver functions for the first USB device that I
wrote firmware for. That device works entirely happily under FC5 and
under RISC O (yes, the Acorn/Pace/Castle one). I have now written
firmware for a second device. Perhaps unsurprisingly, this device's
firmware is very heavily based on the previous one. This device also
works entirely happily under RISC OS. I thought I'd try this Windows
thing, but I'm having no success.
The entire programme is here:
// Can I get this system to do what I want?
#include <usb.h>
#include <stdio.h>
#define VENDOR_ID_NICE 0x16A8
#define PRODUCT_ID_CONTACT_CLOSURE 0x0004
int init (void)
{
//int usb_busses;
struct usb_bus* bus;
struct usb_device* dev;
usb_dev_handle *udev;
int retval =3D -1;
int uci;
int done =3D 0;
printf ("Hello\n");
usb_init ();
usb_find_busses ();
usb_find_devices ();
for (bus =3D usb_get_busses (); bus; bus =3D bus->next)
{
for (dev =3D bus->devices; dev && (done =3D=3D 0); dev =3D
dev->next)
{
udev =3D usb_open (dev);
printf ("udev =3D %p\n", udev);
if ((dev->descriptor.idVendor =3D=3D VENDOR_ID_NICE)
&& (dev->descriptor.idProduct =3D=3D
PRODUCT_ID_CONTACT_CLOSURE))
{
printf ("Found it!\n");
uci =3D usb_claim_interface (udev, 0);
printf ("Return value from
usb_claim_interface: %d\n", uci);
retval =3D uci;
done =3D 1;
}
else
{
printf ("Not ours, VID =3D %04X, PID =3D
%04X\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
usb_close (udev);
printf ("Closed: %p\n", udev);
}
}
}
return retval;
}
int main (void)
{
int init_result;
init_result =3D init ();
if (init_result =3D=3D 0)
{
printf ("Starting...\n");
}
else
{
printf ("Failed\n");
}
}
When I run it, I get a couple of "Not ours, VID =3D " etc. messages for
other USB items I have, followed by "Found it!" But then "Return value
from usb_claim_interface: -22" which I don't understand. I think it
indicates an illegal parameter. udev must be OK, I assume. My device
only has interface 0. It's a very simple device, with a vendor-specific
protocol, specified at interface level.
Can anyone see what I'm doing wrong, please?
libusb-win32 downloaded from the main libusb-win32 site this week. No
previous copy on this computer. Windows XP.
Dave
***************************************************************************=
***************************************************************************=
***************************************************************************=
****************
NICE CTI Systems UK Limited ("NICE") is registered in England under company=
number, 3403044. The registered office of NICE is at Tollbar Way, Hedge E=
nd, Southampton, Hampshire SO30 2ZP.
Confidentiality: This communication and any attachments are intended for th=
e above-named persons only and may be confidential and/or legally privilege=
d. Any opinions expressed in this communication are not necessarily those o=
f NICE. If this communication has come to you in error you must take no act=
ion based on it, nor must you copy or show it to anyone; please delete/dest=
roy and inform the sender by e-mail immediately.
Monitoring: NICE may monitor incoming and outgoing e-mails.
Viruses: Although we have taken steps toward ensuring that this e-mail and=
attachments are free from any virus, we advise that in keeping with good c=
omputing practice the recipient should ensure they are actually virus free.
***************************************************************************=
***************************************************************************=
***************************************************************************=
*******************
=20
|
|
From: <Kar...@pr...> - 2007-06-02 02:00:58
|
I will be out of the office starting 01.06.2007 and will not return un= til 27.06.2007. I will respond to your message when I return. In urgent matter please contact Markus Kraus (mar...@pr... ) or Johann Loesl (joh...@pr...). Ich bin zur Zeit nicht im B=FCro und werde Ihre Email nach meiner R=FCc= kkehr als bald als m=F6glich beantworten. In dringenden F=E4llen wenden Sie s= ich bitte an Herrn Kraus (mar...@pr...) oder Herrn L=F6sl (Joh...@pr...). Mit freundlichen Gr=FC=DFe With best regards Karl Achter = |
|
From: Dan E. <dan...@ne...> - 2007-06-01 14:03:30
|
Stephan said: > Sounds like a good idea. I think this feature could be implemented by > replacing > the claimed flag with IRP->Tail->Overlay->OriginalFileObject. > > What do you think of this? > My colleague suggests: > I would strongly recommend not to use > IRP->Tail->Overlay->OriginalFileObject, it's used internally by the > IOManager and even MS > discourages from touching it. Instead of OriginalFileObject one can > use IO_STACK_LOCATION->FileObject Which seems to be working ok. I'll post a patch when we've tested it a bit, and you can decide how to add it. Dan. |
|
From: <per...@gm...> - 2007-06-01 10:55:25
|
I'm totaly new to libusb and I'm hoping someone can help me sort out the usage of the filter driver. I can find very little informaiton about it... How is it used? What is the difference compared to the device driver? /Per |
|
From: <f_...@ya...> - 2007-05-29 14:03:15
|
Hello, I' m a new user of libusb win32 api. I developed a software to communicate with a printer on usb port. This software works fine when I install full libusb-win32-filter-bin-0.1.12.1 and I used testlibusb-win.exe and it prints all information about usb ports correctly, however I would like to install only libusb-win32-device-bin and create a inf file with inf wizard. I create a file with inf wizard, and add the device with windows device manager. When I execute testlibusb-win.exe it doesn't print information about usb ports. testlibusb-win.exe only prints DLL version: 0.1.12.1 Driver version: 0.1.12.1 bus/device idVendor/idProduct I used debugview to analyze the problem and It shows the following message: LIBUSB-DRIVER - get_descriptor(): getting descriptor failed status: 0xc0000010 LIBUSB_DLL: error: usb_os_find_devices: couldn't read device descriptor Please I need your help. Best Regards, Flavio. __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ |
|
From: Dan E. <dan...@ne...> - 2007-05-29 08:23:40
|
Can you provide the code snippet which is failing? The configuration descriptor would be useful as well. It sounds like you're passing an incorrect parameter... There are normally no problems writing to a bulk endpoint if you've set things up properly. Have you set the configuration of the device? Dan. Sunflare wrote: > Thank you for your answer > I installed the latest version after deleting the old one, but it > doesn't help much I've changed the build options to link against the > new .h and .a files and I rebuild the whose thing. > > Now, I've another error message: > "usb_submit_async: submitting request failed, win error: The > parameter is incorrect" > > Maybe I forgot something when I made the upgrade > > > Stephan Meyer wrote: >> >> >> Did you try the latest version (0.1.12.0)? >> >> >> Stephan |
|
From: Sunflare <ni...@gm...> - 2007-05-28 11:40:25
|
Thank you for your answer I installed the latest version after deleting the old one, but it doesn't help much I've changed the build options to link against the new .h and .a files and I rebuild the whose thing. Now, I've another error message: "usb_submit_async: submitting request failed, win error: The parameter is incorrect" Maybe I forgot something when I made the upgrade Stephan Meyer wrote: > > > Did you try the latest version (0.1.12.0)? > > > Stephan > > > -- View this message in context: http://www.nabble.com/bulk_write-error-%3A-not-enough-storage-available-tf3827289.html#a10834902 Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com. |
|
From: 25an <man...@gm...> - 2007-05-28 11:34:46
|
Thanks for your quick reply This is what I did to make It work In the file usb.h I changed the line where #include <pshpack1.h> with #pragma pack(push, 1) and at the line where #include <poppack.h> with #pragma pack(pop, 1) I get some warnings but I will leave them so far Stephan Meyer wrote: > > > See > http://www.nabble.com/Error-compiling-test-program-tf3508594.html#a9870106 > >> >> >> Hi! >> >> I have just started to use the libusb-win32, I am trying to get it to >> work >> with borland c-builder 6 on win XP. >> If I run the test application testlibusb-win.exe It works just fine but >> when >> I take the code and change it for the c-builder I get a problem no mather >> what I do I cant read the configure descriptor in the usb_device struct >> the >> code that I am using is this: >> >> __fastcall TForm1::TForm1(TComponent* Owner) >> : TForm(Owner) >> { >> //these method is called whene the GUI is created >> usb_init(); >> usb_find_busses(); >> usb_find_devices(); >> } >> //--------------------------------------------------------------------------- >> >> void __fastcall TForm1::Button1Click(TObject *Sender) >> { >> // whene button1 on the gui is pushed this method is executed >> version = usb_get_version(); >> >> if(version) >> { >> line = "DLL version:\t"; >> line += version->dll.major; >> line += "."; >> line += version->dll.minor; >> line += "."; >> line += version->dll.micro; >> line += "."; >> line += version->dll.nano; >> >> this->Memo1->Lines->Add(line); >> >> line = "Driver version:\t"; >> line += version->driver.major; >> line += "."; >> line += version->driver.minor; >> line += "."; >> line += version->driver.micro; >> line += "."; >> line += version->driver.nano; >> >> this->Memo1->Lines->Add(line); >> } >> >> this->Memo1->Lines->Add("bus/device\t idVendor/idProduct"); >> >> for (bus = usb_get_busses(); bus; bus = bus->next) { >> for (dev = bus->devices; dev; dev = dev->next) { >> int ret, i; >> char string[256]; >> usb_dev_handle *udev; >> >> line = bus->dirname; >> line += "/"; >> line += dev->filename; >> line += "\t"; >> line += IntToHex(dev->descriptor.idVendor,1); >> line += "/"; >> line += IntToHex(dev->descriptor.idProduct,1); >> >> this->Memo1->Lines->Add(line); >> >> udev = usb_open(dev); >> >> if (udev) { >> if (dev->descriptor.iManufacturer) { >> ret = usb_get_string_simple(udev, >> dev->descriptor.iManufacturer, >> string, sizeof(string)); >> if (ret > 0) { >> line = "- Manufacturer : "; >> line += AnsiString(string); >> this->Memo1->Lines->Add(line); >> } else { >> this->Memo1->Lines->Add("- Unable to fetch manufacturer >> string"); >> } >> } >> >> if (dev->descriptor.iProduct) { >> ret = usb_get_string_simple(udev, dev->descriptor.iProduct, >> string, >> sizeof(string)); >> if (ret > 0) { >> line = "- Product : "; >> line += AnsiString(string); >> this->Memo1->Lines->Add(line); >> } else { >> this->Memo1->Lines->Add("- Unable to fetch product string"); >> } >> } >> >> if (dev->descriptor.iSerialNumber) { >> ret = usb_get_string_simple(udev, >> dev->descriptor.iSerialNumber, >> string, sizeof(string)); >> if (ret > 0) { >> line = "- Serial number : "; >> line += AnsiString(string); >> this->Memo1->Lines->Add(line); >> } else { >> this->Memo1->Lines->Add("- Unable to fetch serial number >> string"); >> } >> } >> >> usb_close (udev); >> } >> >> if (!dev->config) { >> this->Memo1->Lines->Add(" Couldn't retrieve descriptors"); >> continue; >> } >> >> i = 0; >> for (i = 0; i < dev->descriptor.bNumConfigurations; i++) >> print_configuration(&dev->config[i]); >> } >> } >> } >> //--------------------------------------------------------------------------- >> void TForm1::print_configuration(struct usb_config_descriptor *config) >> { >> int i; >> //!!!!!!!The error occur here!!!!!!!!// >> unsigned short wtlength = config->wTotalLength; //<======== When I am >> trying to get any variable in the configure descriptor >> >> line = " wTotalLength: "; >> line += wtlength; >> >> this->Memo1->Lines->Add(line); >> >> } >> >> the error that I get is accsses violation. >> >> -- >> View this message in context: >> http://www.nabble.com/libusb-with-borland-c-builder-tf3827103.html#a10833779 >> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Libusb-win32-devel mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel >> > > > _______________________________________________________________ > SMS schreiben mit WEB.DE FreeMail - einfach, schnell und > kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > > -- View this message in context: http://www.nabble.com/libusb-with-borland-c-builder-tf3827103.html#a10834834 Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com. |
|
From: 25an <man...@gm...> - 2007-05-28 11:32:28
|
I have look at it some more and this is what I did
In the file usb.h I changed the line where
#include <pshpack1.h>
with
#pragma pack(push, 1)
and at the line where
#include <poppack.h>
with
#pragma pack(pop, 1)
25an wrote:
>
> I changed in the usb.h file
>
> /* ensure byte-packed structures */
> #pragma pack(1)
> #pragma pack(push)
> #pragma pack(pop)
> //#include <pshpack1.h>
>
> This made it work but I got some warnings that I have not yet managed to
> solve I guess it have something to do how I am using the pragma I have not
> figured out how the pragma pack works.
>
>
> Dan Martins-2 wrote:
>>
>> I have this:
>>
>> windows xp service pack 2
>> borland c++ builder version 6.0 (build 10.157)
>> libusb-win32 0.1.12.1
>>
>> the thing is the precompiled program works fine with the hardware, giving
>> me
>> all the info I can't get when I try to compile the program myself. that's
>> why I think it's a problem with the compiler. any ideas? thanks in
>> advance.
>>
>> Dan Leite Martins
>>
>>
>> On 4/3/07, Stephan Meyer <ste...@we...> wrote:
>>>
>>>
>>> This sound like an alignment problem.
>>> Some BC6 versions had serious bugs in the pshpack*.h files.
>>> Do you have the latest service pack installed?
>>>
>>> Stephan
>>>
>>>
>>> >
>>> > Hi there,
>>> >
>>> >
>>> > When trying to compile the example program [testlibusb_win.c], I get
>>> an
>>> error when I try to access the variables of the struct
>>> usb_config_descriptor
>>> > , which is been pointed by the variable struct usb_device *dev. The
>>> function,
>>> >
>>> >
>>> > for (i = 0; i < dev->descriptor.bNumConfigurations; i++)
>>> > print_configuration(&dev->config[i]);
>>> >
>>> >
>>> > passes a valid memory address, but all of its values are NULL. So when
>>> I
>>> try to run this function,
>>> >
>>> >
>>> >
>>> > static void print_configuration(struct usb_config_descriptor
>>> *config)
>>> > {
>>> > int i;
>>> >
>>> > edit_printf(" wTotalLength: %d\r\n",
>>> config->wTotalLength);
>>> >
>>> > edit_printf(" bNumInterfaces: %d\r\n",
>>> config->bNumInterfaces);
>>> > edit_printf(" bConfigurationValue: %d\r\n",
>>> config->bConfigurationValue);
>>> > edit_printf(" iConfiguration: %d\r\n",
>>> config->iConfiguration);
>>> >
>>> > edit_printf(" bmAttributes: %02xh\r\n",
>>> config->bmAttributes);
>>> > edit_printf(" MaxPower: %d\r\n", config->MaxPower);
>>> >
>>> >
>>> > for (i = 0; i < config->bNumInterfaces; i++)
>>> > print_interface(&config->interface[i]);
>>> > }
>>> >
>>> >
>>> > it stops on this line,
>>> >
>>> >
>>> > edit_printf(" wTotalLength: %d\r\n", config->wTotalLength);
>>> >
>>> >
>>> >
>>> > giving the following error message:
>>> >
>>> >
>>> > Project raised exception EAccessViolation with message 'Access
>>> violation at address 00401A82. Read of address 00000035'. Process
>>> stopped.
>>> >
>>> >
>>> >
>>> > the address 00000035 is owned by the variable the program tried to
>>> access, config->wTotalLength.
>>> >
>>> >
>>> > If I don't use this struct, the program runs fine, but I don't get all
>>> the info the pre-compiled program gets, only Bus, Device, Vendor ID,
>>> Product
>>> ID, Manufacturer and Product.
>>> >
>>> >
>>> > Do you have an idea of why this is happening? Could be the compiler's
>>> fault? I'm using Borland C++ Builder 6's compiler. Any comments will be
>>> very
>>> welcomed. Thanks in advance,
>>> >
>>> >
>>> > Dan Leite Martins
>>> >
>>> > -----------------------------------------------------------------
>>> >
>>> -------------------------------------------------------------------------
>>> > Take Surveys. Earn Cash. Influence the Future of IT
>>> > Join SourceForge.net's Techsay panel and you'll get the chance to
>>> share
>>> your
>>> > opinions on IT & business topics through brief surveys-and earn cash
>>> >
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> >
>>> > -----------------------------------------------------------------
>>> > _______________________________________________
>>> > Libusb-win32-devel mailing list
>>> > Lib...@li...
>>> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>> >
>>>
>>>
>>> _______________________________________________________________
>>> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
>>> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>>>
>>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> Libusb-win32-devel mailing list
>>> Lib...@li...
>>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Libusb-win32-devel mailing list
>> Lib...@li...
>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Error-compiling-test-program-tf3508594.html#a10834801
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
|
|
From: 25an <man...@gm...> - 2007-05-28 11:19:48
|
I changed in the usb.h file
/* ensure byte-packed structures */
#pragma pack(1)
#pragma pack(push)
#pragma pack(pop)
//#include <pshpack1.h>
This made it work but I got some warnings that I have not yet managed to
solve I guess it have something to do how I am using the pragma I have not
figured out how the pragma pack works.
Dan Martins-2 wrote:
>
> I have this:
>
> windows xp service pack 2
> borland c++ builder version 6.0 (build 10.157)
> libusb-win32 0.1.12.1
>
> the thing is the precompiled program works fine with the hardware, giving
> me
> all the info I can't get when I try to compile the program myself. that's
> why I think it's a problem with the compiler. any ideas? thanks in
> advance.
>
> Dan Leite Martins
>
>
> On 4/3/07, Stephan Meyer <ste...@we...> wrote:
>>
>>
>> This sound like an alignment problem.
>> Some BC6 versions had serious bugs in the pshpack*.h files.
>> Do you have the latest service pack installed?
>>
>> Stephan
>>
>>
>> >
>> > Hi there,
>> >
>> >
>> > When trying to compile the example program [testlibusb_win.c], I get an
>> error when I try to access the variables of the struct
>> usb_config_descriptor
>> > , which is been pointed by the variable struct usb_device *dev. The
>> function,
>> >
>> >
>> > for (i = 0; i < dev->descriptor.bNumConfigurations; i++)
>> > print_configuration(&dev->config[i]);
>> >
>> >
>> > passes a valid memory address, but all of its values are NULL. So when
>> I
>> try to run this function,
>> >
>> >
>> >
>> > static void print_configuration(struct usb_config_descriptor *config)
>> > {
>> > int i;
>> >
>> > edit_printf(" wTotalLength: %d\r\n",
>> config->wTotalLength);
>> >
>> > edit_printf(" bNumInterfaces: %d\r\n",
>> config->bNumInterfaces);
>> > edit_printf(" bConfigurationValue: %d\r\n",
>> config->bConfigurationValue);
>> > edit_printf(" iConfiguration: %d\r\n",
>> config->iConfiguration);
>> >
>> > edit_printf(" bmAttributes: %02xh\r\n",
>> config->bmAttributes);
>> > edit_printf(" MaxPower: %d\r\n", config->MaxPower);
>> >
>> >
>> > for (i = 0; i < config->bNumInterfaces; i++)
>> > print_interface(&config->interface[i]);
>> > }
>> >
>> >
>> > it stops on this line,
>> >
>> >
>> > edit_printf(" wTotalLength: %d\r\n", config->wTotalLength);
>> >
>> >
>> >
>> > giving the following error message:
>> >
>> >
>> > Project raised exception EAccessViolation with message 'Access
>> violation at address 00401A82. Read of address 00000035'. Process
>> stopped.
>> >
>> >
>> >
>> > the address 00000035 is owned by the variable the program tried to
>> access, config->wTotalLength.
>> >
>> >
>> > If I don't use this struct, the program runs fine, but I don't get all
>> the info the pre-compiled program gets, only Bus, Device, Vendor ID,
>> Product
>> ID, Manufacturer and Product.
>> >
>> >
>> > Do you have an idea of why this is happening? Could be the compiler's
>> fault? I'm using Borland C++ Builder 6's compiler. Any comments will be
>> very
>> welcomed. Thanks in advance,
>> >
>> >
>> > Dan Leite Martins
>> >
>> > -----------------------------------------------------------------
>> >
>> -------------------------------------------------------------------------
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> > opinions on IT & business topics through brief surveys-and earn cash
>> >
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> >
>> > -----------------------------------------------------------------
>> > _______________________________________________
>> > Libusb-win32-devel mailing list
>> > Lib...@li...
>> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>> >
>>
>>
>> _______________________________________________________________
>> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
>> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Libusb-win32-devel mailing list
>> Lib...@li...
>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>
>
--
View this message in context: http://www.nabble.com/Error-compiling-test-program-tf3508594.html#a10834691
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
|
|
From: Stephan M. <ste...@we...> - 2007-05-28 11:01:41
|
Did you try the latest version (0.1.12.0)? Stephan > > > Hello everyone. > > I'm trying to make bulk transfers between the host and a PIC4550 mcu. > I could make usb_bulk_read requests without problems, but the > usb_bulk_write function doesn't work: > LIBUSB_DLL error: usb_submit_async: error: Not enough storage is available > to process this command > > Where does this come from? > > I'm using libusb_win32 v 0.1.10.1 > > -- > View this message in context: http://www.nabble.com/bulk_write-error-%3A-not-enough-storage-available-tf3827289.html#a10834263 > Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > _______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 |