Home | History | Annotate | Download | only in proto
      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   // To get the value of an attribute.
     37   GET_ATTRIBUTE = 104;
     38   // To read the specification message of a component.
     39   VTS_DRIVER_COMMAND_READ_SPECIFICATION = 105;
     40 
     41   // for a shell driver
     42   // To execute a shell command.
     43   EXECUTE_COMMAND = 201;
     44 
     45   // To invoke a system call.
     46   INVOKE_SYSCALL = 202;
     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.
     80   optional float target_version = 1204;
     81   // the name of a HAL module to open.
     82   optional bytes module_name = 1205;
     83   // the package of a HIDL HAL to open.
     84   optional bytes target_package = 1206;
     85   // the name of a target component (currently used for HIDL HALs only).
     86   optional bytes target_component_name = 1207;
     87 
     88   // the name of a HW Binder service to use (only needed for HIDL HAL).
     89   optional bytes hw_binder_service_name = 1221;
     90 
     91   // for LIST_FUNCTIONS
     92   // none
     93 
     94   // for CALL_FUNCTION
     95   optional bytes arg = 1401;
     96 
     97   // UID of a caller on the driver-side.
     98   optional bytes driver_caller_uid = 1501;
     99 
    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;
    112   // Return message.
    113   optional bytes return_message = 12;
    114 
    115   // The stdout message for each command
    116   repeated bytes stdout = 1001;
    117   // The stderr message for each command
    118   repeated bytes stderr = 1002;
    119   // The exit code for each command
    120   repeated int32 exit_code = 1003;
    121 
    122   // The retrieved specifications.
    123   repeated bytes spec = 2001;
    124 }
    125