LinuxMCE Forums
May 24, 2013, 09:45:57 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Java DCE Implementation  (Read 1243 times)
david_a_dawson
Veteran
***
Posts: 66



View Profile
« on: January 31, 2010, 01:42:39 am »

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.

Bugs
Bug reports go to me, not to the LinuxMCE trac; you can put them on sourceforge (https://sourceforge.net/projects/javadce), if you like.

J2ME SDK
You 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.

Android
After 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.
Logged
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #1 on: January 31, 2010, 10:38:06 pm »

Awesome.

Will give you what feedback I can.

Good job!
Logged

I never quit... I just ping out.
hari
Administrator
LinuxMCE God
*****
Posts: 2413



View Profile WWW
« Reply #2 on: January 31, 2010, 10:49:00 pm »

Hello David,

thanks for your contribution!!

best regards,
Hari
Logged

rock your home - http://www.agocontrol.com home automation
totallymaxed
LinuxMCE God
****
Posts: 4310


View Profile WWW
« Reply #3 on: February 04, 2010, 09:55:28 am »

Hi David,

Fantastic to see this work underway! Thanks for getting involved.

All the best


Andrew
Logged

Andy Herron,
Convergent Home Technologies Ltd
United Kingdom

Dianemo S Now Shipping on Ubuntu 12.04LTS
Build your system on the latest Ubuntu OS Release!

Get a Dianemo S License: http://forum.linuxmce.org/index.php?topic=8880.0
iOS Orbiter: http://wiki.linuxmce.org/index.php/Dianemo_iOS_Orbiter
Follow us on Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

Sales & Info:
http://www.dianemo.co.uk
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #4 on: May 23, 2010, 02:51:13 am »

Is anyone using this?

-Thom
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!