blob: aec8c83362075a81fc92e4efaaa9a5aa1fd73687 [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;
Keun Soo Yim913c2592016-08-08 11:19:13 -070036 // To get the value of an attribute.
37 GET_ATTRIBUTE = 104;
Keun Soo Yimeb699fc2016-08-13 22:11:58 -070038 // To read the specification message of a component.
39 VTS_DRIVER_COMMAND_READ_SPECIFICATION = 105;
Keun Soo Yimbad86d52016-06-29 09:51:00 -070040
41 // for a shell driver
42 // To execute a shell command.
43 EXECUTE_COMMAND = 201;
Yuexi Maddb4e9e2016-07-11 12:45:41 -070044
45 // To invoke a system call.
46 INVOKE_SYSCALL = 202;
Keun Soo Yimbad86d52016-06-29 09:51:00 -070047}
48
49
50// Type of a response.
51enum VtsDriverResponseCode {
52 UNKNOWN_VTS_DRIVER_RESPONSE_CODE = 0;
53 // successful
54 VTS_DRIVER_RESPONSE_SUCCESS = 1;
55 // failed
56 VTS_DRIVER_RESPONSE_FAIL = 2;
57}
58
59
60// To specify a command.
61message VtsDriverControlCommandMessage {
62 // Command type.
63 optional VtsDriverCommandType command_type = 1;
64
65 // for EXIT
66 // none
67
68 // for GET_STATUS
69 optional int32 status_type = 1101;
70
71 // for LOAD_HAL
72 // The name of a target.
73 optional bytes file_path = 1201;
74 // target class
75 optional int32 target_class = 1202;
76 // target type
77 optional int32 target_type = 1203;
78 // target version (should be divided by 100) - float has a compatibility issue
79 // between C/C++ and python protoc.
Keun Soo Yim14f22722016-06-29 09:49:38 -070080 optional float target_version = 1204;
Keun Soo Yimbad86d52016-06-29 09:51:00 -070081 // the name of a HAL module to open.
82 optional bytes module_name = 1205;
Keun Soo Yim542efcb2016-10-16 11:17:41 -070083 // the package of a HIDL HAL to open.
84 optional bytes target_package = 1206;
Keun Soo Yim62950652016-10-21 15:18:14 -070085 // the name of a target component (currently used for HIDL HALs only).
86 optional bytes target_component_name = 1207;
Keun Soo Yimbad86d52016-06-29 09:51:00 -070087
Keun Soo Yim353c8992016-12-12 13:40:26 -080088 // the name of a HW Binder service to use (only needed for HIDL HAL).
89 optional bytes hw_binder_service_name = 1221;
90
Keun Soo Yim14f22722016-06-29 09:49:38 -070091 // for LIST_FUNCTIONS
Keun Soo Yimbad86d52016-06-29 09:51:00 -070092 // none
93
94 // for CALL_FUNCTION
95 optional bytes arg = 1401;
96
Keun Soo Yima125f092017-01-19 17:13:39 -080097 // UID of a caller on the driver-side.
98 optional bytes driver_caller_uid = 1501;
99
Keun Soo Yimbad86d52016-06-29 09:51:00 -0700100 // for EXECUTE_COMMAND
101 repeated bytes shell_command = 2001;
102}
103
104
105// To specify a response.
106message VtsDriverControlResponseMessage {
107 // Response type.
108 optional VtsDriverResponseCode response_code = 1;
109
110 // Return value.
111 optional int32 return_value = 11;
Keun Soo Yim14f22722016-06-29 09:49:38 -0700112 // Return message.
113 optional bytes return_message = 12;
Keun Soo Yimbad86d52016-06-29 09:51:00 -0700114
Yuexi Ma90ec35f2016-07-25 10:18:52 -0700115 // The stdout message for each command
Keun Soo Yimbad86d52016-06-29 09:51:00 -0700116 repeated bytes stdout = 1001;
Yuexi Ma90ec35f2016-07-25 10:18:52 -0700117 // The stderr message for each command
Keun Soo Yimbad86d52016-06-29 09:51:00 -0700118 repeated bytes stderr = 1002;
Yuexi Ma90ec35f2016-07-25 10:18:52 -0700119 // The exit code for each command
120 repeated int32 exit_code = 1003;
Keun Soo Yim109da582016-08-06 18:57:24 -0700121
122 // The retrieved specifications.
123 repeated bytes spec = 2001;
Keun Soo Yimbad86d52016-06-29 09:51:00 -0700124}