The common RI has a os interface package, com/ibm/jusb/os/, which should 
make porting and/or writing from scratch relatively easy (hopefully)...

First place to start is to create a UsbServices implementation.  There is 
an AbstractUsbServices in the os package you can extend.  The abstract 
package does provide the top-level virtual root hub, but you'll need to 
populate the rest of the tree.  You can do the population either in a 
static initializer or the class initializer.  But, the topology should be 
fully populated before you return the root UsbHub (or let anyone add a 
listener).

The rules for creating the topology objects are (should be) defined in 
each of the classes, i.e. UsbDevice, UsbConfiguration, etc.  The common RI 
os-interface could make this process easier, but the current setup 
requires the platform implementation to create its own topology objects.

Once the topology is created, the common RI takes care of a lot of the 
API.  The method calls coming in are all in the os package interfaces, 
e.g. UsbDeviceOsImp.asyncSubmit(), UsbPipeOsImp.asyncSubmit(), etc.  Only 
the asyncSubmit(UsbIrp) is required to be implemented as all the other 
methods can boil down to that method; the os-package classes handle that.  
You're free to override any method of course if the platform provides a 
better way to implement it (e.g. in Linux, Isochronous submission of Lists 
is optimized).

That's a start at least, don't forget hotplugging :)


On Tue, 8 Mar 2005, Brad BARCLAY wrote:

>Good-day Everyone:
>
>       Before I try wending my way through the source code to figure it out 
>for myself, has anyone put together a porting guide for implementing 
>javax.usb on other platforms?  Or does anyone have any basic guidelines 
>they'd like to share for getting started?
>
>       (And before anyone asks, yes I have lots of JNI experience, and some 
>general USB coding experience :) ).
>
>       I'm going to be starting to put together the framework of a Mac OS X 
>implementation in the near future, and would like to get the Java part 
>out of the way so I can concentrate on implementing the needed JNI 
>methods.
>
>       TIA!
>
>Brad BARCLAY,
>Lead Developer & Project Administrator,
>The jSyncManager Project.
>
>=-=-=-=-=-=-=-=-=-=
> From the Mac OS X Desktop of Brad BARCLAY
>E-Mail:  [EMAIL PROTECTED]     Web:  http://www.jsyncmanager.org
>

-- 
Dan Streetman
[EMAIL PROTECTED]
---------------------
186,272 miles per second:
It isn't just a good idea, it's the law!


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to