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; |
| 36 | |
| 37 | // for a shell driver |
| 38 | // To execute a shell command. |
| 39 | EXECUTE_COMMAND = 201; |
Yuexi Ma | ddb4e9e | 2016-07-11 12:45:41 -0700 | [diff] [blame] | 40 | |
| 41 | // To invoke a system call. |
| 42 | INVOKE_SYSCALL = 202; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | |
| 46 | // Type of a response. |
| 47 | enum VtsDriverResponseCode { |
| 48 | UNKNOWN_VTS_DRIVER_RESPONSE_CODE = 0; |
| 49 | // successful |
| 50 | VTS_DRIVER_RESPONSE_SUCCESS = 1; |
| 51 | // failed |
| 52 | VTS_DRIVER_RESPONSE_FAIL = 2; |
| 53 | } |
| 54 | |
| 55 | |
| 56 | // To specify a command. |
| 57 | message VtsDriverControlCommandMessage { |
| 58 | // Command type. |
| 59 | optional VtsDriverCommandType command_type = 1; |
| 60 | |
| 61 | // for EXIT |
| 62 | // none |
| 63 | |
| 64 | // for GET_STATUS |
| 65 | optional int32 status_type = 1101; |
| 66 | |
| 67 | // for LOAD_HAL |
| 68 | // The name of a target. |
| 69 | optional bytes file_path = 1201; |
| 70 | // target class |
| 71 | optional int32 target_class = 1202; |
| 72 | // target type |
| 73 | optional int32 target_type = 1203; |
| 74 | // target version (should be divided by 100) - float has a compatibility issue |
| 75 | // between C/C++ and python protoc. |
Keun Soo Yim | 14f2272 | 2016-06-29 09:49:38 -0700 | [diff] [blame] | 76 | optional float target_version = 1204; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 77 | // the name of a HAL module to open. |
| 78 | optional bytes module_name = 1205; |
| 79 | |
Keun Soo Yim | 14f2272 | 2016-06-29 09:49:38 -0700 | [diff] [blame] | 80 | // for LIST_FUNCTIONS |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 81 | // none |
| 82 | |
| 83 | // for CALL_FUNCTION |
| 84 | optional bytes arg = 1401; |
| 85 | |
| 86 | // for EXECUTE_COMMAND |
| 87 | repeated bytes shell_command = 2001; |
| 88 | } |
| 89 | |
| 90 | |
| 91 | // To specify a response. |
| 92 | message VtsDriverControlResponseMessage { |
| 93 | // Response type. |
| 94 | optional VtsDriverResponseCode response_code = 1; |
| 95 | |
| 96 | // Return value. |
| 97 | optional int32 return_value = 11; |
Keun Soo Yim | 14f2272 | 2016-06-29 09:49:38 -0700 | [diff] [blame] | 98 | // Return message. |
| 99 | optional bytes return_message = 12; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 100 | |
Yuexi Ma | 90ec35f | 2016-07-25 10:18:52 -0700 | [diff] [blame] | 101 | // The stdout message for each command |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 102 | repeated bytes stdout = 1001; |
Yuexi Ma | 90ec35f | 2016-07-25 10:18:52 -0700 | [diff] [blame] | 103 | // The stderr message for each command |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 104 | repeated bytes stderr = 1002; |
Yuexi Ma | 90ec35f | 2016-07-25 10:18:52 -0700 | [diff] [blame] | 105 | // The exit code for each command |
| 106 | repeated int32 exit_code = 1003; |
Keun Soo Yim | 109da58 | 2016-08-06 18:57:24 -0700 | [diff] [blame^] | 107 | |
| 108 | // The retrieved specifications. |
| 109 | repeated bytes spec = 2001; |
Keun Soo Yim | bad86d5 | 2016-06-29 09:51:00 -0700 | [diff] [blame] | 110 | } |