array('ram'=>'256','version'=>'1.0','type'=>'b','revision'=>'0002'), '0003' => array('ram'=>'256','version'=>'1.0+ecn0001','type'=>'b','revision'=>'0003'), '0004' => array('ram'=>'256','version'=>'2.0','type'=>'b','revision'=>'0004'), '0005' => array('ram'=>'256','version'=>'2.0','type'=>'b','revision'=>'0005'), '0006' => array('ram'=>'256','version'=>'2.0','type'=>'b','revision'=>'0006'), '0007' => array('ram'=>'256','version'=>'1.0','type'=>'a','revision'=>'0007'), '0008' => array('ram'=>'256','version'=>'1.0','type'=>'a','revision'=>'0008'), '0009' => array('ram'=>'256','version'=>'1.0','type'=>'a','revision'=>'0009'), '0010' => array('ram'=>'512','version'=>'1.0','type'=>'b+','revision'=>'0010'), '0011' => array('ram'=>'512','version'=>'1.0','type'=>'compute','revision'=>'0011'), '0012' => array('ram'=>'256','version'=>'1.0','type'=>'a+','revision'=>'0012'), '0013' => array('ram'=>'512','version'=>'1.0','type'=>'b+','revision'=>'0013'), '000d' => array('ram'=>'512','version'=>'2.0','type'=>'b','revision'=>'000d'), '000e' => array('ram'=>'512','version'=>'2.0','type'=>'b','revision'=>'000e'), '000f' => array('ram'=>'512','version'=>'2.0','type'=>'b','revision'=>'000f'), '000f' => array('ram'=>'512','version'=>'2.0','type'=>'b','revision'=>'000f'), '900032' => array('ram'=>'512','version'=>'2.0','type'=>'b','revision'=>'900032'), 'a01041' => array('ram'=>'1024','version'=>'1.0','type'=>'b2','revision'=>'a01041'), '1a01041' => array('ram'=>'1024','version'=>'1.0','type'=>'b2','revision'=>'1a01041'), 'a21041' => array('ram'=>'1024','version'=>'1.0','type'=>'b2','revision'=>'a21041'), '2a01041' => array('ram'=>'1024','version'=>'1.0','type'=>'b2','revision'=>'2a01041'), 'a02082' => array('ram'=>'1024','version'=>'3.0','type'=>'a','revision'=>'a02082'), 'a22082' => array('ram'=>'1024','version'=>'3.0','type'=>'a','revision'=>'a22082'), '900092' => array('ram'=>'512','version'=>'1.0','type'=>'zero','revision'=>'900092'), '9000c1' => array('ram'=>'512','version'=>'1.0','type'=>'zero','revision'=>'9000c1'), '0000' => array('ram'=>'1024','version'=>'1.0','type'=>'M1','revision'=>'0000') ); if(PHP_OS=='WINNT') $infos['Revision'] = 'a01041';//for dev mode on windows only return isset($deductionArray[$infos['Revision']]) ? $deductionArray[$infos['Revision']] :array('ram'=>'0','version'=>'0','type'=>'unknown','revision'=>$infos['Revision']); } public static function commandSilent($cmd){ Functions::log('Launch system command (without output): '.$cmd); return shell_exec($cmd); } public static function command($cmd){ Functions::log('Launch system command : '.$cmd); return system($cmd); } public static function gpio() { $model = self::getModel(); $pinsRange = self::getPinForModel($model['type'],$model['version']); $gpios = array(); foreach($pinsRange as $range){ foreach($range as $pin){ if(PHP_OS=='WINNT'){ $gpios[$pin->wiringPiNumber] = rand(0,1); continue; } if($pin->wiringPiNumber<0) continue; $gpios[$pin->wiringPiNumber] = exec(GPIO::GPIO_DEFAULT_PATH." read ".$pin->wiringPiNumber, $out); } } return $gpios; } } ?>