On Tue, Oct 15, 2013 at 7:12 AM, SANJAY GUPTA <gupta.san...@samsung.com> wrote: > 2. Token Packet Format - | Sync | PID | ADDR | ENDP | CRC5 | EOP | > Data Packet Format - | Sync | PID | Data | CRC16 | EOP | > Handshake Packet Format - | Sync | PID | EOP | > > Question:- Does the javax.usb APIs take care these low level details of > preparing these packets for the given data to transfer ? > Or if the programmer is expected to form the packets in desired format before > actually starting the transmission? If yes, how to calculate fields CRC, Sync > etc.? > As per my understanding, the javax.usb APIs do the task for provided data > buffer for transmission.
The sync, pid, etc. tokens are handled entirely by the usb host controller hardware. No software is involved in directly managing them (they are indirectly managed by the usb host controller driver, which manages the host-controller-specific data structures and api) > Also, the Usb specification does not impose any structural constraints on the > actual data being transmitted. Let me know, if I am wrong The usb spec imposes no constraints on the actual data being transmitted. Each device does have a specific protocol that must be followed however. > > > Second, Linux will be driving this device by default, and allowing you > to access it as a normal storage device. Why don't you want to let > Linux do the mass storage work for you? Just mount the device's > filesystem(s) and access them directly using normal file i/o. > > => My purpose is to create a test application using javax.usb APIs for > testing the performance of USB on different printer models. if you understand your printers' interface(s), you should work directly with them instead of using a usb key. Mass storage isn't a simple protocol. > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk > _______________________________________________ > javax-usb-devel mailing list > javax-usb-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/javax-usb-devel ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk _______________________________________________ javax-usb-devel mailing list javax-usb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/javax-usb-devel