Linux-DVB-DVBT-Apps-QuartzPVR
view release on metacpan or search on metacpan
php/listings.php view on Meta::CPAN
{
$this->NUM_PVRS = $NUM_PVRS ;
}
if ($PVRS)
{
$this->PVRS = $PVRS ;
}
break ;
}
}
return $json ;
}
#---------------------------------------------------------------------------------------------------
function chan_update_cmd()
{
// get server to run command
list($retval, $output) = $this->server_cmd("dvb_chans") ;
}
#---------------------------------------------------------------------------------------------------
function scan_info_cmd()
{
$json = "" ;
// get server to run command
list($retval, $output) = $this->server_cmd("dvb_scan_info") ;
$this->debug_log_msg("scan_info_cmd() retval=$retval \n") ;
## process output
#
# Should be of the form:
# <?php
# $msg_type = "warning" ;
# $messages = array(
# "line 1",
# "another line"
# ) ;
#
#
$messages = array() ;
$msg_type = "" ;
$text = array() ;
list($php, $text) = $this->server_output_php($output) ;
if ($php)
{
$STATUS = array() ;
eval("$php") ;
$json = $this->_json_from_hash($json, $STATUS) ;
if (array_key_exists("BUSY", $STATUS))
{
if ($STATUS["BUSY"])
{
array_push($messages, "Adapter already busy, please try again later ") ;
}
}
}
else
{
$json = "{}" ;
}
$this->debug_log_msg(" + json=$json\n") ;
## Handle errors
$json = $this->handle_cmd_errors($json, $retval, $messages, $msg_type, $text) ;
return $json ;
}
#---------------------------------------------------------------------------------------------------
function scan_start_cmd( $params = array() )
{
$args = "" ;
if ($params['adapter'])
{
$args .= "-a " . $params['adapter'] . " " ;
}
if ($params['clean'])
{
$args .= "-clean " ;
}
if ($params['file'])
{
$args .= $params['file'] ;
}
else
{
$args .= DVBT_FREQFILE ;
}
// get server to run command
list($retval, $output) = $this->server_cmd("dvb_scan $args") ;
return $this->scan_info_cmd() ;
}
#---------------------------------------------------------------------------------------------------
function server_cmd($execcmd)
{
$retval = 0 ;
$output = array() ;
$fp = fsockopen("localhost", SERVER_PORT, $errno, $errstr, 30);
if (!$fp)
{
$retval = SERVER_DOWN ;
}
else
{
fwrite($fp, "$execcmd\n");
while (!feof($fp))
{
array_push($output, fgets($fp, 512)) ;
}
( run in 0.648 second using v1.01-cache-2.11-cpan-39bf76dae61 )