2023-10-15 18:41:15 +02:00
|
|
|
<?php
|
|
|
|
|
2023-10-26 15:31:58 +02:00
|
|
|
define("FIFO", "/tmp/mapid");
|
|
|
|
|
|
|
|
|
|
|
|
if (!file_exists(FIFO))
|
|
|
|
die("<!DOCTYPE html>\n<meta charset=\"UTF-8\">\n<h3 style=\"color:red;\">Error: FIFO file “" . FIFO . "” does not exist!</h3><p>Is <tt>fifo_bridge.py</tt> running?</p>");
|
|
|
|
|
|
|
|
|
|
|
|
$f = fopen(FIFO, "w+");
|
2023-10-15 18:41:15 +02:00
|
|
|
|
|
|
|
switch ($_POST["cmd"]) {
|
|
|
|
case "getty":
|
|
|
|
fwrite($f, "GETTY");
|
|
|
|
break;
|
|
|
|
case "cls":
|
|
|
|
fwrite($f, "CLS");
|
|
|
|
break;
|
2023-10-26 20:44:34 +02:00
|
|
|
case "on":
|
|
|
|
fwrite($f, "ON");
|
|
|
|
break;
|
|
|
|
case "off":
|
|
|
|
fwrite($f, "OFF");
|
|
|
|
break;
|
|
|
|
case "lcdon":
|
|
|
|
fwrite($f, "LCDON");
|
|
|
|
break;
|
|
|
|
case "lcdoff":
|
|
|
|
fwrite($f, "LCDOFF");
|
|
|
|
break;
|
2023-10-15 18:41:15 +02:00
|
|
|
case "line":
|
|
|
|
fwrite($f, "LINE ");
|
|
|
|
fwrite($f, $_POST["line"]);
|
|
|
|
break;
|
|
|
|
case "echo":
|
|
|
|
fwrite($f, "ECHO ");
|
|
|
|
fwrite($f, $_POST["text"]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
fwrite($f, "\n");
|
|
|
|
fclose($f);
|
|
|
|
|
|
|
|
//header("Refresh: 5; url=./");
|
|
|
|
header("Location: ./");
|