示例#1
0
            break;
        case 'status':
            $response->data = $robot->status();
            $response->performed = 'status';
            break;
        case 'radar_sweep':
            $response->performed = 'radar_sweep';
            $response->data = $robot->sweep();
            break;
        case 'show_clock':
            $response->performed = $robot->showClock();
            break;
        case 'light':
            $num = isset($_POST['num']) ? intval($_POST['num']) : 0;
            $status = isset($_POST['status']) ? intval($_POST['status']) : 0;
            $response->performed = $robot->setLight($num, $status);
            break;
        case 'poweroff':
            $robot->poweroff();
            $response->performed = 'POWEROFF';
            break;
        case 'local':
            $string = file_get_contents('/home/elkuku/tests/robovalues.json');
            $response->data = $string;
            $response->performed = 'local';
            break;
        default:
            $response->performed = '**NOTHING**';
            break;
    }
} catch (Exception $exception) {