Loading src/lwir16/lwir16.php +15 −2 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ define('DAEMON_CTRL', 'daemon'); define('DAEMON_CTRL_CMDS', 'cmd'); //comma-separated commands to be sent to the daemon define('OUTPUT_LOG', 'output_log'); // redirect daemon output define('CAMERA_STATE', '/var/state/camera'); // print_r($_GET); // magic // exit(0); // magic Loading Loading @@ -267,7 +268,7 @@ exit(0); // no time to close log } else if ($cmd == 'state'){ // TODO: read all subcameras $state = file('/var/state/camera'); $state = file(CAMERA_STATE); $xml = new SimpleXMLElement("<?xml version='1.0' standalone='yes'?><lwir16_state/>"); foreach ($state as $line){ $kv = explode('=',$line); Loading Loading @@ -1087,4 +1088,16 @@ EOT; } } function isCameraBooted(){ return (getCameraState(CAMERA_STATE) == 'INITIALIZED'); } function getCameraState($camera_state_file){ if (!file_exists($camera_state_file)){ return NULL; } $camera_state = parse_ini_file($camera_state_file); return $camera_state['state']; } ?> Loading
src/lwir16/lwir16.php +15 −2 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ define('DAEMON_CTRL', 'daemon'); define('DAEMON_CTRL_CMDS', 'cmd'); //comma-separated commands to be sent to the daemon define('OUTPUT_LOG', 'output_log'); // redirect daemon output define('CAMERA_STATE', '/var/state/camera'); // print_r($_GET); // magic // exit(0); // magic Loading Loading @@ -267,7 +268,7 @@ exit(0); // no time to close log } else if ($cmd == 'state'){ // TODO: read all subcameras $state = file('/var/state/camera'); $state = file(CAMERA_STATE); $xml = new SimpleXMLElement("<?xml version='1.0' standalone='yes'?><lwir16_state/>"); foreach ($state as $line){ $kv = explode('=',$line); Loading Loading @@ -1087,4 +1088,16 @@ EOT; } } function isCameraBooted(){ return (getCameraState(CAMERA_STATE) == 'INITIALIZED'); } function getCameraState($camera_state_file){ if (!file_exists($camera_state_file)){ return NULL; } $camera_state = parse_ini_file($camera_state_file); return $camera_state['state']; } ?>