Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <code> #!html <h1 style="text-align: left; color: red"> This program is not part of the current lcd4linux. This wiki entry was created for discussion about a program prototype. <br><br> </h1> </code> ====== 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: <code> gcc -o ctrl_fifo ctrl_fifo.c util.c </code> ====== 3. Testmode ====== Run the program in test mode (option -t) to check if it works correctly. Example: <code> /home/test/lcd/ctrl/ctrl_fifo -p /tmp/ctrl.fifo -t </code> Start another Terminal an try: <code> echo "ABC" > /tmp/ctrl.fifo </code> To avoid the line break character at the end and send any byte value: <code> echo -n -e "\x00" > /tmp/ctrl.fifo ... echo -n -e "\xff" > /tmp/ctrl.fifo </code> ====== 4. Configuration ====== The structure in the config-file looks like this example which configures a FIFO controller to navigate within [[:plugin_layout|different Layouts]]: <code> 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 } ... } </code> '// 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 <fifo_path>|set FIFO path| |-t|Testmode, see chapter 3| plugin_control_ctrl_fifo.txt Last modified: 2020/07/17 18:33(external edit)