Application

The main plcd application is written as a command line Linux daemon. It automatically takes itself to the background, and detaches from the controlling terminal. Once this is complete the application reads the configuration file, opens the serial ports described therein and tries to initialize the powerline adaptors (currently only the CM11A is supported). The network port is then opened and connections are accepted.

Once the application has initialized it waits. When receiving a command from the network, it is relayed to the power line. Then each action is checked to see if the conditions match, and if they do each of the effects are caused. Each effect can be a simple on or off command to send to the power line with the option to delay it an arbitrary amount of time, or an external command can be executed with the optionally provided arguments.