Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | syntax = "proto2"; |
| 16 | |
| 17 | package android.vts; |
| 18 | |
| 19 | |
| 20 | // Type of a command. |
| 21 | enum 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 Yim | 913c259 | 2016-08-08 11:19:13 -0700 | [diff] [blame] | 36 | // To get the value of an attribute. |
| 37 | GET_ATTRIBUTE = 104; |
Keun Soo Yim | eb699fc | 2016-08-13 22:11:58 -0700 | [diff] [blame] | 38 | // To read the specification message of a component. |
| 39 | VTS_DRIVER_COMMAND_READ_SPECIFICATION = 105; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 40 | |
| 41 | // for a shell driver |
| 42 | // To execute a shell command. |
| 43 | EXECUTE_COMMAND = 201; |
Yuexi Ma | ddb4e9e | 2016-07-11 12:45:41 -0700 | [diff] [blame] | 44 | |
| 45 | // To invoke a system call. |
| 46 | INVOKE_SYSCALL = 202; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | |
| 50 | // Type of a response. |
| 51 | enum 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. |
| 61 | message 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 Yim | 14f2272 | 2016-06-29 09:49:38 -0700 | [diff] [blame] | 80 | optional float target_version = 1204; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 81 | // the name of a HAL module to open. |
| 82 | optional bytes module_name = 1205; |
Keun Soo Yim | 542efcb | 2016-10-16 11:17:41 -0700 | [diff] [blame] | 83 | // the package of a HIDL HAL to open. |
| 84 | optional bytes target_package = 1206; |
Keun Soo Yim | 6295065 | 2016-10-21 15:18:14 -0700 | [diff] [blame] | 85 | // the name of a target component (currently used for HIDL HALs only). |
| 86 | optional bytes target_component_name = 1207; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 87 | |
Keun Soo Yim | 353c899 | 2016-12-12 13:40:26 -0800 | [diff] [blame] | 88 | // 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 Yim | 14f2272 | 2016-06-29 09:49:38 -0700 | [diff] [blame] | 91 | // for LIST_FUNCTIONS |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 92 | // none |
| 93 | |
| 94 | // for CALL_FUNCTION |
| 95 | optional bytes arg = 1401; |
| 96 | |
Keun Soo Yim | a125f09 | 2017-01-19 17:13:39 -0800 | [diff] [blame] | 97 | // UID of a caller on the driver-side. |
| 98 | optional bytes driver_caller_uid = 1501; |
| 99 | |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 100 | // for EXECUTE_COMMAND |
| 101 | repeated bytes shell_command = 2001; |
| 102 | } |
| 103 | |
| 104 | |
| 105 | // To specify a response. |
| 106 | message VtsDriverControlResponseMessage { |
| 107 | // Response type. |
| 108 | optional VtsDriverResponseCode response_code = 1; |
| 109 | |
| 110 | // Return value. |
| 111 | optional int32 return_value = 11; |
Keun Soo Yim | 14f2272 | 2016-06-29 09:49:38 -0700 | [diff] [blame] | 112 | // Return message. |
| 113 | optional bytes return_message = 12; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 114 | |
Yuexi Ma | 90ec35f | 2016-07-25 10:18:52 -0700 | [diff] [blame] | 115 | // The stdout message for each command |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 116 | repeated bytes stdout = 1001; |
Yuexi Ma | 90ec35f | 2016-07-25 10:18:52 -0700 | [diff] [blame] | 117 | // The stderr message for each command |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 118 | repeated bytes stderr = 1002; |
Yuexi Ma | 90ec35f | 2016-07-25 10:18:52 -0700 | [diff] [blame] | 119 | // The exit code for each command |
| 120 | repeated int32 exit_code = 1003; |
Keun Soo Yim | 109da58 | 2016-08-06 18:57:24 -0700 | [diff] [blame] | 121 | |
| 122 | // The retrieved specifications. |
| 123 | repeated bytes spec = 2001; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 124 | } |