lin
2025-08-21 57113df3a0e2be01232281fad9a5f2c060567981
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// Copyright 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
 
syntax = "proto2";
 
package android.vts;
 
import "test/vts/proto/VtsResourceControllerMessage.proto";
 
// Type of a command.
enum VtsDriverCommandType {
  UNKNOWN_VTS_DRIVER_COMMAND_TYPE = 0;
 
  // To request to exit a driver.
  EXIT = 1;
  // To get the status of a driver.
  GET_STATUS = 2;
 
  // for a HAL driver
  // To request to load a HAL.
  LOAD_HAL = 101;
  // To get a list of available functions.
  LIST_FUNCTIONS = 102;
  // To call a function.
  CALL_FUNCTION = 103;
  // To get the value of an attribute.
  GET_ATTRIBUTE = 104;
  // To read the specification message of a component.
  VTS_DRIVER_COMMAND_READ_SPECIFICATION = 105;
 
  // for a shell driver
  // To execute a shell command.
  EXECUTE_COMMAND = 201;
 
  // To invoke a system call.
  INVOKE_SYSCALL = 202;
 
  // To request FMQ resource.
  FMQ_OPERATION = 301;
  // To request hidl_memory resource.
  HIDL_MEMORY_OPERATION = 302;
  // To request hidl_handle resource.
  HIDL_HANDLE_OPERATION = 303;
}
 
 
// Type of a response.
enum VtsDriverResponseCode {
  UNKNOWN_VTS_DRIVER_RESPONSE_CODE = 0;
  // successful
  VTS_DRIVER_RESPONSE_SUCCESS = 1;
  // failed
  VTS_DRIVER_RESPONSE_FAIL = 2;
}
 
 
// To specify a command.
message VtsDriverControlCommandMessage {
  // Command type.
  optional VtsDriverCommandType command_type = 1;
 
  // for EXIT
  // none
 
  // for GET_STATUS
  optional int32 status_type = 1101;
 
  // for LOAD_HAL
  // The name of a target.
  optional bytes file_path = 1201;
  // target class
  optional int32 target_class = 1202;
  // target type
  optional int32 target_type = 1203;
  // target version (should be divided by 100) - float has a compatibility issue
  // between C/C++ and python protoc.
  // Deprecated, use target_version_major and target_version_minor instead.
  optional float target_version = 1204 [deprecated = true];
  // the name of a HAL module to open.
  optional bytes module_name = 1205;
  // the package of a HIDL HAL to open.
  optional bytes target_package = 1206;
  // the name of a target component (currently used for HIDL HALs only).
  optional bytes target_component_name = 1207;
 
  // use two ints to represent major and minor versions separately.
  // HAL major version of target component (e.g. 1.0 -> 1).
  optional int32 target_version_major = 1208 [default = -1];
  // HAL minor version of target component (e.g. 1.0 -> 0).
  optional int32 target_version_minor = 1209 [default = -1];
 
  // the name of a HW Binder service to use (only needed for HIDL HAL).
  optional bytes hw_binder_service_name = 1221;
 
  // for LIST_FUNCTIONS
  // none
 
  // for CALL_FUNCTION
  optional bytes arg = 1401;
 
  // UID of a caller on the driver-side.
  optional bytes driver_caller_uid = 1501;
 
  // for EXECUTE_COMMAND
  repeated bytes shell_command = 2001;
 
  // Arguments for operation on FMQ
  optional FmqRequestMessage fmq_request = 3001;
  // Arguments for operation on hidl_memory
  optional HidlMemoryRequestMessage hidl_memory_request = 3002;
  // Arguments for operation on hidl_handle
  optional HidlHandleRequestMessage hidl_handle_request = 3003;
}
 
 
// To specify a response.
message VtsDriverControlResponseMessage {
  // Response type.
  optional VtsDriverResponseCode response_code = 1;
 
  // Return value.
  optional int32 return_value = 11;
  // Return message.
  optional bytes return_message = 12;
 
  // The stdout message for each command
  repeated bytes stdout = 1001;
  // The stderr message for each command
  repeated bytes stderr = 1002;
  // The exit code for each command
  repeated int32 exit_code = 1003;
 
  // The retrieved specifications.
  repeated bytes spec = 2001;
 
  // read data and return values from FMQ driver
  optional FmqResponseMessage fmq_response = 3001;
  // response from hidl_memory driver
  optional HidlMemoryResponseMessage hidl_memory_response = 3002;
  // response from hidl_handle driver
  optional HidlHandleResponseMessage hidl_handle_response = 3003;
}