On Fri, Oct 16, 2009 at 3:00 PM, Andre Juffer <andre.juf...@oulu.fi> wrote: > Dan Streetman wrote: >> I'm still not sure if you really understand what is going on, since >> 10000000 does NOT convert to 128, since 10000000 is decimal, not >> binary. But anyway since I have pointed out that ((byte)10000000) >> just happens to convert to 0x80, it "works" and I'll drop it (although >> it is definitely completely incorrect code). > > I was trying to say that in the actual program, the '10000000' is > handled as a bit set, never as the decimal 1000000. The code I showed in > the earlier email did not properly reflect this, as I left out a few > lines. I just wrote (hasty as I was) '(byte)10000000)', which, as you > point out, is completely wrong of course. > > From the documentation I referred to earlier, I understood that for a > status report the value of bmRequestType should correspond to '10000000' > (again -not- the decimal, but the byte consisting of the listed bits, > each bit has a particular meaning, as documented in the USB standard).
FYI, I have never seen anyone use binary in code or discussion, everyone uses hex, So 10000000 binary is 0x80. Not only is saying 0x80 obviously much shorter and quicker than saying "10000000 binary" but the leading 0x tells the reader that the number is hex so there is no confusion. > > I am sure my incorrect wording (e.g. 'convert') is causing all the > confusion, for which I apologize. I am not experienced at all with this > type of 'low-level' programming and terminology so this all is really a > steep learning curve. > >> I don't understand what you are trying to say or do. > > I refer to http://www.beyondlogic.org/usbnutshell/usb6.htm (first yellow > table) > > According to my interpretation, it says that a request (represented as > byte[] array) should begin with 8 byte long Setup Packet, followed by > the actual data. > > In the code I showed, I did -not- include the 8 byte setup packet. I > simply create a byte array containing just the single byte (the command > byte), use the setData(...) of UbIrp, and get it sent to the device. I > incorrectly assumed that the required 8 byte long Setup Packet would be > inserted by the javax-usb implementation. I understand from your > response that this is NOT the case. Is my conclusion correct? No of course not, how can javax.usb make up a setup packet on its own? Just use random values? ;-) What I don't understand is a setup packet refers only to a control transfer but you are talking about a transfer on a non-default pipe. I am assuming it's not a control pipe since almost nobody creates non-default control pipes on devices, since non-default control pipes are completely pointless (just use the default control pipe for all control traffic). > > Again, I appreciate very much your feedback and your patience. > > Thanks, > Andre > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > javax-usb-devel mailing list > javax-usb-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/javax-usb-devel > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ javax-usb-devel mailing list javax-usb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/javax-usb-devel