Hello linux mce peeps.
I have been beavering away for the last week or so on an implementation of the DCE protocol in Java.
I now have a version mostly ready(possibly), so I thought I would present it for review.
The basic reading of the binary stream is derived from the TivoOrbiter code in svn, and the docs on the subject in the wiki.
I have developed a library that is intended to be usable on both JavaSE and Java ME (MIDP 2.0 via network sockets, not bluetooth).
In order to do this, without hobbling the api to java 1.3 and the ME subset, I've developed the core library in java 1.3 (and ME subset), and then created 2 'profiles' (I'm a java dav, gotta follow sun on this . .) SE and ME.
So I have 3 jar files :-
jdce-core.jar
jdce-me.jar
jdce-se.jar
The 2 profiles provide the API for the device programmer, the core library does the heavy lifting, and is shared. The 2 versions of the API are very similar, but the SE one uses generics, the collections framework and enums, the ME one . . doesn't.
To get a hold of this library, since this is targeted at developers only, you must check it out of sourceforge subversion.
svn co
https://javadce.svn.sourceforge.net/svnroot/javadce/trunk jdce
Within the jdce directory you will find the 3 libraries, 2 example devices (one SE, one ME) and an ant build file.
To compile all the libs and devices run ant (see below to get J2ME compilation working)
Examine the device source code for usage, feel free to dig into the library source as well.
This is all quite lightly tested, and likely won't work(see the magic numbers below) It is not release quality, please don't view it as anything more than highly experimental code.
Please note that this is not, and will not be included with the LinuxMCE 8.10 release. it
may (going off brief conversations with the devs) be possible to includ it with future versions of LMCE if it is shown to be popular enough and above all stable. So by all means send
me bug reports and ideas for improvements.
Please don't hassle the regular devs with this, they don't know anything about it, and won't be able to help you.
Before you submit a bug report about the 'magic' numbers everywhere, I haven't yet implemented scraping the DB for the reference information (a la sql2cpp). I will be doing this as a priority and integrating it into the ant build. At present, this means that command/ event id's, parameter id's etc are hard coded into the source, and are from my system. They may well be the same as on yours, they likely won't (as I've made some new commands etc for the bit torrent device).
I'm not trying to re-implement any part of LinuxMCE, only extend the potential reach of the system into Java land, and allow new parts of the system to be developed by all those Java programmers out there.
Have fun, lemme know if any one is interested.
David.
BugsBug reports go to me, not to the LinuxMCE trac; you can put them on sourceforge (
https://sourceforge.net/projects/javadce), if you like.
J2ME SDKYou need to have some j2me development kit installed to compile jdce-me and the example J2ME device. I use the sub WTK2.5.2 (from Sun). The compilation tool I've used (antenna), seems to support most of the others automatically, however you do need to set a property (wtk.home) in the build files (core, me, ExampleDevice) to reflect your installation.
AndroidAfter a, very, brief look into the android sdk I believe that all the classes I have used are within the standard android library, apart from the odd apache commons class I have used. I haven't tested this, I'm not an android dev, however I will be more than happy to make amendments to support this on android.