blob: 003ed6d3ae726f2315324ca002691dafbb12c1e5 [file] [log] [blame]
Vladimir Chtchetkine777eb682011-01-26 11:19:19 -08001/* 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_UI_COMMON_H
14#define _ANDROID_PROTOCOL_UI_COMMON_H
15
16/*
17 * Contains declarations for UI control protocol used by both the Core,
18 * and the UI.
19 */
20
21/* UI control command header.
22 * Every UI control command sent by the Core, or by the UI begins with this
23 * header, immediately followed by the command parameters (if there are any).
24 * Command type is defined by cmd_type field of this header. If command doesn't
25 * have any command-specific parameters, cmd_param_size field of this header
26 * must be 0.
27 */
28typedef struct UICmdHeader {
29 /* Command type. */
30 uint8_t cmd_type;
31
32 /* Byte size of the buffer containing parameters for the comand defined by
33 * the cmd_type field. The buffer containing parameters must immediately
34 * follow this header. If command doesn't have any parameters, this field
35 * must be 0 */
36 uint32_t cmd_param_size;
37} UICmdHeader;
38
39/* UI control command response header.
40 * If UI control command assumes a response from the remote end, the response
41 * must start with this header, immediately followed by the response data buffer.
42 */
43typedef struct UICmdRespHeader {
44 /* Result of the command handling. */
45 int result;
46
47 /* Byte size of the buffer containing response data immediately following
48 * this header. If there are no response data for the command, this field
49 * must be 0. */
50 uint32_t resp_data_size;
51} UICmdRespHeader;
52
53#endif /* _ANDROID_PROTOCOL_UI_COMMON_H */