Difference between revisions of "Programmer's Guide"

From LinuxMCE
Jump to: navigation, search
(Programmer's Guide Sections)
Line 23: Line 23:
 
*[[wxWidgets]]
 
*[[wxWidgets]]
 
*[[Window manager]]
 
*[[Window manager]]
 +
*[[Window controller]]
 
*[[Local pluto-test machine over standard debian-sarge]]
 
*[[Local pluto-test machine over standard debian-sarge]]
 
*[[X11 locking]]
 
*[[X11 locking]]

Revision as of 14:26, 14 September 2006

This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.
==Introduction to the Pluto Architecure==

Pluto's kick-start cd includes our own distribution based on Debian Linux. This distribution includes hundreds of scripts and utilities that Pluto has written to fully automate everything so that a PC with Pluto becomes a 'turn it on and press play' appliance, rather than a traditional software application. However if you strip away all this stuff, the guts of Pluto is software written in cross-platform c++. In fact nearly all Pluto's code runs on Windows too.

This guide explains the architecture of the main C++ code. Documentation for all the scripts and utilities that make up the distribution is here.

Pluto uses an extremely modular architecture. The heart of Pluto, the 'main application' DCERouter is nothing but a general-purpose message router. It has absolutely no code relating to any of Pluto's functionality--it just relays messages between devices. The functionality of Pluto is, therefore, entirely in separate modules (ie Devices) which all run independently and communicate with each other by passing messages through DCERouter over sockets. There can be hundreds of these devices in a smart home, that do all sorts of things. As shown in the diagram below, many of Pluto's devices are actually 'wrappers' we have written for existing open source projects that allow them to work together seamlessly in a Pluto system. For example, we wrote a wrapper for Asterisk that sends event messages to DCERouter whenever a phone call comes in, and receives command messages when it is time to place a call. How the wrapper communicates with the open source project depends on that project. Our Asterisk wrapper, for example, communicates with Asterisk over a socket. It is really a translator converting messages from its socket connection with DCERouter into messages from its socket connection with Asterisk. The wrapper for the Xine media player links in Xine's own library and calls Xine functions directly.

<img src="include/images/quickstart/swmodules.jpg" border="0">

Since there are literally thousands of home automation components and pieces of a/v equipment that require controlling with RS232, USB and Ethernet we developed a special system for these devices using GSD. It's fast and often doesn't require any real programming skills. It can be used to support lighting control systems, climate and pool systems, external devices like i/r emitters, cameras, etc. If that's your interest skip this whole page and What if you don't have a driver for my home automation devic Otherwise if you're a "real" programmer interested in adding new software modules or adding wrappers for existing software, then continue with this section.

Programmer's Guide Sections

Is Pluto a stand-alone software product, or a development platform?

Pluto is sold commercially as a complete turnkey appliance. To the end user it appears to be 1 single application with 1 common user interface. From a developer's standpoint, however, Pluto is actually a platform for developing smart home modules that all work together. Much of the top-level functionality is provided by a variety of open source projects. Pluto adds it's own home automation engine, UI front-end, configuration web site, and the heart of it all, Pluto Libraries DCE, which allows this collection of devices and software projects to work together as a seamless whole.

In many cases, a Pluto DCE device is just a thin wrapper for another open source project. The wrapper's job is to launch the open source project with the right parameters, forward incoming commands to it, and fire DCE events in response to triggers within it. We added DCE wrappers for the projects Asterisk (pbx telephone switch), Linphone (SIP software telephone) and Motion (surveillance video capture). In most cases, no modifications to the open source project were needed since the project already contained a mechanism for feeding it commands.

The software is completely modular and we offer a wealth of development tools, like code generators, design tools, a rapid development module for adding new devices (GSD), our own messenging platform and a ton of general-purpose libraries. Our GSD+sqlCVS is an entirely A new concept in collaborative development for quickly adding support for communicating with external equipment. If you're a developer, you can add to Pluto, or even remove our modules and use Pluto as a platform to do something else entirely.

Pluto allows projects to work together

By allowing these various projects to work together seamlessly, many new features and benefits are now possible. For example, if there's a security breach in your house, the lights and TV's in the house come on automatically using our home automation DCE device interfaces, and the security pn pad appears on all the Windows webpads and PDA's. After 30 seconds a menacing video plays for the burglar using Xine, while the surveillance cameras monitored by Motion feed a live video to your mobile phone over GPRS. Hit 'Talk' on the phone and Xine suspends, passing control to Linphone which makes a call using Asterisk to your mobile phone with the audio piped through the stereo so you can shout at the intruder and let him know you're watching him from a remote location and calling. To the end-user, it works seamlessly, like 1 cohesive whole, but in reality, what Pluto did is enable a bunch of existing applications to work together.