Remove files somehow polluted from the LEDColors repo

This commit is contained in:
Junior 2024-05-22 16:58:47 +00:00
parent a48f9dcb41
commit 5b0ede696f
4 changed files with 0 additions and 145 deletions

View File

@ -1,20 +0,0 @@
<?php
require 'config.php';
$command = 0x00;
$target = LEDTARGETID;
$unique = mt_rand(1, 2000000000);
$target = ($target > 0 ) ? 2 ** ($target - 1) : 0;
$data = pack("CQL", $command, $target, $unique);
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, 1);
for ( $i=0; $i<3; $i++ ) {
socket_sendto($sock, $data, strlen($data), 0, LEDADDRESS, 6565);
if ( $i < 2 ) usleep(10000);
}
socket_close($sock);
?>

View File

@ -1,26 +0,0 @@
<?php
require 'config.php';
if ( !isset($_REQUEST['color']) ) exit();
$hex = $_REQUEST['color'];
$command = 0x01;
$target = LEDTARGETID;
$unique = mt_rand(1, 2000000000);
$red = hexdec(substr($hex, 0, 2));
$green = hexdec(substr($hex, 2, 2));
$blue = hexdec(substr($hex, 4, 2));
$target = ($target > 0 ) ? 2 ** ($target - 1) : 0;
$data = pack("CQLLCCC", $command, $target, $unique, 1000, $red, $green, $blue);
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, 1);
for ( $i=0; $i<3; $i++ ) {
socket_sendto($sock, $data, strlen($data), 0, LEDADDRESS, 6565);
if ( $i < 2 ) usleep(10000);
}
socket_close($sock);
?>

View File

@ -1,79 +0,0 @@
<?php
require 'config.php';
if ( !isset($_REQUEST['pattern']) ) exit();
$pattern = $_REQUEST['pattern'];
$command = 0x02;
$target = LEDTARGETID;
$unique = mt_rand(1, 2000000000);
$target = ($target > 0 ) ? 2 ** ($target - 1) : 0;
$data = pack("CQL", $command, $target, $unique);
$goodPattern = false;
if ( $pattern == "crazy" ) {
// The first pack here sets the milliseconds duration for ramping between colors followed by the number of colors
$data .= pack("LC", 50, 1);
// Now we stack on the colors. R, G, B values from 0.0 to 1.0 and the final parameter being how long to rest on this color
$data .= pack("CCCL", 0, 0, 0, 0);
$goodPattern = true;
} elseif ( $pattern == "crazymellow" ) {
$data .= pack("LC", 8000, 1);
$data .= pack("CCCL", 0, 0, 0, 0);
$goodPattern = true;
} elseif ( $pattern == "christmas" ) {
$data .= pack("LC", 1000, 2);
$data .= pack("CCCL", 255, 0, 0, 2000);
$data .= pack("CCCL", 0, 255, 0, 2000);
$goodPattern = true;
} elseif ( $pattern == "julyfourth" ) {
$data .= pack("LC", 1000, 3);
$data .= pack("CCCL", 255, 0, 0, 2000);
$data .= pack("CCCL", 127, 127, 127, 2000);
$data .= pack("CCCL", 0, 0, 255, 2000);
$goodPattern = true;
} elseif ( $pattern == "easter" ) {
$data .= pack("LC", 1000, 3);
$data .= pack("CCCL", 255, 3, 192, 2000);
$data .= pack("CCCL", 8, 255, 247, 2000);
$data .= pack("CCCL", 255, 252, 5, 2000);
$goodPattern = true;
} elseif ( $pattern == "halloween" ) {
$data .= pack("LC", 1000, 2);
$data .= pack("CCCL", 255, 24, 0, 1000);
$data .= pack("CCCL", 0, 0, 0, 250);
$goodPattern = true;
} elseif ( $pattern == "thanksgiving" ) {
$data .= pack("LC", 1000, 2);
$data .= pack("CCCL", 0x4d, 0x1e, 0, 2000);
$data .= pack("CCCL", 0xcf, 0x53, 0, 2000);
$goodPattern = true;
} elseif ( $pattern == "mellow" ) {
$data .= pack("LC", 10000, 5);
$data .= pack("CCCL", 0x00, 0x8f, 0x0d, 0);
$data .= pack("CCCL", 0x8b, 0x00, 0x08, 0);
$data .= pack("CCCL", 0x06, 0x01, 0x8f, 0);
$data .= pack("CCCL", 0x8f, 0x02, 0x54, 0);
$data .= pack("CCCL", 0x3e, 0x8f, 0x8c, 0);
$goodPattern = true;
} elseif ( $pattern == "test" ) {
$goodPattern = true;
$data .= pack("LC", 1000, 2);
}
if ( $goodPattern ) {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, 1);
for ( $i=0; $i<3; $i++ ) {
socket_sendto($sock, $data, strlen($data), 0, LEDADDRESS, 6565);
if ( $i < 2 ) usleep(10000);
}
socket_close($sock);
}
exit();
?>

View File

@ -1,20 +0,0 @@
<?php
require 'config.php';
require 'functions.php';
echo "<pre>";
//$curvol = getSystemVolume();
$curvol = shell_exec("HOME=" . WEBUSERHOMEDIR . " && amixer sget Master");
echo "Current Volume: '", $curvol, "'\n";
/*
echo "Setting system volume to 50%!\n";
setSystemVolume((MAXVOLUME/2));
$curvol = getSystemVolume();
echo "Current Volume: '", $curvol, "'\n";
*/