1/* Copyright (C) 2010 The Android Open Source Project 2** 3** This software is licensed under the terms of the GNU General Public 4** License version 2, as published by the Free Software Foundation, and 5** may be copied, distributed, and modified under those terms. 6** 7** This program is distributed in the hope that it will be useful, 8** but WITHOUT ANY WARRANTY; without even the implied warranty of 9** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10** GNU General Public License for more details. 11*/ 12 13#ifndef _ANDROID_PROTOCOL_CORE_COMMANDS_H 14#define _ANDROID_PROTOCOL_CORE_COMMANDS_H 15 16/* 17 * Contains declarations related to the UI control commands sent by the UI and 18 * handled by the Core. 19 */ 20 21#include "android/hw-sensors.h" 22#include "android/protocol/ui-common.h" 23 24/* Sets coarse orientation. */ 25#define AUICMD_SET_COARSE_ORIENTATION 1 26 27/* Toggles the network. */ 28#define AUICMD_TOGGLE_NETWORK 2 29 30/* Starts / stops the tracing. */ 31#define AUICMD_TRACE_CONTROL 3 32 33/* Checks if network is disabled. */ 34#define AUICMD_CHK_NETWORK_DISABLED 4 35 36/* Gets network speed. */ 37#define AUICMD_GET_NETSPEED 5 38 39/* Gets network delays */ 40#define AUICMD_GET_NETDELAY 6 41 42/* Gets path to a QEMU file on local host. */ 43#define AUICMD_GET_QEMU_PATH 7 44 45/* Gets LCD density. */ 46#define AUICMD_GET_LCD_DENSITY 8 47 48/* Formats AUICMD_SET_COARSE_ORIENTATION UI control command parameters. */ 49typedef struct UICmdSetCoarseOrientation { 50 AndroidCoarseOrientation orient; 51} UICmdSetCoarseOrientation; 52 53/* Formats AUICMD_TRACE_CONTROL UI control command parameters. */ 54typedef struct UICmdTraceControl { 55 int start; 56} UICmdTraceControl; 57 58/* Formats AUICMD_GET_NETSPEED UI control command parameters. */ 59typedef struct UICmdGetNetSpeed { 60 int index; 61} UICmdGetNetSpeed; 62 63/* Formats AUICMD_GET_NETSPEED UI control command response. 64 * Instances of this structure contains content of the NetworkSpeed structure, 65 * including actual "name" and "display" strings. */ 66typedef struct UICmdGetNetSpeedResp { 67 int upload; 68 int download; 69 /* Zero-terminated NetworkSpeed's "name" strings starts here. The "display" 70 * string begins inside this structure, right after the "name"'s 71 * zero-terminator. */ 72 char name[0]; 73} UICmdGetNetSpeedResp; 74 75/* Formats AUICMD_GET_NETDELAY UI control command parameters. */ 76typedef struct UICmdGetNetDelay { 77 int index; 78} UICmdGetNetDelay; 79 80/* Formats AUICMD_GET_NETDELAY UI control command response. 81 * Instances of this structure contains content of the NetworkLatency structure, 82 * including actual "name" and "display" strings. */ 83typedef struct UICmdGetNetDelayResp { 84 int min_ms; 85 int max_ms; 86 /* Zero-terminated NetworkLatency's "name" strings starts here. The "display" 87 * string begins inside this structure, right after the "name"'s 88 * zero-terminator. */ 89 char name[0]; 90} UICmdGetNetDelayResp; 91 92/* Formats AUICMD_GET_QEMU_PATH UI control command parameters. */ 93typedef struct UICmdGetQemuPath { 94 int type; 95 char filename[0]; 96} UICmdGetQemuPath; 97 98/* Formats AUICMD_GET_QEMU_PATH UI control command response. */ 99typedef struct UICmdGetQemuPathResp { 100 /* Queried qemu path begins here. */ 101 char path[0]; 102} UICmdGetQemuPathResp; 103 104#endif /* _ANDROID_PROTOCOL_CORE_COMMANDS_H */ 105