LEDColors/requeststatus.php

27 lines
459 B
PHP

<?php
require "header.php";
function usage() {
echo "Usage: requeststatus.php <idmask>\n";
echo "";
exit();
}
if ( php_sapi_name() != "cli" ) exit();
if ( $argc != 2 ) usage();
$idmask = intval($argv[1]);
if ( ($idmask <= 0) || ($idmask > 31) ) usage();
$command = 0x04;
$target = $idmask;
$unique = mt_rand(1, 2000000000);
$data = pack("LLLCL", PACKETFILTER[0], PACKETFILTER[1], $unique, $command, $target);
transmitMessage($data);
exit();