packages/web/353/php_top/detect_ioboard.php

Go to the documentation of this file.
00001 #!/usr/local/sbin/php -q
00002 <?php
00032 require 'i2c.inc';
00033         $rslt=i2c_read256b();
00034         $zero=strpos($rslt,chr(0));
00035         if ($zero!==false) $rslt=substr($rslt,0, $zero);
00036         if (substr($rslt,0,5)!="<?xml") {
00037          exit (1); 
00038         }
00039         $xml=simplexml_load_string($rslt);
00040         if ($_SERVER['argc']<2)  {
00041           echo strtoupper($xml->model.$xml->rev);
00042           exit (0);
00043         }
00044         if ($xml->model != $_SERVER['argv'][1]) {
00045           exit (2); 
00046         }
00047         echo strtoupper($xml->rev);
00048         exit (0);
00049 ?>

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