LinuxMCE Forums

General => Developers => Topic started by: lomeshp on January 11, 2012, 08:36:24 pm

Title: LinuxMCE with C#
Post by: lomeshp on January 11, 2012, 08:36:24 pm
I am interested in creating C# app that would send commands to LinuxMCE, any suggestions?
Title: Re: LinuxMCE with C#
Post by: JoakimL on January 11, 2012, 08:55:19 pm
Mono as platform and then you'd need to port parts of the DCE implementation (the part responsible for sending and receiving from DCE as a client).

/Joakim
Title: Re: LinuxMCE with C#
Post by: lomeshp on January 11, 2012, 10:08:34 pm
Thanks.  I've been trying to find a good tutorial on how to write apps that can communicate with LinuxMCE, does anyone of a good tutorial?
Title: Re: LinuxMCE with C#
Post by: tschak909 on January 11, 2012, 11:43:47 pm
Read both the Developers guide, and Developing a DCE Device, on the wiki.

-Thom
Title: Re: LinuxMCE with C#
Post by: Kezza on January 12, 2012, 10:46:25 am
If you do get anything built in C#(going or not) please post info on here/wiki as it's something I've been thinking of looking into and have read a fair chunk of the wiki so very slowly kinda getting an idea of how things work  :-\

Title: Re: LinuxMCE with C#
Post by: tschak909 on January 12, 2012, 03:24:32 pm
Please ask questions. Some of us in here know the stack incredibly well, and can speed up the process of understanding.

-Thom
Title: Re: LinuxMCE with C#
Post by: lomeshp on January 13, 2012, 06:47:11 pm
I built a C# orbiter for testing purposes.  It works but there are issues and maybe someone can help.  The way I am sending messages to DCERouter is through a socked.  I am sending the command as "TOUCH 100x100"  (100x100 is just an example).  This only works if the screen on the weborbiter is same as the command I am calling.

Where can I find list of commands so that I can direclty call DCERouter using C# socket?
Title: Re: LinuxMCE with C#
Post by: tschak909 on January 13, 2012, 07:00:21 pm
You need to read the Developers Guide first. It explains DCE. The list of commands themselves can be found in the Advanced > DCE > Commands / Events / Device Data menu in the web admin.

Also, you need to look at the C++ code in src/DCE to get an idea of how DCE is structured, and what is possible from the header files.

-Thom
Title: Re: LinuxMCE with C#
Post by: Marie.O on January 19, 2012, 12:32:15 pm
The socket you are sending stuff to is using the so called Proxy Orbiter. It is a kludge that was created for the web orbiter in the first place. A "real" orbiter doesn't talk to the socket of Proxy Orbiter, but sends and receives messages to dcerouter. As TSCHAK pointed out there is a nice wiki page about it. For sending stuff, you can use the MessageSend binary. Or create a small library in c# to do the same thing. in my peoples dir in svn there is a PHP lib that supports message sending in native PHP. svn/peoples/posde/iOrbiter/libMessageSend.php iirc.
Title: Re: LinuxMCE with C#
Post by: buckle on March 11, 2012, 06:13:15 pm
The socket you are sending stuff to is using the so called Proxy Orbiter. It is a kludge that was created for the web orbiter in the first place. A "real" orbiter doesn't talk to the socket of Proxy Orbiter, but sends and receives messages to dcerouter.

There is already a .NET implementation of touch orbiter, UnOrbiter.NET.  http://svn.linuxmce.org/trac.cgi/ticket/795 (http://svn.linuxmce.org/trac.cgi/ticket/795)  It is part of the kludge, though, so it probably doesn't help get you towards your goal.

You might be able to import the DCE libs into you C# project and go that route.
Title: Re: LinuxMCE with C#
Post by: ajward on March 22, 2012, 12:29:34 pm
Is there any mileage in compiling the C++ DCE library under managed C++ in .Net?

It would then be straightforward for C# to call managed C++.

Andy.
Title: Re: LinuxMCE with C#
Post by: tschak909 on March 22, 2012, 05:01:25 pm
Dude, don't ask, just do it. ;)

-Thom