blob: e1dc80e01cde1fbfac329ce4313804938352d92a [file] [log] [blame]
Keun Soo Yimbad86d52016-06-29 09:51:00 -07001// Copyright 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package android.vts;
18
19
20// Type of a command.
21enum VtsDriverCommandType {
22 UNKNOWN_VTS_DRIVER_COMMAND_TYPE = 0;
23
24 // To request to exit a driver.
25 EXIT = 1;
26 // To get the status of a driver.
27 GET_STATUS = 2;
28
29 // for a HAL driver
30 // To request to load a HAL.
31 LOAD_HAL = 101;
32 // To get a list of available functions.
33 LIST_FUNCTIONS = 102;
34 // To call a function.
35 CALL_FUNCTION = 103;
36
37 // for a shell driver
38 // To execute a shell command.
39 EXECUTE_COMMAND = 201;
40}
41
42
43// Type of a response.
44enum VtsDriverResponseCode {
45 UNKNOWN_VTS_DRIVER_RESPONSE_CODE = 0;
46 // successful
47 VTS_DRIVER_RESPONSE_SUCCESS = 1;
48 // failed
49 VTS_DRIVER_RESPONSE_FAIL = 2;
50}
51
52
53// To specify a command.
54message VtsDriverControlCommandMessage {
55 // Command type.
56 optional VtsDriverCommandType command_type = 1;
57
58 // for EXIT
59 // none
60
61 // for GET_STATUS
62 optional int32 status_type = 1101;
63
64 // for LOAD_HAL
65 // The name of a target.
66 optional bytes file_path = 1201;
67 // target class
68 optional int32 target_class = 1202;
69 // target type
70 optional int32 target_type = 1203;
71 // target version (should be divided by 100) - float has a compatibility issue
72 // between C/C++ and python protoc.
73 optional int32 target_version = 1204;
74 // the name of a HAL module to open.
75 optional bytes module_name = 1205;
76
77 // for GET_FUNCTIONS
78 // none
79
80 // for CALL_FUNCTION
81 optional bytes arg = 1401;
82
83 // for EXECUTE_COMMAND
84 repeated bytes shell_command = 2001;
85}
86
87
88// To specify a response.
89message VtsDriverControlResponseMessage {
90 // Response type.
91 optional VtsDriverResponseCode response_code = 1;
92
93 // Return value.
94 optional int32 return_value = 11;
95
96 // The stdout message.
97 repeated bytes stdout = 1001;
98 // The stderr message.
99 repeated bytes stderr = 1002;
100}