#!html

This program is not part of the current lcd4linux. This wiki entry was created for discussion about a program prototype.

====== ctrl_fifo ====== \\\ ====== 1. Description ====== [[https://github.com/c-max/ctrl/archive/master.zip|This external program]] is a Controller to interact with the [[plugin_control|Control plugin]]. It reads bytes form a FIFO and writes these bytes to stdout. This may be used to control LCD4Linux from several external scripts (may be started with [[:plugin_run|plugin Run]]). ====== 2. Download and make ====== [[https://github.com/c-max/ctrl/archive/master.zip|Download]] and extract the sources. glibc will be needed. Create executable with: gcc -o ctrl_fifo ctrl_fifo.c util.c ====== 3. Testmode ====== Run the program in test mode (option -t) to check if it works correctly. Example: /home/test/lcd/ctrl/ctrl_fifo -p /tmp/ctrl.fifo -t Start another Terminal an try: echo "ABC" > /tmp/ctrl.fifo To avoid the line break character at the end and send any byte value: echo -n -e "\x00" > /tmp/ctrl.fifo ... echo -n -e "\xff" > /tmp/ctrl.fifo ====== 4. Configuration ====== The structure in the config-file looks like this example which configures a FIFO controller to navigate within [[:plugin_layout|different Layouts]]: Plugin Control { active 1 Controller1 { name 'C_fifo' prog '/home/test/lcd/ctrl/ctrl_fifo' arg1 '-p' arg2 '/tmp/ctrl.fifo' Key100.action layout::layout('G_Messages','L_DownloadReady') # echo -n d > /tmp/ctrl.fifo Key101.action layout::layout('G_Messages','L_Error') # echo -n e > /tmp/ctrl.fifo Key109.action layout::layout('G_Messages','L_MailRecieved') # echo -n m > /tmp/ctrl.fifo } ... } '// Edit //prog// path and //arg2//! //' ====== 5. Default behavior ====== This controller does not read its stdin. So it's useless to call //control::send(...)// for this controller. The controller will write any byte it has read from the fifo to its stdout. ====== 6. Options ====== |**Option**|**Description**| |-h|Help| |-p |set FIFO path| |-t|Testmode, see chapter 3|