Exemplo n.º 1
0
function arduidom_remove()
{
    $cron = cron::byClassAndFunction('arduidom', 'checkdaemon');
    if (is_object($cron)) {
        $cron->remove();
    }
    arduidom::stopdaemon(1);
    arduidom::stopdaemon(2);
    arduidom::stopdaemon(3);
    arduidom::stopdaemon(4);
    arduidom::stopdaemon(5);
    arduidom::stopdaemon(6);
    arduidom::stopdaemon(7);
    arduidom::stopdaemon(8);
}
Exemplo n.º 2
0
 include_file('core', 'authentification', 'php');
 include_file('core', 'pin', 'config', 'arduidom');
 if (!isConnect('admin')) {
     throw new Exception(__('401 - Accès non autorisé', __FILE__));
 }
 for ($i = 1; $i < 9; $i++) {
     if (init('action') == 'restartDaemon' . $i) {
         arduidom::restartdaemon($i);
         if (arduidom::checkdaemon($i) == 1) {
             ajax::success();
         } else {
             ajax::error("Le démon " . $i . " n'a pas démarré");
         }
     }
     if (init('action') == 'stopDaemon' . $i) {
         arduidom::stopdaemon($i);
         if (arduidom::checkdaemon($i) == 0) {
             ajax::success();
         } else {
             ajax::error("Le démon " . $i . " ne s'est pas arreté");
         }
     }
     if (init('action') == 'checkDaemon' . $i) {
         if (arduidom::checkdaemon($i) == 1) {
             ajax::success();
         } else {
             ajax::error("Le démon " . $i . " ne fonctionne pas !");
         }
     }
     if (init('action') == 'FlashArduino' . $i) {
         log::add('arduidom', 'info', 'FlashArduino STEP 1: Exec avrdude and wait finish...');