apps/camogm/camogmstate.php

Go to the documentation of this file.
00001 <?php
00002 /*!***************************************************************************
00003 *! FILE NAME  : camogmstate.php
00004 *! DESCRIPTION: Just a sample program that interacts with camogm recorder
00005 *! Copyright (C) 2007 Elphel, Inc
00006 *! -----------------------------------------------------------------------------**
00007 *!
00008 *!  This program is free software: you can redistribute it and/or modify
00009 *!  it under the terms of the GNU General Public License as published by
00010 *!  the Free Software Foundation, either version 3 of the License, or
00011 *!  (at your option) any later version.
00012 *!
00013 *!  This program is distributed in the hope that it will be useful,
00014 *!  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 *!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 *!  GNU General Public License for more details.
00017 *!
00018 *!  You should have received a copy of the GNU General Public License
00019 *!  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020 *! -----------------------------------------------------------------------------**
00021 *!  $Log: camogmstate.php,v $
00022 *!  Revision 1.1.1.1  2008/11/27 20:04:01  elphel
00023 *!
00024 *!
00025 *!  Revision 1.2  2007/11/28 07:15:38  elphel
00026 *!  added sending arbitrary commands to camogm
00027 *!
00028 *!  Revision 1.1  2007/11/19 03:23:21  elphel
00029 *!  7.1.5.5 Added support for *.mov files in camogm.
00030 *!
00031 *!
00032 */
00033 
00036    $pipe="/var/state/camogm.state";
00037    $cmd_pipe="/var/state/camogm_cmd";
00038    $mode=0777;
00039    if(!file_exists($pipe)) {
00040       // create the pipe
00041       umask(0);
00042       posix_mkfifo($pipe,$mode);
00043    } else {
00045    }
00047    $fcmd=fopen($cmd_pipe,"w");
00049    $cmd=$_GET['cmd'];
00050    if ($cmd) $cmd=urldecode($cmd).";";
00052    fprintf($fcmd,$cmd."xstatus=%s\n",$pipe);
00053    fclose($fcmd);
00055    $status=file_get_contents($pipe);
00056    header("Content-Type: text/xml");
00057    header("Content-Length: ".strlen($status)."\n");
00058    header("Pragma: no-cache\n");
00059    printf($status);
00060 ?> 

Generated on Fri Nov 28 00:06:21 2008 for elphel by  doxygen 1.5.1