Merge "Revert "produce vts_hal_agent binary as part of android-vts.zip""
diff --git a/agents/hal/RequestHandler.cpp b/agents/hal/RequestHandler.cpp
index 84851c0..e038fee 100644
--- a/agents/hal/RequestHandler.cpp
+++ b/agents/hal/RequestHandler.cpp
@@ -34,8 +34,8 @@
#include <sstream>
#include <vector>
-#include "test/vts/runners/host/proto/AndroidSystemControlMessage.pb.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/AndroidSystemControlMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "BinderClient.h"
#include "SocketServerForDriver.h"
diff --git a/agents/hal/RequestHandler.h b/agents/hal/RequestHandler.h
index acee747..ede1fc9 100644
--- a/agents/hal/RequestHandler.h
+++ b/agents/hal/RequestHandler.h
@@ -20,8 +20,8 @@
#include <string>
#include <vector>
-#include "test/vts/runners/host/proto/AndroidSystemControlMessage.pb.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/AndroidSystemControlMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
using namespace google::protobuf;
diff --git a/agents/hal/SocketServerForDriver.cpp b/agents/hal/SocketServerForDriver.cpp
index 3d78baa..0c52f12 100644
--- a/agents/hal/SocketServerForDriver.cpp
+++ b/agents/hal/SocketServerForDriver.cpp
@@ -27,7 +27,7 @@
#include <iostream>
#include <sstream>
-#include "test/vts/runners/host/proto/AndroidSystemControlMessage.pb.h"
+#include "test/vts/proto/AndroidSystemControlMessage.pb.h"
using namespace std;
diff --git a/agents/hal/TcpServer.cpp b/agents/hal/TcpServer.cpp
index e12b7d8..5d50459 100644
--- a/agents/hal/TcpServer.cpp
+++ b/agents/hal/TcpServer.cpp
@@ -34,8 +34,8 @@
#include <iostream>
#include <sstream>
-#include "test/vts/runners/host/proto/AndroidSystemControlMessage.pb.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/AndroidSystemControlMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "BinderClient.h"
#include "RequestHandler.h"
diff --git a/build-python.sh b/build-python.sh
index a940dcd..cb020e8 100755
--- a/build-python.sh
+++ b/build-python.sh
@@ -12,5 +12,5 @@
python -m compileall .
-protoc -I=runners/host/proto --python_out=runners/host/proto runners/host/proto/AndroidSystemControlMessage.proto
-protoc -I=runners/host/proto --python_out=runners/host/proto runners/host/proto/InterfaceSpecificationMessage.proto
+protoc -I=proto --python_out=proto proto/AndroidSystemControlMessage.proto
+protoc -I=proto --python_out=proto proto/InterfaceSpecificationMessage.proto
diff --git a/drivers/Android.mk b/drivers/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/drivers/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
diff --git a/drivers/shell/Android.mk b/drivers/shell/Android.mk
new file mode 100644
index 0000000..590e305
--- /dev/null
+++ b/drivers/shell/Android.mk
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := vts_shell_driver
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := \
+ shell_msg_protocol.c \
+ shell_driver.c \
+ shell_driver_main.c \
+
+LOCAL_SHARED_LIBRARIES := \
+ libutils \
+ libcutils \
+
+LOCAL_CFLAGS := $(common_c_flags)
+include $(BUILD_EXECUTABLE)
+
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := vts_shell_driver_test
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := \
+ shell_msg_protocol.c \
+ shell_driver.c \
+ shell_driver_test_client.c \
+ shell_driver_test.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+ libutils \
+ libcutils \
+
+LOCAL_CFLAGS := $(common_c_flags)
+include $(BUILD_NATIVE_TEST)
\ No newline at end of file
diff --git a/drivers/shell/shell_driver.c b/drivers/shell/shell_driver.c
new file mode 100644
index 0000000..5c3a13a
--- /dev/null
+++ b/drivers/shell/shell_driver.c
@@ -0,0 +1,214 @@
+/*
+ * 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.
+ */
+
+
+#include "shell_driver.h"
+#include "shell_msg_protocol.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdbool.h>
+#include <time.h>
+
+
+/**
+ * struct to save status of reading shell command output
+ */
+typedef struct output_struct {
+ bool is_fully_read;
+ FILE* output_fp;
+ char buffer[4096];
+} output_struct;
+
+
+/**
+ * read output once for the given length and save status to the struct
+ */
+static bool read_output(output_struct* output) {
+ if (output == NULL) {
+ fprintf(stderr, "error: NULL reference of output\n");
+ return false;
+ }
+
+ fread(output->buffer, sizeof(output->buffer), 1, output->output_fp);
+ output->is_fully_read = feof(output->output_fp);
+
+ return !ferror(output->output_fp);
+}
+
+/**
+ * close file path for output and free memory
+ */
+static int close_output(output_struct* output) {
+ // TODO(yuexima): call close on output;
+ int close_success;
+ close_success = pclose(output -> output_fp);
+ free(output);
+
+ return close_success;
+}
+
+
+/*
+ * execute a given shell command and return the output file descriptor
+ * Please remember to call close_output after usage.
+ */
+static output_struct* exec_shell_cmd(char* cmd) {
+ // TODO(yuexima): handle no output case.
+ FILE* output_fp;
+
+ // execute the command.
+ output_fp = popen(cmd, "r");
+ if (output_fp == NULL) {
+ fprintf(stderr, "Failed to run command\n");
+ exit(errno);
+ }
+
+ output_struct* output = malloc(sizeof(output_struct));
+ memset((void*)output, 0, sizeof(output));
+
+ output->output_fp = output_fp;
+
+ return read_output(output) ? output : NULL;
+}
+
+
+/*
+ * Handles a socket connection. Will execute a received shell command
+ * and send back the output text.
+ */
+static int connection_handler_shell_cmd(int connection_fd) {
+ // TODO(yuexima): handle multiple commands in a while loop
+
+ char* cmd;
+ cmd = read_with_length(connection_fd);
+
+ printf("Driver: received command [\"%s\"]. Processing... \n", cmd);
+
+ // execute command and write back output
+ output_struct* output = exec_shell_cmd(cmd);
+
+ bool read_success;
+
+ // TODO(yuexima): check success
+ do {
+ write_with_length(connection_fd, output->buffer);
+ printf("Driver: wrote output: [%s]\n", output->buffer);
+ read_success = read_output(output);
+ if (!read_success) {
+ fprintf(stderr, "Driver: read error %d\n", read_success);
+ break;
+ }
+ } while (!output->is_fully_read);
+
+ printf("Driver: finished processing command [\"%s\"].\n", cmd);
+
+ int close_conn_success;
+ int close_output_success;
+
+ free(cmd);
+ close_conn_success = close(connection_fd);
+ if (close_conn_success != 0) {
+ fprintf(stderr, "Driver: failed to close connection (errno: %d).\n", errno);
+ }
+ close_output_success = close_output(output);
+ if (close_output_success != 0) {
+ fprintf(stderr,
+ "Driver: failed to close output buffer. (pclose: %d).\n",
+ close_output_success);
+ }
+
+ return read_success && close_conn_success == 0 && close_output_success == 0 ? 0 : 1;
+}
+
+
+int vts_shell_driver_start(char* addr_socket) {
+ struct sockaddr_un address;
+ int socket_fd, connection_fd;
+ socklen_t address_length;
+ pid_t child;
+
+ socket_fd = socket(PF_UNIX, SOCK_STREAM, 0);
+ if (socket_fd < 0) {
+ fprintf(stderr, "socket() failed\n");
+ return socket_fd;
+ }
+
+ unlink(addr_socket);
+ memset(&address, 0, sizeof(struct sockaddr_un));
+ address.sun_family = AF_UNIX;
+ strcpy(address.sun_path, addr_socket);
+
+ if (bind(socket_fd,
+ (struct sockaddr *) &address,
+ sizeof(struct sockaddr_un)) != 0) {
+ fprintf(stderr, "bind() failed: errno = %d\n", errno);
+ return 1;
+ }
+
+ if (listen(socket_fd, 5) != 0) {
+ fprintf(stderr, "Driver: listen() failed: errno = %d\n", errno);
+
+ return errno;
+ }
+
+ while (1) {
+ address_length = sizeof(address);
+
+ connection_fd = accept(socket_fd,
+ (struct sockaddr *)&address, &address_length);
+ if (connection_fd == -1) {
+ fprintf(stderr, "accept error: %s\n", strerror(errno));
+ break;
+ }
+
+ child = fork();
+
+ if (child == 0) {
+ // now inside newly created connection handling process
+ int res = connection_handler_shell_cmd(connection_fd);
+
+ if (res == 0) { // success
+ return 0;
+ } else {
+ fprintf(stderr, "Driver: connection handler returned failure");
+ return 1;
+ }
+ } else if (child > 0) {
+ // parent - no op.
+ } else {
+ fprintf(stderr,
+ "shell_driver.c: create child process failed. Exiting...");
+ return(errno);
+ }
+
+ close(connection_fd);
+ }
+
+ // clean up
+ close(socket_fd);
+ unlink(addr_socket);
+ free(addr_socket);
+
+ return 0;
+}
+
+
diff --git a/drivers/shell/shell_driver.h b/drivers/shell/shell_driver.h
new file mode 100644
index 0000000..7d291c6
--- /dev/null
+++ b/drivers/shell/shell_driver.h
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+#ifndef __VTS_DRIVERS_SHELL_SHELL_DRIVER_H_
+#define __VTS_DRIVERS_SHELL_SHELL_DRIVER_H_
+
+
+/*
+ * starts driver process and listen on the specified UNIX domain socket.
+ */
+extern int vts_shell_driver_start(char* socket_address);
+
+
+#endif // __VTS_DRIVERS_SHELL_SHELL_DRIVER_H_
diff --git a/drivers/shell/shell_driver_main.c b/drivers/shell/shell_driver_main.c
new file mode 100644
index 0000000..ced8b82
--- /dev/null
+++ b/drivers/shell/shell_driver_main.c
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+#include "shell_driver.h"
+#include "shell_msg_protocol.h"
+
+/*
+ * starts the driver listening on UNIX socket for shell commands
+ */
+int main() {
+ return vts_shell_driver_start(kAddressUnixSocketPrefix);
+}
diff --git a/drivers/shell/shell_driver_test.cpp b/drivers/shell/shell_driver_test.cpp
new file mode 100644
index 0000000..bdb2384
--- /dev/null
+++ b/drivers/shell/shell_driver_test.cpp
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+
+#include <gtest/gtest.h>
+#include <errno.h>
+#include <limits.h>
+#include <unistd.h>
+
+
+// include code to be tested
+extern "C" {
+#include <shell_driver.h>
+#include <shell_driver_test_client.h>
+}
+
+
+/*
+ * Prototype unit test helper. It first forks a vts_shell_driver process
+ * and then call a client function to execute a command.
+ */
+static char* test_shell_command_output(char* command, char* addr_socket) {
+ int res = 0;
+ pid_t p_driver;
+ char* res_client;
+
+ p_driver = fork();
+ if (p_driver == 0) { // child
+ int res_driver = ::vts_shell_driver_start(addr_socket);
+
+ if (res_driver != 0) {
+ fprintf(stderr,
+ "Driver reported error. The error code is: %d.\n", res_driver);
+ exit(res_driver);
+ }
+
+ exit(0);
+ } else if (p_driver > 0) { // parent
+ int res_client_len;
+
+ res_client = ::vts_shell_driver_test_client_start(command, addr_socket);
+ res_client_len = strlen(res_client);
+
+ if (res_client == NULL) {
+ fprintf(stderr, "Client reported error.\n");
+ exit(1);
+ }
+ } else {
+ fprintf(stderr,
+ "shell_driver_test.cpp: create child process failed for driver.");
+ exit(-1);
+ }
+
+ // send kill signal to insure the process would not block
+ kill(p_driver, SIGKILL);
+
+ printf("Client result: [%s]\n", res_client);
+
+ return res_client;
+}
+
+
+/*
+ * This test tests whether the output of "uname" is "Linux\n"
+ */
+TEST(vts_shell_driver_start, vts_shell_driver_unit_test_uname) {
+ char* cmd;
+ char* expected;
+ char* expected_windows;
+ char* expected_darwin;
+ char* addr_socket;
+ char* output;
+
+ cmd = strdup("uname");
+ expected = strdup("Linux\n");\
+ addr_socket = strdup("test1_1.tmp");
+
+ output = test_shell_command_output(cmd, addr_socket);
+ ASSERT_TRUE(!strcmp(output, expected));
+
+ free(cmd);
+ free(expected);
+ free(addr_socket);
+ free(output);
+}
+
+/*
+ * This test tests whether the output of "uname" is "Linux\n"
+ */
+TEST(vts_shell_driver_start, vts_shell_driver_unit_test_which_ls) {
+ char* cmd;
+ char* expected;
+ char* addr_socket;
+ char* output;
+
+ cmd = strdup("which ls");
+ expected = strdup("/system/bin/ls\n");
+ addr_socket = strdup("test1_2.tmp");
+
+ output = test_shell_command_output(cmd, addr_socket);
+ ASSERT_TRUE(!strcmp(output, expected));
+
+ free(cmd);
+ free(expected);
+ free(addr_socket);
+ free(output);
+}
+
diff --git a/drivers/shell/shell_driver_test_client.c b/drivers/shell/shell_driver_test_client.c
new file mode 100644
index 0000000..4291455
--- /dev/null
+++ b/drivers/shell/shell_driver_test_client.c
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ */
+
+#include "shell_driver_test_client.h"
+#include "shell_driver.h"
+#include "shell_msg_protocol.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <string.h>
+#include <math.h>
+
+
+static int kMaxRetry = 3;
+
+/*
+ * send a command to the driver on specified UNIX domain socket and print out
+ * the outputs from driver.
+ */
+char* vts_shell_driver_test_client_start(char* cmd, char* addr_socket) {
+ struct sockaddr_un address;
+ int socket_fd;
+ int nbytes;
+
+ socket_fd = socket(PF_UNIX, SOCK_STREAM, 0);
+ if (socket_fd < 0) {
+ fprintf(stderr, "socket() failed\n");
+ return NULL;
+ }
+
+ memset(&address, 0, sizeof(struct sockaddr_un));
+
+ address.sun_family = AF_UNIX;
+ strcpy(address.sun_path, addr_socket);
+
+ int conn_success;
+ int retry_count = 0;
+
+ conn_success = connect(socket_fd, (struct sockaddr *)&address,
+ sizeof(struct sockaddr_un));
+ for (retry_count = 0; retry_count < kMaxRetry && conn_success != 0;
+ retry_count++) { // retry if server not ready
+ printf("Client: connection failed, retrying...\n");
+ retry_count++;
+ if (usleep(50 * pow(retry_count, 3)) != 0) {
+ fprintf(stderr, "shell driver unit test: sleep intrupted.");
+ }
+
+ conn_success = connect(socket_fd, (struct sockaddr *)&address,
+ sizeof(struct sockaddr_un));
+ }
+
+ if (conn_success != 0) {
+ fprintf(stderr, "connect() failed\n");
+ return NULL;
+ }
+
+ // write the cmd using our length protocol
+ int res_cmd_write = write_with_length(socket_fd, cmd);
+ if (res_cmd_write != 0) {
+ fprintf(stderr, "Client: write command failed.\n");
+ return NULL;
+ }
+
+ // read driver output
+ char* output = read_with_length(socket_fd);
+ printf("Client receiving output: %s", output);
+
+ close(socket_fd);
+
+ return output;
+}
diff --git a/drivers/shell/shell_driver_test_client.h b/drivers/shell/shell_driver_test_client.h
new file mode 100644
index 0000000..c7b26f8
--- /dev/null
+++ b/drivers/shell/shell_driver_test_client.h
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+#ifndef __VTS_DRIVERS_SHELL_DRIVER_TEST_CLIENT_H_
+#define __VTS_DRIVERS_SHELL_DRIVER_TEST_CLIENT_H_
+
+/*
+ * send a command to the driver on specified UNIX domain socket and print out
+ * the outputs from driver.
+ */
+extern char* vts_shell_driver_test_client_start(char* cmd, char* addr_socket);
+
+
+#endif // __VTS_DRIVERS_SHELL_DRIVER_TEST_CLIENT_H_
+
diff --git a/drivers/shell/shell_msg_protocol.c b/drivers/shell/shell_msg_protocol.c
new file mode 100644
index 0000000..d47997b
--- /dev/null
+++ b/drivers/shell/shell_msg_protocol.c
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ */
+
+#include "shell_msg_protocol.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <string.h>
+
+
+int kLengthTextBufferSize = 6;
+char* kAddressUnixSocketPrefix = "./tmp_unix_socket_test/";
+
+/*
+ * read a line from socket connection into a char buffer up to length of size.
+ * The length read will be the return value;
+ */
+static int readline(char* buf, int size, int connection_fd) {
+ int idx = 0;
+
+ while (idx < size
+ && read(connection_fd, &buf[idx], 1) == 1) {
+ if (buf[idx] == '\n') break;
+ idx++;
+ }
+
+ return idx;
+}
+
+
+int write_with_length(int connection_fd, char* msg) {
+ // get the length of the command
+ int len = strlen(msg);
+
+ // allocate space for converting length int into text
+ char lenstr[kLengthTextBufferSize];
+
+ // print length int into text string
+ sprintf(lenstr, "%d\n", len);
+
+ // length of the length string
+ int len_lenstr = strlen(lenstr);
+
+ // length actual written to socket
+ int len_written;
+
+ // write the length text string to the receiver with a new line char
+ len_written = write(connection_fd, lenstr, len_lenstr);
+ if (len_written != len_lenstr) {
+ fprintf(stderr, "length written to socket is different from expected: ");
+ fprintf(stderr, "expected: %d, actual:%d\n", len_lenstr, len_written);
+
+ return 1;
+ }
+
+ // write the actual msg string
+ len_written = write(connection_fd, msg, len);
+ if (len_written != len) {
+ fprintf(stderr, "length written to socket is different from expected: ");
+ fprintf(stderr, "expected: %d, actual:%d\n", len, len_written);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+
+char* read_with_length(int connection_fd) {
+ // reads the length of shell command
+ // our protocol specifies a new line char to be the separator.
+ char msg_buf[kLengthTextBufferSize];
+
+ int len_read;
+
+ len_read = readline(msg_buf, sizeof(msg_buf), connection_fd);
+
+ if (len_read < 0) {
+ fprintf(stderr, "read error.\n");
+ return NULL;
+ }
+
+ int msglen = atoi(msg_buf);
+
+ // read command from client
+ char* msg = malloc(msglen + 1);
+
+ int nbytes;
+ nbytes = read(connection_fd, msg, msglen);
+
+ if (nbytes < 0) {
+ // check connection read success
+ fprintf(stderr, "read connection failed.");
+
+ exit(errno);
+ } else if (nbytes != msglen) {
+ // check whether the length read is expected
+ fprintf(stderr, "read command from client with unexpected length.");
+
+ exit(1);
+ }
+
+ // set the end of string
+ msg[nbytes] = 0;
+
+ return msg;
+}
diff --git a/drivers/shell/shell_msg_protocol.h b/drivers/shell/shell_msg_protocol.h
new file mode 100644
index 0000000..4a1ac97
--- /dev/null
+++ b/drivers/shell/shell_msg_protocol.h
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+#ifndef __VTS_DRIVERS_SHELL_MSG_PROTOCOL_H_
+#define __VTS_DRIVERS_SHELL_MSG_PROTOCOL_H_
+
+
+extern int kLengthTextBufferSize;
+extern char* kAddressUnixSocketPrefix;
+
+/*
+ * write a message to a socket connection using our protocol:
+ * The length of the message will be encoded in text and sent at first.
+ * A new line character will be used to separate the length text and message.
+ */
+int write_with_length(int connection_fd, char* msg);
+
+/*
+ * read a message from a socket connection encoded according to our protocol.
+ * Please remember to free the message after use.
+ */
+char* read_with_length(int connection_fd);
+
+
+#endif // __VTS_DRIVERS_SHELL_MSG_PROTOCOL_H_
diff --git a/images/angler/32/fuzzer32 b/images/angler/32/fuzzer32
index 2a1a949..3cc087c 100755
--- a/images/angler/32/fuzzer32
+++ b/images/angler/32/fuzzer32
Binary files differ
diff --git a/images/angler/32/hal/libmmjpeg_interface.vts.so b/images/angler/32/hal/libmmjpeg_interface.vts.so
index bb4c82c..acf6597 100755
--- a/images/angler/32/hal/libmmjpeg_interface.vts.so
+++ b/images/angler/32/hal/libmmjpeg_interface.vts.so
Binary files differ
diff --git a/images/angler/32/hal/libqdMetaData.vts.so b/images/angler/32/hal/libqdMetaData.vts.so
index cc218dc..a2b14d3 100755
--- a/images/angler/32/hal/libqdMetaData.vts.so
+++ b/images/angler/32/hal/libqdMetaData.vts.so
Binary files differ
diff --git a/images/angler/32/hal/libqomx_core.vts.so b/images/angler/32/hal/libqomx_core.vts.so
index ba885ba..26eedf6 100755
--- a/images/angler/32/hal/libqomx_core.vts.so
+++ b/images/angler/32/hal/libqomx_core.vts.so
Binary files differ
diff --git a/images/angler/32/libvts_codecoverage.so b/images/angler/32/libvts_codecoverage.so
index b59506e..9d84528 100755
--- a/images/angler/32/libvts_codecoverage.so
+++ b/images/angler/32/libvts_codecoverage.so
Binary files differ
diff --git a/images/angler/32/libvts_common.so b/images/angler/32/libvts_common.so
index bf062eb..950a3e8 100755
--- a/images/angler/32/libvts_common.so
+++ b/images/angler/32/libvts_common.so
Binary files differ
diff --git a/images/angler/32/libvts_datatype.so b/images/angler/32/libvts_datatype.so
index 80fd2ba..f14e579 100755
--- a/images/angler/32/libvts_datatype.so
+++ b/images/angler/32/libvts_datatype.so
Binary files differ
diff --git a/images/angler/32/libvts_interfacespecification.so b/images/angler/32/libvts_interfacespecification.so
index 3cfffe4..f705251 100755
--- a/images/angler/32/libvts_interfacespecification.so
+++ b/images/angler/32/libvts_interfacespecification.so
Binary files differ
diff --git a/images/angler/32/libvts_measurement.so b/images/angler/32/libvts_measurement.so
index 308b5d4..2d5ade0 100755
--- a/images/angler/32/libvts_measurement.so
+++ b/images/angler/32/libvts_measurement.so
Binary files differ
diff --git a/images/angler/32/libvts_multidevice_proto.so b/images/angler/32/libvts_multidevice_proto.so
index bdb5053..5bfdd36 100755
--- a/images/angler/32/libvts_multidevice_proto.so
+++ b/images/angler/32/libvts_multidevice_proto.so
Binary files differ
diff --git a/images/angler/64/fuzzer64 b/images/angler/64/fuzzer64
index 08bec64..546774f 100755
--- a/images/angler/64/fuzzer64
+++ b/images/angler/64/fuzzer64
Binary files differ
diff --git a/images/angler/64/libvts_codecoverage.so b/images/angler/64/libvts_codecoverage.so
index f0eeb20..0daf8fa 100755
--- a/images/angler/64/libvts_codecoverage.so
+++ b/images/angler/64/libvts_codecoverage.so
Binary files differ
diff --git a/images/angler/64/libvts_common.so b/images/angler/64/libvts_common.so
index 821c07f..8253753 100755
--- a/images/angler/64/libvts_common.so
+++ b/images/angler/64/libvts_common.so
Binary files differ
diff --git a/images/angler/64/libvts_datatype.so b/images/angler/64/libvts_datatype.so
index 37aee48..c9504df 100755
--- a/images/angler/64/libvts_datatype.so
+++ b/images/angler/64/libvts_datatype.so
Binary files differ
diff --git a/images/angler/64/libvts_interfacespecification.so b/images/angler/64/libvts_interfacespecification.so
index 0b9f050..78ae38a 100755
--- a/images/angler/64/libvts_interfacespecification.so
+++ b/images/angler/64/libvts_interfacespecification.so
Binary files differ
diff --git a/images/angler/64/libvts_measurement.so b/images/angler/64/libvts_measurement.so
index f530fc8..3c8c065 100755
--- a/images/angler/64/libvts_measurement.so
+++ b/images/angler/64/libvts_measurement.so
Binary files differ
diff --git a/images/angler/64/libvts_multidevice_proto.so b/images/angler/64/libvts_multidevice_proto.so
index 44ce16e..2f72737 100755
--- a/images/angler/64/libvts_multidevice_proto.so
+++ b/images/angler/64/libvts_multidevice_proto.so
Binary files differ
diff --git a/images/angler/64/vts_hal_agent b/images/angler/64/vts_hal_agent
index 22db9f2..72c4c7e 100755
--- a/images/angler/64/vts_hal_agent
+++ b/images/angler/64/vts_hal_agent
Binary files differ
diff --git a/images/bullhead/32/fuzzer32 b/images/bullhead/32/fuzzer32
index c05000d..1af5162 100755
--- a/images/bullhead/32/fuzzer32
+++ b/images/bullhead/32/fuzzer32
Binary files differ
diff --git a/images/bullhead/32/hal/camera.bullhead-vts.so b/images/bullhead/32/hal/camera.bullhead-vts.so
index 5b7425d..eb4ea75 100755
--- a/images/bullhead/32/hal/camera.bullhead-vts.so
+++ b/images/bullhead/32/hal/camera.bullhead-vts.so
Binary files differ
diff --git a/images/bullhead/32/hal/libmmjpeg_interface.vts.so b/images/bullhead/32/hal/libmmjpeg_interface.vts.so
index 1ed4bc7..ce500b7 100755
--- a/images/bullhead/32/hal/libmmjpeg_interface.vts.so
+++ b/images/bullhead/32/hal/libmmjpeg_interface.vts.so
Binary files differ
diff --git a/images/bullhead/32/hal/libqdMetaData.vts.so b/images/bullhead/32/hal/libqdMetaData.vts.so
index 7c2af4e..e6c0969 100755
--- a/images/bullhead/32/hal/libqdMetaData.vts.so
+++ b/images/bullhead/32/hal/libqdMetaData.vts.so
Binary files differ
diff --git a/images/bullhead/32/hal/libqomx_core.vts.so b/images/bullhead/32/hal/libqomx_core.vts.so
index 9a54ea1..2dfc66e 100755
--- a/images/bullhead/32/hal/libqomx_core.vts.so
+++ b/images/bullhead/32/hal/libqomx_core.vts.so
Binary files differ
diff --git a/images/bullhead/32/hal/lights.bullhead-vts.so b/images/bullhead/32/hal/lights.bullhead-vts.so
index c866c29..c39de04 100755
--- a/images/bullhead/32/hal/lights.bullhead-vts.so
+++ b/images/bullhead/32/hal/lights.bullhead-vts.so
Binary files differ
diff --git a/images/bullhead/32/libvts_codecoverage.so b/images/bullhead/32/libvts_codecoverage.so
index b59506e..9d84528 100755
--- a/images/bullhead/32/libvts_codecoverage.so
+++ b/images/bullhead/32/libvts_codecoverage.so
Binary files differ
diff --git a/images/bullhead/32/libvts_common.so b/images/bullhead/32/libvts_common.so
index 1af618b..7397a50 100755
--- a/images/bullhead/32/libvts_common.so
+++ b/images/bullhead/32/libvts_common.so
Binary files differ
diff --git a/images/bullhead/32/libvts_datatype.so b/images/bullhead/32/libvts_datatype.so
index 656342a..7b292aa 100755
--- a/images/bullhead/32/libvts_datatype.so
+++ b/images/bullhead/32/libvts_datatype.so
Binary files differ
diff --git a/images/bullhead/32/libvts_interfacespecification.so b/images/bullhead/32/libvts_interfacespecification.so
index bc178bc..a4fac65 100755
--- a/images/bullhead/32/libvts_interfacespecification.so
+++ b/images/bullhead/32/libvts_interfacespecification.so
Binary files differ
diff --git a/images/bullhead/32/libvts_measurement.so b/images/bullhead/32/libvts_measurement.so
index 308b5d4..2d5ade0 100755
--- a/images/bullhead/32/libvts_measurement.so
+++ b/images/bullhead/32/libvts_measurement.so
Binary files differ
diff --git a/images/bullhead/32/libvts_multidevice_proto.so b/images/bullhead/32/libvts_multidevice_proto.so
index ab65b22..ca15e1a 100755
--- a/images/bullhead/32/libvts_multidevice_proto.so
+++ b/images/bullhead/32/libvts_multidevice_proto.so
Binary files differ
diff --git a/images/bullhead/64/fuzzer64 b/images/bullhead/64/fuzzer64
index 0944822..abe7c9f 100755
--- a/images/bullhead/64/fuzzer64
+++ b/images/bullhead/64/fuzzer64
Binary files differ
diff --git a/images/bullhead/64/hal/lights.bullhead-vts.so b/images/bullhead/64/hal/lights.bullhead-vts.so
index 8c9e003..4cb40bf 100755
--- a/images/bullhead/64/hal/lights.bullhead-vts.so
+++ b/images/bullhead/64/hal/lights.bullhead-vts.so
Binary files differ
diff --git a/images/bullhead/64/libvts_codecoverage.so b/images/bullhead/64/libvts_codecoverage.so
index f0eeb20..0daf8fa 100755
--- a/images/bullhead/64/libvts_codecoverage.so
+++ b/images/bullhead/64/libvts_codecoverage.so
Binary files differ
diff --git a/images/bullhead/64/libvts_common.so b/images/bullhead/64/libvts_common.so
index 084ccc8..a89aafe 100755
--- a/images/bullhead/64/libvts_common.so
+++ b/images/bullhead/64/libvts_common.so
Binary files differ
diff --git a/images/bullhead/64/libvts_datatype.so b/images/bullhead/64/libvts_datatype.so
index e61eff2..f4fbeae 100755
--- a/images/bullhead/64/libvts_datatype.so
+++ b/images/bullhead/64/libvts_datatype.so
Binary files differ
diff --git a/images/bullhead/64/libvts_interfacespecification.so b/images/bullhead/64/libvts_interfacespecification.so
index 4183d16..d64f030 100755
--- a/images/bullhead/64/libvts_interfacespecification.so
+++ b/images/bullhead/64/libvts_interfacespecification.so
Binary files differ
diff --git a/images/bullhead/64/libvts_measurement.so b/images/bullhead/64/libvts_measurement.so
index f530fc8..3c8c065 100755
--- a/images/bullhead/64/libvts_measurement.so
+++ b/images/bullhead/64/libvts_measurement.so
Binary files differ
diff --git a/images/bullhead/64/libvts_multidevice_proto.so b/images/bullhead/64/libvts_multidevice_proto.so
index d914458..3112582 100755
--- a/images/bullhead/64/libvts_multidevice_proto.so
+++ b/images/bullhead/64/libvts_multidevice_proto.so
Binary files differ
diff --git a/images/bullhead/64/vts_hal_agent b/images/bullhead/64/vts_hal_agent
index d03798a..62a5817 100755
--- a/images/bullhead/64/vts_hal_agent
+++ b/images/bullhead/64/vts_hal_agent
Binary files differ
diff --git a/runners/host/proto/Android.mk b/proto/Android.mk
similarity index 92%
rename from runners/host/proto/Android.mk
rename to proto/Android.mk
index 91ef5e7..96771ed 100644
--- a/runners/host/proto/Android.mk
+++ b/proto/Android.mk
@@ -24,12 +24,7 @@
LOCAL_SRC_FILES := \
AndroidSystemControlMessage.proto \
InterfaceSpecificationMessage.proto \
-# $(call all-proto-files-under, ./)
-
-#LOCAL_SHARED_LIBRARIES := \
-
-#LOCAL_C_INCLUDES += \
- external/protobuf/src \
+ # $(call all-proto-files-under, ./)
LOCAL_C_INCLUDES := \
external/protobuf/src \
diff --git a/runners/host/proto/AndroidSystemControlMessage.proto b/proto/AndroidSystemControlMessage.proto
similarity index 100%
rename from runners/host/proto/AndroidSystemControlMessage.proto
rename to proto/AndroidSystemControlMessage.proto
diff --git a/runners/host/proto/AndroidSystemControlMessage_pb2.py b/proto/AndroidSystemControlMessage_pb2.py
similarity index 100%
rename from runners/host/proto/AndroidSystemControlMessage_pb2.py
rename to proto/AndroidSystemControlMessage_pb2.py
diff --git a/proto/InterfaceSpecificationMessage.proto b/proto/InterfaceSpecificationMessage.proto
new file mode 100644
index 0000000..bb1ddae
--- /dev/null
+++ b/proto/InterfaceSpecificationMessage.proto
@@ -0,0 +1,299 @@
+// 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;
+
+
+// Class of a target component.
+enum ComponentClass {
+ UNKNOWN_CLASS = 0;
+ // For a HAL shared library.
+ HAL_CONVENTIONAL = 1;
+ // For a shared library which is not a HAL (e.g., standard library).
+ SHAREDLIB = 2;
+ // For a HAL which uses HIDL (HAL Interface Definition Language).
+ HAL_HIDL = 3;
+ // For a submodule of a shared library HAL .
+ HAL_CONVENTIONAL_SUBMODULE = 4;
+ // For the legacy HAL.
+ HAL_LEGACY = 5;
+}
+
+
+// Type of a target component.
+enum ComponentType {
+ UNKNOWN_TYPE = 0;
+ // For an audio submodule.
+ AUDIO = 1;
+ // For a camera submodule.
+ CAMERA = 2;
+ // For a GPS submodule.
+ GPS = 3;
+ // For a Lights sensor submodule.
+ LIGHT = 4;
+ // For a WiFi submodule.
+ WIFI = 5;
+ // For a mobile networking submodule.
+ MOBILE = 6;
+ // For a WiFi submodule.
+ BLUETOOTH = 7;
+ // For a NFC submodule
+ NFC = 8;
+}
+
+
+// Type of a variable.
+enum VariableType {
+ UNKNOWN_VARIABLE_TYPE = 0;
+ TYPE_PREDEFINED = 1;
+ TYPE_SCALAR = 2;
+ TYPE_STRING = 3;
+ TYPE_ENUM = 4;
+ TYPE_VECTOR_FIXED = 5;
+ TYPE_VECTOR_VARIABLE = 6;
+ TYPE_STRUCT = 7;
+ // for conventional HALs, to keep a data structure with one or multiple
+ // callback functions.
+ TYPE_FUNCTION_POINTER = 8;
+ TYPE_VOID = 9;
+}
+
+
+// To specify a call flow event.
+message CallFlowSpecificationMessage {
+ // true if for a function call event.
+ optional bool entry = 1 [default = false];
+ // true if for an exit event from a function.
+ optional bool exit = 2 [default = false];
+ // a list of functions that can be called right after this event.
+ repeated bytes next = 11;
+ // a list of functions that can be called right before this event.
+ repeated bytes prev = 12;
+}
+
+
+// To specify a function.
+message FunctionSpecificationMessage {
+ // the function name.
+ optional bytes name = 1;
+
+ // data type of the return value (for legacy HALs and shared libraries).
+ optional VariableSpecificationMessage return_type = 11;
+
+ // data type of the return value (for HIDL HALs).
+ repeated VariableSpecificationMessage return_type_hidl = 12;
+
+ // a list of arguments.
+ repeated VariableSpecificationMessage arg = 21;
+
+ // a specification of the call flows of the function.
+ repeated CallFlowSpecificationMessage callflow = 31;
+
+ // profiling data.
+ repeated float profiling_data = 101;
+
+ // coverage measurement data.
+ repeated uint32 coverage_data = 201;
+
+ // not a user-provided variable. used by the frameworks to tell the sub
+ // struct hierarchy.
+ optional bytes parent_path = 301;
+}
+
+
+// To keep the value of a scalar variable.
+message ScalarDataValueMessage {
+ optional int32 bool = 1;
+
+ optional int32 int8_t = 11;
+ optional uint32 uint8_t = 12;
+
+ optional int32 char = 13;
+ optional uint32 uchar = 14;
+
+ optional int32 int16_t = 21;
+ optional uint32 uint16_t = 22;
+
+ optional int32 int32_t = 31;
+ optional uint32 uint32_t = 32;
+
+ optional int64 int64_t = 41;
+ optional uint64 uint64_t = 42;
+
+ optional float float_t = 101;
+ optional double double_t = 102;
+
+ optional uint32 pointer = 201;
+ optional uint32 opaque = 202;
+ optional uint32 void_pointer = 211;
+ optional uint32 char_pointer = 212;
+ optional uint32 pointer_pointer = 251;
+
+ // for scalar attributes in a union data structure,
+ // to specify the number of used bits.
+ optional uint32 bits = 1001;
+}
+
+
+// To keep the value of a vector variable.
+message VectorDataValueMessage {
+ // set in advance if the type is a fixed-length vector.
+ optional uint32 size = 1;
+
+ // when it's for a scalar vector.
+ optional bytes scalar_type = 11;
+ repeated ScalarDataValueMessage value = 12;
+}
+
+
+// To keep the specification and value of a function pointer.
+message FunctionPointerSpecificationMessage {
+ // used for a function pointer to keep its function name.
+ optional bytes function_name = 1;
+
+ // actual pointer value.
+ optional uint32 address = 11;
+ // ID used for VTS RMI (remote method invocation).
+ optional bytes id = 21;
+
+ // argument(s)
+ repeated VariableSpecificationMessage arg = 101;
+
+ // data type of the return value (for legacy HALs and shared libraries).
+ optional VariableSpecificationMessage return_type = 111;
+}
+
+
+// To keep the value of a string variable.
+message StringDataValueMessage {
+ // for actual contents.
+ optional bytes message = 1;
+
+ // for length in bytes, and usually not required.
+ optional uint32 length = 11;
+}
+
+
+// To keep the value of an enum type variable.
+message EnumDataValueMessage {
+ // for the enumerator names.
+ repeated bytes enumerator = 1;
+
+ // for the corresponding values.
+ repeated uint32 value = 2;
+}
+
+
+// To specify a function argument or an attribute in general.
+message VariableSpecificationMessage {
+ // the variable name. empty if for a type definition.
+ optional bytes name = 1;
+
+ // the variable type which is one of:
+ // TYPE_SCALAR, TYPE_STRING, TYPE_ENUM, TYPE_VECTOR_FIXED,
+ // TYPE_VECTOR_VARIABLE, TYPE_STRUCT, TYPE_UNION
+ //
+ // not yet supported:
+ // "template", "typedef", "handle", "binder", "parcelable".
+ optional VariableType type = 2;
+
+ // the actual value(s) for an scalar data type.
+ // repeated values for a vector.
+ optional ScalarDataValueMessage scalar_value = 101;
+ optional bytes scalar_type = 102;
+
+ optional StringDataValueMessage string_value = 111;
+
+ optional EnumDataValueMessage enum_value = 121;
+
+ repeated VectorDataValueMessage vector_value = 131;
+
+ // for sub variables when this's a struct type.
+ repeated VariableSpecificationMessage struct_value = 141;
+ // the type name of this struct.
+ optional bytes struct_type = 142;
+
+ // for sub variables when this's a union type.
+ repeated VariableSpecificationMessage union_value = 151;
+
+ // for non HIDL HALs, to use a custom type defined in C/C++.
+ optional bytes predefined_type = 201;
+
+ // for non HIDL HALs, to set function pointer(s).
+ repeated FunctionPointerSpecificationMessage function_pointer = 221;
+
+ // true if the argument is an input (valid only for the top-level message).
+ optional bool is_input = 301 [default = true];
+ // true if the argument is an output.
+ optional bool is_output = 302 [default = false];
+ // true if the argument is a constant variable.
+ optional bool is_const = 303 [default = false];
+ // true if the argument is a struct with one or multiple function pointers.
+ optional bool is_callback = 304 [default = false];
+}
+
+
+// To specify a sub-structure.
+message StructSpecificationMessage {
+ // the sub-structure's variable name in its parent data structure.
+ optional bytes name = 1;
+
+ // whether itself a pointer varaible in its parent data structure.
+ optional bool is_pointer = 2 [default = false];
+
+ // a list of functions contained in the struct.
+ repeated FunctionSpecificationMessage api = 1001;
+
+ // a list of structures contained in the component.
+ repeated StructSpecificationMessage sub_struct = 2001;
+
+ // The definitions of custom-defined aggregate types.
+ repeated VariableSpecificationMessage attribute = 3001;
+}
+
+
+// To specify an interface of a component
+message InterfaceSpecificationMessage {
+ // Class, type, and version of a target component.
+ optional ComponentClass component_class = 1;
+ optional ComponentType component_type = 2;
+ optional float component_type_version = 3 [default = 1.0];
+ // The name of a target component (used for HIDL HALs).
+ optional bytes component_name = 4;
+
+ // The package path of a target component (e.g., android.hardware.name).
+ // name implies the component_type field.
+ optional bytes package = 11;
+
+ // The modules to import (e.g., package_path.component_name).
+ repeated bytes import = 12;
+
+ // The name of original C/C++ data structure
+ // (used for conventional and legacy HALs).
+ optional bytes original_data_structure_name = 1001;
+
+ // a list of headers that need to be imported in order to use the component.
+ repeated bytes header = 1002;
+
+ // a list of functions exposed by the component.
+ repeated FunctionSpecificationMessage api = 2001;
+
+ // The definitions of custom-defined aggregate types.
+ repeated VariableSpecificationMessage attribute = 3001;
+
+ // a list of structures contained in the component.
+ repeated StructSpecificationMessage sub_struct = 4001;
+}
diff --git a/proto/InterfaceSpecificationMessage_pb2.py b/proto/InterfaceSpecificationMessage_pb2.py
new file mode 100644
index 0000000..a65f663
--- /dev/null
+++ b/proto/InterfaceSpecificationMessage_pb2.py
@@ -0,0 +1,1018 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: InterfaceSpecificationMessage.proto
+
+from google.protobuf.internal import enum_type_wrapper
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='InterfaceSpecificationMessage.proto',
+ package='android.vts',
+ serialized_pb='\n#InterfaceSpecificationMessage.proto\x12\x0b\x61ndroid.vts\"e\n\x1c\x43\x61llFlowSpecificationMessage\x12\x14\n\x05\x65ntry\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04\x65xit\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x0c\n\x04next\x18\x0b \x03(\x0c\x12\x0c\n\x04prev\x18\x0c \x03(\x0c\"\xec\x02\n\x1c\x46unctionSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12>\n\x0breturn_type\x18\x0b \x01(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x43\n\x10return_type_hidl\x18\x0c \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x36\n\x03\x61rg\x18\x15 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12;\n\x08\x63\x61llflow\x18\x1f \x03(\x0b\x32).android.vts.CallFlowSpecificationMessage\x12\x16\n\x0eprofiling_data\x18\x65 \x03(\x02\x12\x16\n\rcoverage_data\x18\xc9\x01 \x03(\r\x12\x14\n\x0bparent_path\x18\xad\x02 \x01(\x0c\"\xea\x02\n\x16ScalarDataValueMessage\x12\x0c\n\x04\x62ool\x18\x01 \x01(\x05\x12\x0e\n\x06int8_t\x18\x0b \x01(\x05\x12\x0f\n\x07uint8_t\x18\x0c \x01(\r\x12\x0c\n\x04\x63har\x18\r \x01(\x05\x12\r\n\x05uchar\x18\x0e \x01(\r\x12\x0f\n\x07int16_t\x18\x15 \x01(\x05\x12\x10\n\x08uint16_t\x18\x16 \x01(\r\x12\x0f\n\x07int32_t\x18\x1f \x01(\x05\x12\x10\n\x08uint32_t\x18 \x01(\r\x12\x0f\n\x07int64_t\x18) \x01(\x03\x12\x10\n\x08uint64_t\x18* \x01(\x04\x12\x0f\n\x07\x66loat_t\x18\x65 \x01(\x02\x12\x10\n\x08\x64ouble_t\x18\x66 \x01(\x01\x12\x10\n\x07pointer\x18\xc9\x01 \x01(\r\x12\x0f\n\x06opaque\x18\xca\x01 \x01(\r\x12\x15\n\x0cvoid_pointer\x18\xd3\x01 \x01(\r\x12\x15\n\x0c\x63har_pointer\x18\xd4\x01 \x01(\r\x12\x18\n\x0fpointer_pointer\x18\xfb\x01 \x01(\r\x12\r\n\x04\x62its\x18\xe9\x07 \x01(\r\"o\n\x16VectorDataValueMessage\x12\x0c\n\x04size\x18\x01 \x01(\r\x12\x13\n\x0bscalar_type\x18\x0b \x01(\x0c\x12\x32\n\x05value\x18\x0c \x03(\x0b\x32#.android.vts.ScalarDataValueMessage\"\xd1\x01\n#FunctionPointerSpecificationMessage\x12\x15\n\rfunction_name\x18\x01 \x01(\x0c\x12\x0f\n\x07\x61\x64\x64ress\x18\x0b \x01(\r\x12\n\n\x02id\x18\x15 \x01(\x0c\x12\x36\n\x03\x61rg\x18\x65 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12>\n\x0breturn_type\x18o \x01(\x0b\x32).android.vts.VariableSpecificationMessage\"9\n\x16StringDataValueMessage\x12\x0f\n\x07message\x18\x01 \x01(\x0c\x12\x0e\n\x06length\x18\x0b \x01(\r\"9\n\x14\x45numDataValueMessage\x12\x12\n\nenumerator\x18\x01 \x03(\x0c\x12\r\n\x05value\x18\x02 \x03(\r\"\xbe\x05\n\x1cVariableSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\'\n\x04type\x18\x02 \x01(\x0e\x32\x19.android.vts.VariableType\x12\x39\n\x0cscalar_value\x18\x65 \x01(\x0b\x32#.android.vts.ScalarDataValueMessage\x12\x13\n\x0bscalar_type\x18\x66 \x01(\x0c\x12\x39\n\x0cstring_value\x18o \x01(\x0b\x32#.android.vts.StringDataValueMessage\x12\x35\n\nenum_value\x18y \x01(\x0b\x32!.android.vts.EnumDataValueMessage\x12:\n\x0cvector_value\x18\x83\x01 \x03(\x0b\x32#.android.vts.VectorDataValueMessage\x12@\n\x0cstruct_value\x18\x8d\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x14\n\x0bstruct_type\x18\x8e\x01 \x01(\x0c\x12?\n\x0bunion_value\x18\x97\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x18\n\x0fpredefined_type\x18\xc9\x01 \x01(\x0c\x12K\n\x10\x66unction_pointer\x18\xdd\x01 \x03(\x0b\x32\x30.android.vts.FunctionPointerSpecificationMessage\x12\x17\n\x08is_input\x18\xad\x02 \x01(\x08:\x04true\x12\x19\n\tis_output\x18\xae\x02 \x01(\x08:\x05\x66\x61lse\x12\x18\n\x08is_const\x18\xaf\x02 \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0bis_callback\x18\xb0\x02 \x01(\x08:\x05\x66\x61lse\"\xfb\x01\n\x1aStructSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x19\n\nis_pointer\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x37\n\x03\x61pi\x18\xe9\x07 \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12<\n\nsub_struct\x18\xd1\x0f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage\x12=\n\tattribute\x18\xb9\x17 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\"\xd3\x03\n\x1dInterfaceSpecificationMessage\x12\x34\n\x0f\x63omponent_class\x18\x01 \x01(\x0e\x32\x1b.android.vts.ComponentClass\x12\x32\n\x0e\x63omponent_type\x18\x02 \x01(\x0e\x32\x1a.android.vts.ComponentType\x12!\n\x16\x63omponent_type_version\x18\x03 \x01(\x02:\x01\x31\x12\x16\n\x0e\x63omponent_name\x18\x04 \x01(\x0c\x12\x0f\n\x07package\x18\x0b \x01(\x0c\x12\x0e\n\x06import\x18\x0c \x03(\x0c\x12%\n\x1coriginal_data_structure_name\x18\xe9\x07 \x01(\x0c\x12\x0f\n\x06header\x18\xea\x07 \x03(\x0c\x12\x37\n\x03\x61pi\x18\xd1\x0f \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12=\n\tattribute\x18\xb9\x17 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12<\n\nsub_struct\x18\xa1\x1f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage*\x86\x01\n\x0e\x43omponentClass\x12\x11\n\rUNKNOWN_CLASS\x10\x00\x12\x14\n\x10HAL_CONVENTIONAL\x10\x01\x12\r\n\tSHAREDLIB\x10\x02\x12\x0c\n\x08HAL_HIDL\x10\x03\x12\x1e\n\x1aHAL_CONVENTIONAL_SUBMODULE\x10\x04\x12\x0e\n\nHAL_LEGACY\x10\x05*z\n\rComponentType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\n\n\x06\x43\x41MERA\x10\x02\x12\x07\n\x03GPS\x10\x03\x12\t\n\x05LIGHT\x10\x04\x12\x08\n\x04WIFI\x10\x05\x12\n\n\x06MOBILE\x10\x06\x12\r\n\tBLUETOOTH\x10\x07\x12\x07\n\x03NFC\x10\x08*\xdb\x01\n\x0cVariableType\x12\x19\n\x15UNKNOWN_VARIABLE_TYPE\x10\x00\x12\x13\n\x0fTYPE_PREDEFINED\x10\x01\x12\x0f\n\x0bTYPE_SCALAR\x10\x02\x12\x0f\n\x0bTYPE_STRING\x10\x03\x12\r\n\tTYPE_ENUM\x10\x04\x12\x15\n\x11TYPE_VECTOR_FIXED\x10\x05\x12\x18\n\x14TYPE_VECTOR_VARIABLE\x10\x06\x12\x0f\n\x0bTYPE_STRUCT\x10\x07\x12\x19\n\x15TYPE_FUNCTION_POINTER\x10\x08\x12\r\n\tTYPE_VOID\x10\t')
+
+_COMPONENTCLASS = _descriptor.EnumDescriptor(
+ name='ComponentClass',
+ full_name='android.vts.ComponentClass',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='UNKNOWN_CLASS', index=0, number=0,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='HAL_CONVENTIONAL', index=1, number=1,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='SHAREDLIB', index=2, number=2,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='HAL_HIDL', index=3, number=3,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='HAL_CONVENTIONAL_SUBMODULE', index=4, number=4,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='HAL_LEGACY', index=5, number=5,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=2760,
+ serialized_end=2894,
+)
+
+ComponentClass = enum_type_wrapper.EnumTypeWrapper(_COMPONENTCLASS)
+_COMPONENTTYPE = _descriptor.EnumDescriptor(
+ name='ComponentType',
+ full_name='android.vts.ComponentType',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='UNKNOWN_TYPE', index=0, number=0,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='AUDIO', index=1, number=1,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='CAMERA', index=2, number=2,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='GPS', index=3, number=3,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='LIGHT', index=4, number=4,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='WIFI', index=5, number=5,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='MOBILE', index=6, number=6,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='BLUETOOTH', index=7, number=7,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='NFC', index=8, number=8,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=2896,
+ serialized_end=3018,
+)
+
+ComponentType = enum_type_wrapper.EnumTypeWrapper(_COMPONENTTYPE)
+_VARIABLETYPE = _descriptor.EnumDescriptor(
+ name='VariableType',
+ full_name='android.vts.VariableType',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='UNKNOWN_VARIABLE_TYPE', index=0, number=0,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_PREDEFINED', index=1, number=1,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_SCALAR', index=2, number=2,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_STRING', index=3, number=3,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_ENUM', index=4, number=4,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_VECTOR_FIXED', index=5, number=5,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_VECTOR_VARIABLE', index=6, number=6,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_STRUCT', index=7, number=7,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_FUNCTION_POINTER', index=8, number=8,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_VOID', index=9, number=9,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=3021,
+ serialized_end=3240,
+)
+
+VariableType = enum_type_wrapper.EnumTypeWrapper(_VARIABLETYPE)
+UNKNOWN_CLASS = 0
+HAL_CONVENTIONAL = 1
+SHAREDLIB = 2
+HAL_HIDL = 3
+HAL_CONVENTIONAL_SUBMODULE = 4
+HAL_LEGACY = 5
+UNKNOWN_TYPE = 0
+AUDIO = 1
+CAMERA = 2
+GPS = 3
+LIGHT = 4
+WIFI = 5
+MOBILE = 6
+BLUETOOTH = 7
+NFC = 8
+UNKNOWN_VARIABLE_TYPE = 0
+TYPE_PREDEFINED = 1
+TYPE_SCALAR = 2
+TYPE_STRING = 3
+TYPE_ENUM = 4
+TYPE_VECTOR_FIXED = 5
+TYPE_VECTOR_VARIABLE = 6
+TYPE_STRUCT = 7
+TYPE_FUNCTION_POINTER = 8
+TYPE_VOID = 9
+
+
+
+_CALLFLOWSPECIFICATIONMESSAGE = _descriptor.Descriptor(
+ name='CallFlowSpecificationMessage',
+ full_name='android.vts.CallFlowSpecificationMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='entry', full_name='android.vts.CallFlowSpecificationMessage.entry', index=0,
+ number=1, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='exit', full_name='android.vts.CallFlowSpecificationMessage.exit', index=1,
+ number=2, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='next', full_name='android.vts.CallFlowSpecificationMessage.next', index=2,
+ number=11, type=12, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='prev', full_name='android.vts.CallFlowSpecificationMessage.prev', index=3,
+ number=12, type=12, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=52,
+ serialized_end=153,
+)
+
+
+_FUNCTIONSPECIFICATIONMESSAGE = _descriptor.Descriptor(
+ name='FunctionSpecificationMessage',
+ full_name='android.vts.FunctionSpecificationMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='name', full_name='android.vts.FunctionSpecificationMessage.name', index=0,
+ number=1, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='return_type', full_name='android.vts.FunctionSpecificationMessage.return_type', index=1,
+ number=11, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='return_type_hidl', full_name='android.vts.FunctionSpecificationMessage.return_type_hidl', index=2,
+ number=12, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='arg', full_name='android.vts.FunctionSpecificationMessage.arg', index=3,
+ number=21, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='callflow', full_name='android.vts.FunctionSpecificationMessage.callflow', index=4,
+ number=31, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='profiling_data', full_name='android.vts.FunctionSpecificationMessage.profiling_data', index=5,
+ number=101, type=2, cpp_type=6, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='coverage_data', full_name='android.vts.FunctionSpecificationMessage.coverage_data', index=6,
+ number=201, type=13, cpp_type=3, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='parent_path', full_name='android.vts.FunctionSpecificationMessage.parent_path', index=7,
+ number=301, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=156,
+ serialized_end=520,
+)
+
+
+_SCALARDATAVALUEMESSAGE = _descriptor.Descriptor(
+ name='ScalarDataValueMessage',
+ full_name='android.vts.ScalarDataValueMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='bool', full_name='android.vts.ScalarDataValueMessage.bool', index=0,
+ number=1, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='int8_t', full_name='android.vts.ScalarDataValueMessage.int8_t', index=1,
+ number=11, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='uint8_t', full_name='android.vts.ScalarDataValueMessage.uint8_t', index=2,
+ number=12, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='char', full_name='android.vts.ScalarDataValueMessage.char', index=3,
+ number=13, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='uchar', full_name='android.vts.ScalarDataValueMessage.uchar', index=4,
+ number=14, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='int16_t', full_name='android.vts.ScalarDataValueMessage.int16_t', index=5,
+ number=21, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='uint16_t', full_name='android.vts.ScalarDataValueMessage.uint16_t', index=6,
+ number=22, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='int32_t', full_name='android.vts.ScalarDataValueMessage.int32_t', index=7,
+ number=31, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='uint32_t', full_name='android.vts.ScalarDataValueMessage.uint32_t', index=8,
+ number=32, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='int64_t', full_name='android.vts.ScalarDataValueMessage.int64_t', index=9,
+ number=41, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='uint64_t', full_name='android.vts.ScalarDataValueMessage.uint64_t', index=10,
+ number=42, type=4, cpp_type=4, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='float_t', full_name='android.vts.ScalarDataValueMessage.float_t', index=11,
+ number=101, type=2, cpp_type=6, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='double_t', full_name='android.vts.ScalarDataValueMessage.double_t', index=12,
+ number=102, type=1, cpp_type=5, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='pointer', full_name='android.vts.ScalarDataValueMessage.pointer', index=13,
+ number=201, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='opaque', full_name='android.vts.ScalarDataValueMessage.opaque', index=14,
+ number=202, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='void_pointer', full_name='android.vts.ScalarDataValueMessage.void_pointer', index=15,
+ number=211, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='char_pointer', full_name='android.vts.ScalarDataValueMessage.char_pointer', index=16,
+ number=212, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='pointer_pointer', full_name='android.vts.ScalarDataValueMessage.pointer_pointer', index=17,
+ number=251, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='bits', full_name='android.vts.ScalarDataValueMessage.bits', index=18,
+ number=1001, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=523,
+ serialized_end=885,
+)
+
+
+_VECTORDATAVALUEMESSAGE = _descriptor.Descriptor(
+ name='VectorDataValueMessage',
+ full_name='android.vts.VectorDataValueMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='size', full_name='android.vts.VectorDataValueMessage.size', index=0,
+ number=1, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='scalar_type', full_name='android.vts.VectorDataValueMessage.scalar_type', index=1,
+ number=11, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='value', full_name='android.vts.VectorDataValueMessage.value', index=2,
+ number=12, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=887,
+ serialized_end=998,
+)
+
+
+_FUNCTIONPOINTERSPECIFICATIONMESSAGE = _descriptor.Descriptor(
+ name='FunctionPointerSpecificationMessage',
+ full_name='android.vts.FunctionPointerSpecificationMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='function_name', full_name='android.vts.FunctionPointerSpecificationMessage.function_name', index=0,
+ number=1, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='address', full_name='android.vts.FunctionPointerSpecificationMessage.address', index=1,
+ number=11, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='id', full_name='android.vts.FunctionPointerSpecificationMessage.id', index=2,
+ number=21, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='arg', full_name='android.vts.FunctionPointerSpecificationMessage.arg', index=3,
+ number=101, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='return_type', full_name='android.vts.FunctionPointerSpecificationMessage.return_type', index=4,
+ number=111, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=1001,
+ serialized_end=1210,
+)
+
+
+_STRINGDATAVALUEMESSAGE = _descriptor.Descriptor(
+ name='StringDataValueMessage',
+ full_name='android.vts.StringDataValueMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='message', full_name='android.vts.StringDataValueMessage.message', index=0,
+ number=1, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='length', full_name='android.vts.StringDataValueMessage.length', index=1,
+ number=11, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=1212,
+ serialized_end=1269,
+)
+
+
+_ENUMDATAVALUEMESSAGE = _descriptor.Descriptor(
+ name='EnumDataValueMessage',
+ full_name='android.vts.EnumDataValueMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='enumerator', full_name='android.vts.EnumDataValueMessage.enumerator', index=0,
+ number=1, type=12, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='value', full_name='android.vts.EnumDataValueMessage.value', index=1,
+ number=2, type=13, cpp_type=3, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=1271,
+ serialized_end=1328,
+)
+
+
+_VARIABLESPECIFICATIONMESSAGE = _descriptor.Descriptor(
+ name='VariableSpecificationMessage',
+ full_name='android.vts.VariableSpecificationMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='name', full_name='android.vts.VariableSpecificationMessage.name', index=0,
+ number=1, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='type', full_name='android.vts.VariableSpecificationMessage.type', index=1,
+ number=2, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='scalar_value', full_name='android.vts.VariableSpecificationMessage.scalar_value', index=2,
+ number=101, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='scalar_type', full_name='android.vts.VariableSpecificationMessage.scalar_type', index=3,
+ number=102, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='string_value', full_name='android.vts.VariableSpecificationMessage.string_value', index=4,
+ number=111, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='enum_value', full_name='android.vts.VariableSpecificationMessage.enum_value', index=5,
+ number=121, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='vector_value', full_name='android.vts.VariableSpecificationMessage.vector_value', index=6,
+ number=131, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='struct_value', full_name='android.vts.VariableSpecificationMessage.struct_value', index=7,
+ number=141, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='struct_type', full_name='android.vts.VariableSpecificationMessage.struct_type', index=8,
+ number=142, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='union_value', full_name='android.vts.VariableSpecificationMessage.union_value', index=9,
+ number=151, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='predefined_type', full_name='android.vts.VariableSpecificationMessage.predefined_type', index=10,
+ number=201, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='function_pointer', full_name='android.vts.VariableSpecificationMessage.function_pointer', index=11,
+ number=221, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='is_input', full_name='android.vts.VariableSpecificationMessage.is_input', index=12,
+ number=301, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=True,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='is_output', full_name='android.vts.VariableSpecificationMessage.is_output', index=13,
+ number=302, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='is_const', full_name='android.vts.VariableSpecificationMessage.is_const', index=14,
+ number=303, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='is_callback', full_name='android.vts.VariableSpecificationMessage.is_callback', index=15,
+ number=304, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=1331,
+ serialized_end=2033,
+)
+
+
+_STRUCTSPECIFICATIONMESSAGE = _descriptor.Descriptor(
+ name='StructSpecificationMessage',
+ full_name='android.vts.StructSpecificationMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='name', full_name='android.vts.StructSpecificationMessage.name', index=0,
+ number=1, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='is_pointer', full_name='android.vts.StructSpecificationMessage.is_pointer', index=1,
+ number=2, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='api', full_name='android.vts.StructSpecificationMessage.api', index=2,
+ number=1001, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='sub_struct', full_name='android.vts.StructSpecificationMessage.sub_struct', index=3,
+ number=2001, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='attribute', full_name='android.vts.StructSpecificationMessage.attribute', index=4,
+ number=3001, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=2036,
+ serialized_end=2287,
+)
+
+
+_INTERFACESPECIFICATIONMESSAGE = _descriptor.Descriptor(
+ name='InterfaceSpecificationMessage',
+ full_name='android.vts.InterfaceSpecificationMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='component_class', full_name='android.vts.InterfaceSpecificationMessage.component_class', index=0,
+ number=1, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='component_type', full_name='android.vts.InterfaceSpecificationMessage.component_type', index=1,
+ number=2, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='component_type_version', full_name='android.vts.InterfaceSpecificationMessage.component_type_version', index=2,
+ number=3, type=2, cpp_type=6, label=1,
+ has_default_value=True, default_value=1,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='component_name', full_name='android.vts.InterfaceSpecificationMessage.component_name', index=3,
+ number=4, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='package', full_name='android.vts.InterfaceSpecificationMessage.package', index=4,
+ number=11, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='import', full_name='android.vts.InterfaceSpecificationMessage.import', index=5,
+ number=12, type=12, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='original_data_structure_name', full_name='android.vts.InterfaceSpecificationMessage.original_data_structure_name', index=6,
+ number=1001, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='header', full_name='android.vts.InterfaceSpecificationMessage.header', index=7,
+ number=1002, type=12, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='api', full_name='android.vts.InterfaceSpecificationMessage.api', index=8,
+ number=2001, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='attribute', full_name='android.vts.InterfaceSpecificationMessage.attribute', index=9,
+ number=3001, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='sub_struct', full_name='android.vts.InterfaceSpecificationMessage.sub_struct', index=10,
+ number=4001, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=2290,
+ serialized_end=2757,
+)
+
+_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['return_type'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['return_type_hidl'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['arg'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['callflow'].message_type = _CALLFLOWSPECIFICATIONMESSAGE
+_VECTORDATAVALUEMESSAGE.fields_by_name['value'].message_type = _SCALARDATAVALUEMESSAGE
+_FUNCTIONPOINTERSPECIFICATIONMESSAGE.fields_by_name['arg'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_FUNCTIONPOINTERSPECIFICATIONMESSAGE.fields_by_name['return_type'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['type'].enum_type = _VARIABLETYPE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['scalar_value'].message_type = _SCALARDATAVALUEMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['string_value'].message_type = _STRINGDATAVALUEMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['enum_value'].message_type = _ENUMDATAVALUEMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['vector_value'].message_type = _VECTORDATAVALUEMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['struct_value'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['union_value'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_VARIABLESPECIFICATIONMESSAGE.fields_by_name['function_pointer'].message_type = _FUNCTIONPOINTERSPECIFICATIONMESSAGE
+_STRUCTSPECIFICATIONMESSAGE.fields_by_name['api'].message_type = _FUNCTIONSPECIFICATIONMESSAGE
+_STRUCTSPECIFICATIONMESSAGE.fields_by_name['sub_struct'].message_type = _STRUCTSPECIFICATIONMESSAGE
+_STRUCTSPECIFICATIONMESSAGE.fields_by_name['attribute'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_INTERFACESPECIFICATIONMESSAGE.fields_by_name['component_class'].enum_type = _COMPONENTCLASS
+_INTERFACESPECIFICATIONMESSAGE.fields_by_name['component_type'].enum_type = _COMPONENTTYPE
+_INTERFACESPECIFICATIONMESSAGE.fields_by_name['api'].message_type = _FUNCTIONSPECIFICATIONMESSAGE
+_INTERFACESPECIFICATIONMESSAGE.fields_by_name['attribute'].message_type = _VARIABLESPECIFICATIONMESSAGE
+_INTERFACESPECIFICATIONMESSAGE.fields_by_name['sub_struct'].message_type = _STRUCTSPECIFICATIONMESSAGE
+DESCRIPTOR.message_types_by_name['CallFlowSpecificationMessage'] = _CALLFLOWSPECIFICATIONMESSAGE
+DESCRIPTOR.message_types_by_name['FunctionSpecificationMessage'] = _FUNCTIONSPECIFICATIONMESSAGE
+DESCRIPTOR.message_types_by_name['ScalarDataValueMessage'] = _SCALARDATAVALUEMESSAGE
+DESCRIPTOR.message_types_by_name['VectorDataValueMessage'] = _VECTORDATAVALUEMESSAGE
+DESCRIPTOR.message_types_by_name['FunctionPointerSpecificationMessage'] = _FUNCTIONPOINTERSPECIFICATIONMESSAGE
+DESCRIPTOR.message_types_by_name['StringDataValueMessage'] = _STRINGDATAVALUEMESSAGE
+DESCRIPTOR.message_types_by_name['EnumDataValueMessage'] = _ENUMDATAVALUEMESSAGE
+DESCRIPTOR.message_types_by_name['VariableSpecificationMessage'] = _VARIABLESPECIFICATIONMESSAGE
+DESCRIPTOR.message_types_by_name['StructSpecificationMessage'] = _STRUCTSPECIFICATIONMESSAGE
+DESCRIPTOR.message_types_by_name['InterfaceSpecificationMessage'] = _INTERFACESPECIFICATIONMESSAGE
+
+class CallFlowSpecificationMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _CALLFLOWSPECIFICATIONMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.CallFlowSpecificationMessage)
+
+class FunctionSpecificationMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _FUNCTIONSPECIFICATIONMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.FunctionSpecificationMessage)
+
+class ScalarDataValueMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _SCALARDATAVALUEMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.ScalarDataValueMessage)
+
+class VectorDataValueMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _VECTORDATAVALUEMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.VectorDataValueMessage)
+
+class FunctionPointerSpecificationMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _FUNCTIONPOINTERSPECIFICATIONMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.FunctionPointerSpecificationMessage)
+
+class StringDataValueMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _STRINGDATAVALUEMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.StringDataValueMessage)
+
+class EnumDataValueMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _ENUMDATAVALUEMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.EnumDataValueMessage)
+
+class VariableSpecificationMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _VARIABLESPECIFICATIONMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.VariableSpecificationMessage)
+
+class StructSpecificationMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _STRUCTSPECIFICATIONMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.StructSpecificationMessage)
+
+class InterfaceSpecificationMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _INTERFACESPECIFICATIONMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.InterfaceSpecificationMessage)
+
+
+# @@protoc_insertion_point(module_scope)
diff --git a/runners/host/proto/__init__.py b/proto/__init__.py
similarity index 100%
rename from runners/host/proto/__init__.py
rename to proto/__init__.py
diff --git a/runners/host/proto/InterfaceSpecificationMessage.proto b/runners/host/proto/InterfaceSpecificationMessage.proto
deleted file mode 100644
index addde1e..0000000
--- a/runners/host/proto/InterfaceSpecificationMessage.proto
+++ /dev/null
@@ -1,184 +0,0 @@
-// 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;
-
-
-// Class of a target component.
-enum ComponentClass {
- UNKNOWN_CLASS = 0;
- // For a HAL shared library.
- HAL_CONVENTIONAL = 1;
- // For a shared library which is not a HAL (e.g., standard library).
- SHAREDLIB = 2;
- // For a HAL which uses HIDL (HAL Interface Definition Language).
- HAL_HIDL = 3;
- // For a submodule of a shared library HAL .
- HAL_SUBMODULE = 4;
- // For the legacy HAL.
- HAL_LEGACY = 5;
-}
-
-
-// Type of a target component.
-enum ComponentType {
- UNKNOWN_TYPE = 0;
- // For an audio submodule.
- AUDIO = 1;
- // For a camera submodule.
- CAMERA = 2;
- // For a GPS submodule.
- GPS = 3;
- // For a Lights sensor submodule.
- LIGHT = 4;
- // For a WiFi submodule.
- WIFI = 5;
-}
-
-
-// To specify a call flow event.
-message CallFlowSpecificationMessage {
- // true if for a function call event.
- optional bool entry = 1 [default = false];
- // true if for an exit event from a function.
- optional bool exit = 2 [default = false];
- // a list of functions that can be called right after this event.
- repeated bytes next = 11;
- // a list of functions that can be called right before this event.
- repeated bytes prev = 12;
-}
-
-
-// To specify a function.
-message FunctionSpecificationMessage {
- // the function name.
- optional bytes name = 1;
-
- // data type of the return value (for legacy HALs and shared libraries).
- optional ArgumentSpecificationMessage return_type = 11;
-
- // data type of the return value (for HIDL HALs).
- repeated ArgumentSpecificationMessage return_type_hidl = 12;
-
- // a list of arguments.
- repeated ArgumentSpecificationMessage arg = 21;
-
- // a specification of the call flows of the function.
- repeated CallFlowSpecificationMessage callflow = 31;
-
- // profiling data.
- repeated float profiling_data = 101;
-
- // coverage measurement data.
- repeated uint32 coverage_data = 201;
-
- // not a user-provided variable. used by the frameworks to tell the sub
- // struct hierarchy.
- optional bytes parent_path = 301;
-}
-
-
-message PrimitiveDataValueMessage {
- optional int32 int32_t = 1;
- optional uint32 uint32_t = 2;
- optional float float_t = 3;
- optional double double_t = 4;
- optional bytes bytes = 5;
- optional uint32 pointer = 6;
-
- optional int32 int8_t = 7;
- optional uint32 uint8_t = 8;
- optional int32 char = 9;
- optional int32 int16_t = 10;
- optional uint32 uint16_t = 11;
- optional int64 int64_t = 12;
- optional uint64 uint64_t = 13;
- optional bytes string = 14;
-}
-
-
-// To specify a function argument.
-message ArgumentSpecificationMessage {
- // Data type of the argument to describe the corresponding C/C++ data type.
- // only one is set if the argument is a primitive data.
- repeated bytes primitive_type = 1;
- // Instance type of the argument to describe the semantic information.
- repeated bytes aggregate_type = 2;
-
- // true if the argument is an input (valid only for the top-level message).
- optional bool is_input = 11 [default = true];
- // true if the argument is an output.
- optional bool is_output = 12 [default = false];
- // true if the argument is a constant variable.
- optional bool is_const = 13 [default = false];
- // true if the argument is a struct with one or multiple function pointers.
- optional bool is_callback = 14 [default = false];
-
- // the actual values.
- repeated PrimitiveDataValueMessage primitive_value = 21;
- // the actual value(s) for an aggregated data type.
- repeated ArgumentSpecificationMessage aggregate_value = 22;
-
- // the variable names of defined primitive type attributes.
- repeated bytes primitive_name = 31;
- // the variable names of defined aggregate type attributes.
- repeated bytes aggregate_name = 32;
-
- // the format string for the args if primitive_type is "function_pointer".
- repeated bytes primitive_format = 33;
-}
-
-
-// TO specify a sub-structure.
-message StructSpecificationMessage {
- // the sub-structure's variable name in its parent data structure.
- optional bytes name = 1;
-
- // whether itself a pointer varaible in its parent data structure.
- optional bool is_pointer = 2 [default = false];
-
- // a list of functions contained in the struct.
- repeated FunctionSpecificationMessage api = 1001;
-
- // a list of structures contained in the component.
- repeated StructSpecificationMessage sub_struct = 2001;
-}
-
-
-// To specify an interface of a component
-message InterfaceSpecificationMessage {
- // Class, type, and version of a target component.
- optional ComponentClass component_class = 1;
- optional ComponentType component_type = 2;
- optional float component_type_version = 3 [default = 1.0];
-
- // The name of original C/C++ data structure.
- optional bytes original_data_structure_name = 1001;
-
- // a list of headers that need to be imported in order to use the component.
- repeated bytes header = 1002;
-
- // a list of functions exposed by the component.
- repeated FunctionSpecificationMessage api = 2001;
-
- // the names of custom-defined aggregate types.
- repeated bytes aggregate_type_name = 3001;
- // The actual definitions of custom-defined aggregate types.
- repeated ArgumentSpecificationMessage aggregate_type_definition = 3002;
-
- // a list of structures contained in the component.
- repeated StructSpecificationMessage sub_struct = 4001;
-}
diff --git a/runners/host/proto/InterfaceSpecificationMessage_pb2.py b/runners/host/proto/InterfaceSpecificationMessage_pb2.py
deleted file mode 100644
index da7f730..0000000
--- a/runners/host/proto/InterfaceSpecificationMessage_pb2.py
+++ /dev/null
@@ -1,642 +0,0 @@
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: InterfaceSpecificationMessage.proto
-
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='InterfaceSpecificationMessage.proto',
- package='android.vts',
- serialized_pb='\n#InterfaceSpecificationMessage.proto\x12\x0b\x61ndroid.vts\"e\n\x1c\x43\x61llFlowSpecificationMessage\x12\x14\n\x05\x65ntry\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04\x65xit\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x0c\n\x04next\x18\x0b \x03(\x0c\x12\x0c\n\x04prev\x18\x0c \x03(\x0c\"\xec\x02\n\x1c\x46unctionSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12>\n\x0breturn_type\x18\x0b \x01(\x0b\x32).android.vts.ArgumentSpecificationMessage\x12\x43\n\x10return_type_hidl\x18\x0c \x03(\x0b\x32).android.vts.ArgumentSpecificationMessage\x12\x36\n\x03\x61rg\x18\x15 \x03(\x0b\x32).android.vts.ArgumentSpecificationMessage\x12;\n\x08\x63\x61llflow\x18\x1f \x03(\x0b\x32).android.vts.CallFlowSpecificationMessage\x12\x16\n\x0eprofiling_data\x18\x65 \x03(\x02\x12\x16\n\rcoverage_data\x18\xc9\x01 \x03(\r\x12\x14\n\x0bparent_path\x18\xad\x02 \x01(\x0c\"\x86\x02\n\x19PrimitiveDataValueMessage\x12\x0f\n\x07int32_t\x18\x01 \x01(\x05\x12\x10\n\x08uint32_t\x18\x02 \x01(\r\x12\x0f\n\x07\x66loat_t\x18\x03 \x01(\x02\x12\x10\n\x08\x64ouble_t\x18\x04 \x01(\x01\x12\r\n\x05\x62ytes\x18\x05 \x01(\x0c\x12\x0f\n\x07pointer\x18\x06 \x01(\r\x12\x0e\n\x06int8_t\x18\x07 \x01(\x05\x12\x0f\n\x07uint8_t\x18\x08 \x01(\r\x12\x0c\n\x04\x63har\x18\t \x01(\x05\x12\x0f\n\x07int16_t\x18\n \x01(\x05\x12\x10\n\x08uint16_t\x18\x0b \x01(\r\x12\x0f\n\x07int64_t\x18\x0c \x01(\x03\x12\x10\n\x08uint64_t\x18\r \x01(\x04\x12\x0e\n\x06string\x18\x0e \x01(\x0c\"\x84\x03\n\x1c\x41rgumentSpecificationMessage\x12\x16\n\x0eprimitive_type\x18\x01 \x03(\x0c\x12\x16\n\x0e\x61ggregate_type\x18\x02 \x03(\x0c\x12\x16\n\x08is_input\x18\x0b \x01(\x08:\x04true\x12\x18\n\tis_output\x18\x0c \x01(\x08:\x05\x66\x61lse\x12\x17\n\x08is_const\x18\r \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0bis_callback\x18\x0e \x01(\x08:\x05\x66\x61lse\x12?\n\x0fprimitive_value\x18\x15 \x03(\x0b\x32&.android.vts.PrimitiveDataValueMessage\x12\x42\n\x0f\x61ggregate_value\x18\x16 \x03(\x0b\x32).android.vts.ArgumentSpecificationMessage\x12\x16\n\x0eprimitive_name\x18\x1f \x03(\x0c\x12\x16\n\x0e\x61ggregate_name\x18 \x03(\x0c\x12\x18\n\x10primitive_format\x18! \x03(\x0c\"\xbc\x01\n\x1aStructSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x19\n\nis_pointer\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x37\n\x03\x61pi\x18\xe9\x07 \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12<\n\nsub_struct\x18\xd1\x0f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage\"\xc8\x03\n\x1dInterfaceSpecificationMessage\x12\x34\n\x0f\x63omponent_class\x18\x01 \x01(\x0e\x32\x1b.android.vts.ComponentClass\x12\x32\n\x0e\x63omponent_type\x18\x02 \x01(\x0e\x32\x1a.android.vts.ComponentType\x12!\n\x16\x63omponent_type_version\x18\x03 \x01(\x02:\x01\x31\x12%\n\x1coriginal_data_structure_name\x18\xe9\x07 \x01(\x0c\x12\x0f\n\x06header\x18\xea\x07 \x03(\x0c\x12\x37\n\x03\x61pi\x18\xd1\x0f \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12\x1c\n\x13\x61ggregate_type_name\x18\xb9\x17 \x03(\x0c\x12M\n\x19\x61ggregate_type_definition\x18\xba\x17 \x03(\x0b\x32).android.vts.ArgumentSpecificationMessage\x12<\n\nsub_struct\x18\xa1\x1f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage*y\n\x0e\x43omponentClass\x12\x11\n\rUNKNOWN_CLASS\x10\x00\x12\x14\n\x10HAL_CONVENTIONAL\x10\x01\x12\r\n\tSHAREDLIB\x10\x02\x12\x0c\n\x08HAL_HIDL\x10\x03\x12\x11\n\rHAL_SUBMODULE\x10\x04\x12\x0e\n\nHAL_LEGACY\x10\x05*V\n\rComponentType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\n\n\x06\x43\x41MERA\x10\x02\x12\x07\n\x03GPS\x10\x03\x12\t\n\x05LIGHT\x10\x04\x12\x08\n\x04WIFI\x10\x05')
-
-_COMPONENTCLASS = _descriptor.EnumDescriptor(
- name='ComponentClass',
- full_name='android.vts.ComponentClass',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='UNKNOWN_CLASS', index=0, number=0,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='HAL_CONVENTIONAL', index=1, number=1,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='SHAREDLIB', index=2, number=2,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='HAL_HIDL', index=3, number=3,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='HAL_SUBMODULE', index=4, number=4,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='HAL_LEGACY', index=5, number=5,
- options=None,
- type=None),
- ],
- containing_type=None,
- options=None,
- serialized_start=1828,
- serialized_end=1949,
-)
-
-ComponentClass = enum_type_wrapper.EnumTypeWrapper(_COMPONENTCLASS)
-_COMPONENTTYPE = _descriptor.EnumDescriptor(
- name='ComponentType',
- full_name='android.vts.ComponentType',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='UNKNOWN_TYPE', index=0, number=0,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='AUDIO', index=1, number=1,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='CAMERA', index=2, number=2,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='GPS', index=3, number=3,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='LIGHT', index=4, number=4,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='WIFI', index=5, number=5,
- options=None,
- type=None),
- ],
- containing_type=None,
- options=None,
- serialized_start=1951,
- serialized_end=2037,
-)
-
-ComponentType = enum_type_wrapper.EnumTypeWrapper(_COMPONENTTYPE)
-UNKNOWN_CLASS = 0
-HAL_CONVENTIONAL = 1
-SHAREDLIB = 2
-HAL_HIDL = 3
-HAL_SUBMODULE = 4
-HAL_LEGACY = 5
-UNKNOWN_TYPE = 0
-AUDIO = 1
-CAMERA = 2
-GPS = 3
-LIGHT = 4
-WIFI = 5
-
-
-
-_CALLFLOWSPECIFICATIONMESSAGE = _descriptor.Descriptor(
- name='CallFlowSpecificationMessage',
- full_name='android.vts.CallFlowSpecificationMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='entry', full_name='android.vts.CallFlowSpecificationMessage.entry', index=0,
- number=1, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='exit', full_name='android.vts.CallFlowSpecificationMessage.exit', index=1,
- number=2, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='next', full_name='android.vts.CallFlowSpecificationMessage.next', index=2,
- number=11, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='prev', full_name='android.vts.CallFlowSpecificationMessage.prev', index=3,
- number=12, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=52,
- serialized_end=153,
-)
-
-
-_FUNCTIONSPECIFICATIONMESSAGE = _descriptor.Descriptor(
- name='FunctionSpecificationMessage',
- full_name='android.vts.FunctionSpecificationMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='name', full_name='android.vts.FunctionSpecificationMessage.name', index=0,
- number=1, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='return_type', full_name='android.vts.FunctionSpecificationMessage.return_type', index=1,
- number=11, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='return_type_hidl', full_name='android.vts.FunctionSpecificationMessage.return_type_hidl', index=2,
- number=12, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='arg', full_name='android.vts.FunctionSpecificationMessage.arg', index=3,
- number=21, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='callflow', full_name='android.vts.FunctionSpecificationMessage.callflow', index=4,
- number=31, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='profiling_data', full_name='android.vts.FunctionSpecificationMessage.profiling_data', index=5,
- number=101, type=2, cpp_type=6, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='coverage_data', full_name='android.vts.FunctionSpecificationMessage.coverage_data', index=6,
- number=201, type=13, cpp_type=3, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='parent_path', full_name='android.vts.FunctionSpecificationMessage.parent_path', index=7,
- number=301, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=156,
- serialized_end=520,
-)
-
-
-_PRIMITIVEDATAVALUEMESSAGE = _descriptor.Descriptor(
- name='PrimitiveDataValueMessage',
- full_name='android.vts.PrimitiveDataValueMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='int32_t', full_name='android.vts.PrimitiveDataValueMessage.int32_t', index=0,
- number=1, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='uint32_t', full_name='android.vts.PrimitiveDataValueMessage.uint32_t', index=1,
- number=2, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='float_t', full_name='android.vts.PrimitiveDataValueMessage.float_t', index=2,
- number=3, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='double_t', full_name='android.vts.PrimitiveDataValueMessage.double_t', index=3,
- number=4, type=1, cpp_type=5, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='bytes', full_name='android.vts.PrimitiveDataValueMessage.bytes', index=4,
- number=5, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='pointer', full_name='android.vts.PrimitiveDataValueMessage.pointer', index=5,
- number=6, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='int8_t', full_name='android.vts.PrimitiveDataValueMessage.int8_t', index=6,
- number=7, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='uint8_t', full_name='android.vts.PrimitiveDataValueMessage.uint8_t', index=7,
- number=8, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='char', full_name='android.vts.PrimitiveDataValueMessage.char', index=8,
- number=9, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='int16_t', full_name='android.vts.PrimitiveDataValueMessage.int16_t', index=9,
- number=10, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='uint16_t', full_name='android.vts.PrimitiveDataValueMessage.uint16_t', index=10,
- number=11, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='int64_t', full_name='android.vts.PrimitiveDataValueMessage.int64_t', index=11,
- number=12, type=3, cpp_type=2, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='uint64_t', full_name='android.vts.PrimitiveDataValueMessage.uint64_t', index=12,
- number=13, type=4, cpp_type=4, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='string', full_name='android.vts.PrimitiveDataValueMessage.string', index=13,
- number=14, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=523,
- serialized_end=785,
-)
-
-
-_ARGUMENTSPECIFICATIONMESSAGE = _descriptor.Descriptor(
- name='ArgumentSpecificationMessage',
- full_name='android.vts.ArgumentSpecificationMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='primitive_type', full_name='android.vts.ArgumentSpecificationMessage.primitive_type', index=0,
- number=1, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='aggregate_type', full_name='android.vts.ArgumentSpecificationMessage.aggregate_type', index=1,
- number=2, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='is_input', full_name='android.vts.ArgumentSpecificationMessage.is_input', index=2,
- number=11, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=True,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='is_output', full_name='android.vts.ArgumentSpecificationMessage.is_output', index=3,
- number=12, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='is_const', full_name='android.vts.ArgumentSpecificationMessage.is_const', index=4,
- number=13, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='is_callback', full_name='android.vts.ArgumentSpecificationMessage.is_callback', index=5,
- number=14, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='primitive_value', full_name='android.vts.ArgumentSpecificationMessage.primitive_value', index=6,
- number=21, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='aggregate_value', full_name='android.vts.ArgumentSpecificationMessage.aggregate_value', index=7,
- number=22, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='primitive_name', full_name='android.vts.ArgumentSpecificationMessage.primitive_name', index=8,
- number=31, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='aggregate_name', full_name='android.vts.ArgumentSpecificationMessage.aggregate_name', index=9,
- number=32, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='primitive_format', full_name='android.vts.ArgumentSpecificationMessage.primitive_format', index=10,
- number=33, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=788,
- serialized_end=1176,
-)
-
-
-_STRUCTSPECIFICATIONMESSAGE = _descriptor.Descriptor(
- name='StructSpecificationMessage',
- full_name='android.vts.StructSpecificationMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='name', full_name='android.vts.StructSpecificationMessage.name', index=0,
- number=1, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='is_pointer', full_name='android.vts.StructSpecificationMessage.is_pointer', index=1,
- number=2, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='api', full_name='android.vts.StructSpecificationMessage.api', index=2,
- number=1001, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='sub_struct', full_name='android.vts.StructSpecificationMessage.sub_struct', index=3,
- number=2001, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=1179,
- serialized_end=1367,
-)
-
-
-_INTERFACESPECIFICATIONMESSAGE = _descriptor.Descriptor(
- name='InterfaceSpecificationMessage',
- full_name='android.vts.InterfaceSpecificationMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='component_class', full_name='android.vts.InterfaceSpecificationMessage.component_class', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='component_type', full_name='android.vts.InterfaceSpecificationMessage.component_type', index=1,
- number=2, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='component_type_version', full_name='android.vts.InterfaceSpecificationMessage.component_type_version', index=2,
- number=3, type=2, cpp_type=6, label=1,
- has_default_value=True, default_value=1,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='original_data_structure_name', full_name='android.vts.InterfaceSpecificationMessage.original_data_structure_name', index=3,
- number=1001, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='header', full_name='android.vts.InterfaceSpecificationMessage.header', index=4,
- number=1002, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='api', full_name='android.vts.InterfaceSpecificationMessage.api', index=5,
- number=2001, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='aggregate_type_name', full_name='android.vts.InterfaceSpecificationMessage.aggregate_type_name', index=6,
- number=3001, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='aggregate_type_definition', full_name='android.vts.InterfaceSpecificationMessage.aggregate_type_definition', index=7,
- number=3002, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='sub_struct', full_name='android.vts.InterfaceSpecificationMessage.sub_struct', index=8,
- number=4001, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=1370,
- serialized_end=1826,
-)
-
-_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['return_type'].message_type = _ARGUMENTSPECIFICATIONMESSAGE
-_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['return_type_hidl'].message_type = _ARGUMENTSPECIFICATIONMESSAGE
-_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['arg'].message_type = _ARGUMENTSPECIFICATIONMESSAGE
-_FUNCTIONSPECIFICATIONMESSAGE.fields_by_name['callflow'].message_type = _CALLFLOWSPECIFICATIONMESSAGE
-_ARGUMENTSPECIFICATIONMESSAGE.fields_by_name['primitive_value'].message_type = _PRIMITIVEDATAVALUEMESSAGE
-_ARGUMENTSPECIFICATIONMESSAGE.fields_by_name['aggregate_value'].message_type = _ARGUMENTSPECIFICATIONMESSAGE
-_STRUCTSPECIFICATIONMESSAGE.fields_by_name['api'].message_type = _FUNCTIONSPECIFICATIONMESSAGE
-_STRUCTSPECIFICATIONMESSAGE.fields_by_name['sub_struct'].message_type = _STRUCTSPECIFICATIONMESSAGE
-_INTERFACESPECIFICATIONMESSAGE.fields_by_name['component_class'].enum_type = _COMPONENTCLASS
-_INTERFACESPECIFICATIONMESSAGE.fields_by_name['component_type'].enum_type = _COMPONENTTYPE
-_INTERFACESPECIFICATIONMESSAGE.fields_by_name['api'].message_type = _FUNCTIONSPECIFICATIONMESSAGE
-_INTERFACESPECIFICATIONMESSAGE.fields_by_name['aggregate_type_definition'].message_type = _ARGUMENTSPECIFICATIONMESSAGE
-_INTERFACESPECIFICATIONMESSAGE.fields_by_name['sub_struct'].message_type = _STRUCTSPECIFICATIONMESSAGE
-DESCRIPTOR.message_types_by_name['CallFlowSpecificationMessage'] = _CALLFLOWSPECIFICATIONMESSAGE
-DESCRIPTOR.message_types_by_name['FunctionSpecificationMessage'] = _FUNCTIONSPECIFICATIONMESSAGE
-DESCRIPTOR.message_types_by_name['PrimitiveDataValueMessage'] = _PRIMITIVEDATAVALUEMESSAGE
-DESCRIPTOR.message_types_by_name['ArgumentSpecificationMessage'] = _ARGUMENTSPECIFICATIONMESSAGE
-DESCRIPTOR.message_types_by_name['StructSpecificationMessage'] = _STRUCTSPECIFICATIONMESSAGE
-DESCRIPTOR.message_types_by_name['InterfaceSpecificationMessage'] = _INTERFACESPECIFICATIONMESSAGE
-
-class CallFlowSpecificationMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _CALLFLOWSPECIFICATIONMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.CallFlowSpecificationMessage)
-
-class FunctionSpecificationMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _FUNCTIONSPECIFICATIONMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.FunctionSpecificationMessage)
-
-class PrimitiveDataValueMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _PRIMITIVEDATAVALUEMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.PrimitiveDataValueMessage)
-
-class ArgumentSpecificationMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _ARGUMENTSPECIFICATIONMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.ArgumentSpecificationMessage)
-
-class StructSpecificationMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _STRUCTSPECIFICATIONMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.StructSpecificationMessage)
-
-class InterfaceSpecificationMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _INTERFACESPECIFICATIONMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.InterfaceSpecificationMessage)
-
-
-# @@protoc_insertion_point(module_scope)
diff --git a/runners/host/tcp_client/vts_tcp_client.py b/runners/host/tcp_client/vts_tcp_client.py
index 7fc6886..461cca6 100755
--- a/runners/host/tcp_client/vts_tcp_client.py
+++ b/runners/host/tcp_client/vts_tcp_client.py
@@ -21,8 +21,8 @@
import socket
from vts.runners.host import errors
-from vts.runners.host.proto import AndroidSystemControlMessage_pb2 as SysMsg_pb2
-from vts.runners.host.proto import InterfaceSpecificationMessage_pb2 as IfaceSpecMsg_pb2
+from vts.proto import AndroidSystemControlMessage_pb2 as SysMsg_pb2
+from vts.proto import InterfaceSpecificationMessage_pb2 as IfaceSpecMsg_pb2
from google.protobuf import text_format
diff --git a/runners/host/tcp_server/vts_tcp_server.py b/runners/host/tcp_server/vts_tcp_server.py
index 4f5534a..219ec0c 100644
--- a/runners/host/tcp_server/vts_tcp_server.py
+++ b/runners/host/tcp_server/vts_tcp_server.py
@@ -21,7 +21,7 @@
from vts.runners.host.errors import TcpServerCreationError
from vts.runners.host.errors import TcpServerShutdownError
-from vts.runners.host.proto import AndroidSystemControlMessage_pb2 as SysMsg_pb2
+from vts.proto import AndroidSystemControlMessage_pb2 as SysMsg_pb2
_functions = dict() # Dictionary to hold function pointers
diff --git a/runners/host/tcp_server/vts_tcp_server_test.py b/runners/host/tcp_server/vts_tcp_server_test.py
index aea1bac..74225d0 100644
--- a/runners/host/tcp_server/vts_tcp_server_test.py
+++ b/runners/host/tcp_server/vts_tcp_server_test.py
@@ -22,7 +22,7 @@
from vts.runners.host.errors import TcpServerConnectionError
from vts.runners.host.errors import ConnectionRefusedError
-from vts.runners.host.proto import AndroidSystemControlMessage_pb2 as SysMsg_pb2
+from vts.proto import AndroidSystemControlMessage_pb2 as SysMsg_pb2
from vts.runners.host.tcp_server import vts_tcp_server
HOST, PORT = "localhost", 0
diff --git a/runners/host/test_runner.py b/runners/host/test_runner.py
index 6e00a45..3ec6224 100644
--- a/runners/host/test_runner.py
+++ b/runners/host/test_runner.py
@@ -15,7 +15,6 @@
# limitations under the License.
from future import standard_library
-from __main__ import time
standard_library.install_aliases()
import copy
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
index 39acabe..9334eef 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
@@ -28,7 +28,7 @@
#include <string>
#include <vector>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "component_loader/DllLoader.h"
#include "utils/InterfaceSpecUtil.h"
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.h b/sysfuzzer/common/fuzz_tester/FuzzerBase.h
index dd68ce3..cd662b6 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.h
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.h
@@ -19,7 +19,7 @@
#include "component_loader/DllLoader.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.cpp b/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.cpp
index cab1ab4..22cd1cf 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.cpp
@@ -32,7 +32,7 @@
#include <string>
#include <vector>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "component_loader/DllLoader.h"
#include "utils/InterfaceSpecUtil.h"
@@ -51,28 +51,22 @@
FuzzerCallbackBase::~FuzzerCallbackBase() {}
-bool FuzzerCallbackBase::Register(const ArgumentSpecificationMessage& message) {
- cout << __func__ << " size = " << message.primitive_value_size() << endl;
+bool FuzzerCallbackBase::Register(const VariableSpecificationMessage& message) {
+ cout << __func__ << " type = " << message.type() << endl;
if (!message.is_callback()) {
cerr << __func__ << " ERROR: argument is not a callback." << endl;
return false;
}
- if (message.primitive_type_size() == 0
- || message.primitive_type_size() != message.primitive_value_size()
- || message.primitive_type_size() != message.primitive_name_size()) {
- cerr << __func__ << " ERROR: primitive fields inconsistent." << endl;
+ if (!message.has_type() || message.type() != TYPE_FUNCTION_POINTER) {
+ cerr << __func__ << " ERROR: inconsistent message." << endl;
return false;
}
- for (int i = 0; i < message.primitive_type_size(); i++) {
- if (message.primitive_type(i) != "function_pointer") {
- cerr << __func__ << " ERROR: non function pointer at " << i << endl;
- return false;
- }
- cout << __func__ << " map[" << message.primitive_name(i) << "] = "
- << message.primitive_value(i).bytes() << endl;
- id_map_[message.primitive_name(i)] = message.primitive_value(i).bytes();
+ for (const auto& func_pt : message.function_pointer()) {
+ cout << __func__ << " map[" << func_pt.function_name() << "] = "
+ << func_pt.id() << endl;
+ id_map_[func_pt.function_name()] = func_pt.id();
}
return true;
}
@@ -81,14 +75,14 @@
const char* FuzzerCallbackBase::GetCallbackID(const string& name) {
// TODO: handle when not found.
cout << __func__ << ":" << __LINE__ << " " << name << endl;
- cout << __func__ << ":" << __LINE__ << " returns " << id_map_[name].c_str()
- << endl;
+ cout << __func__ << ":" << __LINE__ << " returns '" << id_map_[name].c_str()
+ << "'" << endl;
return id_map_[name].c_str();
}
void FuzzerCallbackBase::RpcCallToAgent(const char* id, int agent_port) {
- cout << __func__ << ":" << __LINE__ << " " << id << endl;
+ cout << __func__ << ":" << __LINE__ << " id = '" << id << "'" << endl;
struct sockaddr_in serv_addr;
struct hostent* server;
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.h b/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.h
index ec144e0..f475b0d 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.h
+++ b/sysfuzzer/common/fuzz_tester/FuzzerCallbackBase.h
@@ -22,7 +22,7 @@
#include <map>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
@@ -35,7 +35,7 @@
FuzzerCallbackBase();
virtual ~FuzzerCallbackBase();
- static bool Register(const ArgumentSpecificationMessage& message);
+ static bool Register(const VariableSpecificationMessage& message);
protected:
static const char* GetCallbackID(const string& name);
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp b/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp
index c1fcb09..bc58bad 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp
@@ -25,7 +25,7 @@
#include "fuzz_tester/FuzzerBase.h"
#include "utils/InterfaceSpecUtil.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerWrapper.h b/sysfuzzer/common/fuzz_tester/FuzzerWrapper.h
index ead0e33..26e6550 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerWrapper.h
+++ b/sysfuzzer/common/fuzz_tester/FuzzerWrapper.h
@@ -20,7 +20,7 @@
#include "component_loader/DllLoader.h"
#include "fuzz_tester/FuzzerBase.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.cpp b/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.cpp
index 4f07b60..ebbed38 100644
--- a/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.cpp
+++ b/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.cpp
@@ -26,7 +26,7 @@
#include <google/protobuf/message.h>
#include <google/protobuf/text_format.h>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.h b/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.h
index 614331b..8ab0b68 100644
--- a/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.h
+++ b/sysfuzzer/common/specification_parser/InterfaceSpecificationParser.h
@@ -19,7 +19,7 @@
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp b/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp
index 59c39f0..b51980d 100644
--- a/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp
+++ b/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp
@@ -26,7 +26,7 @@
#include "fuzz_tester/FuzzerWrapper.h"
#include "specification_parser/InterfaceSpecificationParser.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include <google/protobuf/text_format.h>
namespace android {
@@ -65,7 +65,7 @@
if (message->component_type() == target_type
&& message->component_type_version() == target_version) {
if (submodule_name.length() > 0) {
- if (message->component_class() != HAL_SUBMODULE
+ if (message->component_class() != HAL_CONVENTIONAL_SUBMODULE
|| message->original_data_structure_name() != submodule_name) {
continue;
}
@@ -201,21 +201,23 @@
if (func_msg->name() == "#Open") {
cout << __func__ << ":" << __LINE__ << endl;
if (func_msg->arg().size() > 0) {
- cout << __func__ << " " << func_msg->arg(0).primitive_value(0).bytes().c_str() << endl;
+ cout << __func__ << " "
+ << func_msg->arg(0).string_value().message()
+ << endl;
func_fuzzer->OpenConventionalHal(
- func_msg->arg(0).primitive_value(0).bytes().c_str());
+ func_msg->arg(0).string_value().message().c_str());
} else {
cout << __func__ << " no arg" << endl;
func_fuzzer->OpenConventionalHal();
}
cout << __func__ << " opened" << endl;
// return the return value from open;
- if (func_msg->return_type().primitive_type().size() > 0) {
+ if (func_msg->return_type().has_type()) {
cout << __func__ << " return_type exists" << endl;
// TODO handle when the size > 1.
- if (!strcmp(func_msg->return_type().primitive_type(0).c_str(), "int32_t")) {
+ if (!strcmp(func_msg->return_type().scalar_type().c_str(), "int32_t")) {
cout << __func__ << " return_type is int32_t" << endl;
- func_msg->mutable_return_type()->mutable_primitive_value()->Add()->set_int32_t(0);
+ func_msg->mutable_return_type()->mutable_scalar_value()->set_int32_t(0);
cout << "result " << endl;
// todo handle more types;
string* output = new string();
@@ -248,12 +250,12 @@
}
}
- if (func_msg->return_type().aggregate_type().size() > 0) {
+ if (func_msg->return_type().type() == TYPE_PREDEFINED) {
// TODO: actually handle this case.
if (result != NULL) {
// loads that interface spec and enqueues all functions.
cout << __func__ << " return type: "
- << func_msg->return_type().aggregate_type(0) << endl;
+ << func_msg->return_type().type() << endl;
} else {
cout << __func__ << " return value = NULL" << endl;
}
@@ -261,10 +263,10 @@
string* output = new string();
google::protobuf::TextFormat::PrintToString(*func_msg, output);
return *output;
- } else if (func_msg->return_type().primitive_type().size() > 0) {
+ } else if (func_msg->return_type().type() == TYPE_SCALAR) {
// TODO handle when the size > 1.
- if (!strcmp(func_msg->return_type().primitive_type(0).c_str(), "int32_t")) {
- func_msg->mutable_return_type()->mutable_primitive_value()->Add()->set_int32_t(
+ if (!strcmp(func_msg->return_type().scalar_type().c_str(), "int32_t")) {
+ func_msg->mutable_return_type()->mutable_scalar_value()->set_int32_t(
*((int*)(&result)));
cout << "result " << endl;
// todo handle more types;
@@ -320,13 +322,13 @@
void* result;
cout << "Iteration " << (i + 1) << " Function " << func_msg->name() << endl;
func_fuzzer->Fuzz(func_msg, &result, agent_port_);
- if (func_msg->return_type().aggregate_type().size() > 0) {
+ if (func_msg->return_type().type() == TYPE_PREDEFINED) {
if (result != NULL) {
// loads that interface spec and enqueues all functions.
cout << __FUNCTION__ << " return type: "
- << func_msg->return_type().aggregate_type(0) << endl;
+ << func_msg->return_type().predefined_type() << endl;
// TODO: handle the case when size > 1
- string submodule_name = func_msg->return_type().aggregate_type(0);
+ string submodule_name = func_msg->return_type().predefined_type();
while (!submodule_name.empty()
&& (std::isspace(submodule_name.back())
|| submodule_name.back() == '*')) {
@@ -336,13 +338,15 @@
FindInterfaceSpecification(
target_class, target_type, target_version, submodule_name);
if (iface_spec_msg) {
- cout << __FUNCTION__ << " submodule found - " << submodule_name << endl;
+ cout << __FUNCTION__ << " submodule found - " << submodule_name
+ << endl;
if (!GetFuzzerBaseAndAddAllFunctionsToQueue(
*iface_spec_msg, dll_file_name)) {
return false;
}
} else {
- cout << __FUNCTION__ << " submodule not found - " << submodule_name << endl;
+ cout << __FUNCTION__ << " submodule not found - "
+ << submodule_name << endl;
}
} else {
cout << __FUNCTION__ << " return value = NULL" << endl;
diff --git a/sysfuzzer/common/specification_parser/SpecificationBuilder.h b/sysfuzzer/common/specification_parser/SpecificationBuilder.h
index 0c7aacf..acdea67 100644
--- a/sysfuzzer/common/specification_parser/SpecificationBuilder.h
+++ b/sysfuzzer/common/specification_parser/SpecificationBuilder.h
@@ -20,7 +20,7 @@
#include <queue>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "fuzz_tester/FuzzerWrapper.h"
diff --git a/sysfuzzer/common/utils/InterfaceSpecUtil.cpp b/sysfuzzer/common/utils/InterfaceSpecUtil.cpp
index 3e5e252..a3e1125 100644
--- a/sysfuzzer/common/utils/InterfaceSpecUtil.cpp
+++ b/sysfuzzer/common/utils/InterfaceSpecUtil.cpp
@@ -20,7 +20,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/common/utils/InterfaceSpecUtil.h b/sysfuzzer/common/utils/InterfaceSpecUtil.h
index ebe3642..6c469ef 100644
--- a/sysfuzzer/common/utils/InterfaceSpecUtil.h
+++ b/sysfuzzer/common/utils/InterfaceSpecUtil.h
@@ -19,7 +19,7 @@
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#define VTS_INTERFACE_SPECIFICATION_FUNCTION_NAME_PREFIX "vts_func_"
diff --git a/sysfuzzer/framework/BinderServer.cpp b/sysfuzzer/framework/BinderServer.cpp
index 30f4271..fb5027f 100644
--- a/sysfuzzer/framework/BinderServer.cpp
+++ b/sysfuzzer/framework/BinderServer.cpp
@@ -38,7 +38,7 @@
#include "specification_parser/SpecificationBuilder.h"
#include <google/protobuf/text_format.h>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/libdatatype/hal_camera.cpp b/sysfuzzer/libdatatype/hal_camera.cpp
index 2f83bd8..c6f21ae 100644
--- a/sysfuzzer/libdatatype/hal_camera.cpp
+++ b/sysfuzzer/libdatatype/hal_camera.cpp
@@ -25,7 +25,7 @@
#include <hardware/camera_common.h>
#include <hardware/camera.h>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "vts_datatype.h"
@@ -183,7 +183,7 @@
camera_info_t* GenerateCameraInfoUsingMessage(
- const ArgumentSpecificationMessage& msg) {
+ const VariableSpecificationMessage& msg) {
cout << __func__ << endl;
// TODO: acutally use msg.
camera_info_t* caminfo = (camera_info_t*) malloc(sizeof(camera_info_t));
@@ -201,30 +201,48 @@
bool ConvertCameraInfoToProtobuf(
- camera_info_t* raw, ArgumentSpecificationMessage* msg) {
+ camera_info_t* raw, VariableSpecificationMessage* msg) {
cout << __func__ << ":" << __LINE__ << endl;
- if (msg->primitive_value_size() > 0) msg->clear_primitive_value();
- if (msg->aggregate_value_size() > 0) msg->clear_aggregate_value();
+ if (msg->struct_value_size() > 0) msg->clear_struct_value();
- if (!raw) {
- return false;
- }
+ if (!raw) return false;
cout << __func__ << ":" << __LINE__ << endl;
// TODO: use primitive_name and put in the expected order.
- msg->add_primitive_value()->set_int32_t(raw->facing);
- msg->add_primitive_value()->set_int32_t(raw->orientation);
- cout << __func__ << ":" << __LINE__ << endl;
- msg->add_primitive_value()->set_uint32_t(raw->device_version);
+ msg->set_type(TYPE_STRUCT);
+
+ VariableSpecificationMessage* sub_msg;
+
+ sub_msg = msg->add_struct_value();
+ sub_msg->set_type(TYPE_SCALAR);
+ sub_msg->set_scalar_type("int32_t");
+ sub_msg->mutable_scalar_value()->set_int32_t(raw->facing);
+
+ sub_msg = msg->add_struct_value();
+ sub_msg->set_type(TYPE_SCALAR);
+ sub_msg->set_scalar_type("int32_t");
+ sub_msg->mutable_scalar_value()->set_int32_t(raw->orientation);
+
+ sub_msg = msg->add_struct_value();
+ sub_msg->set_type(TYPE_SCALAR);
+ sub_msg->set_scalar_type("uint32_t");
+ sub_msg->mutable_scalar_value()->set_uint32_t(raw->device_version);
+
// TODO: update for static_camera_characteristics and others
// msg.add_primitive_value()->set_int32_t(raw->static_camera_characteristics);
- msg->add_primitive_value()->set_int32_t(raw->resource_cost);
+ sub_msg = msg->add_struct_value();
+ sub_msg->set_type(TYPE_SCALAR);
+ sub_msg->set_scalar_type("int32_t");
+ sub_msg->mutable_scalar_value()->set_int32_t(raw->resource_cost);
+
// TODO: support pointer. conflicting_devices is pointer pointer.
// msg.add_primitive_value()->set_pointer(raw->conflicting_devices);
// msg.add_primitive_value()->set_int32_t(raw->conflicting_devices_length);
- msg->add_primitive_value()->set_int32_t(0);
- cout << __func__ << ":" << __LINE__ << endl;
+ sub_msg = msg->add_struct_value();
+ sub_msg->set_type(TYPE_SCALAR);
+ sub_msg->set_scalar_type("int32_t");
+ sub_msg->mutable_scalar_value()->set_int32_t(0);
return true;
}
diff --git a/sysfuzzer/libdatatype/hal_camera.h b/sysfuzzer/libdatatype/hal_camera.h
index 44ee55b..49d9305 100644
--- a/sysfuzzer/libdatatype/hal_camera.h
+++ b/sysfuzzer/libdatatype/hal_camera.h
@@ -21,7 +21,7 @@
#include <hardware/camera_common.h>
#include <hardware/camera.h>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
namespace android {
namespace vts {
@@ -46,11 +46,11 @@
// Generates a camera_info data structure using a given protobuf msg's values.
extern camera_info_t* GenerateCameraInfoUsingMessage(
- const ArgumentSpecificationMessage& msg);
+ const VariableSpecificationMessage& msg);
// Converts camera_info to a protobuf message.
extern bool ConvertCameraInfoToProtobuf(camera_info_t* raw,
- ArgumentSpecificationMessage* msg);
+ VariableSpecificationMessage* msg);
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/libdatatype/hal_light.cpp b/sysfuzzer/libdatatype/hal_light.cpp
index d3108ed..490dc28 100644
--- a/sysfuzzer/libdatatype/hal_light.cpp
+++ b/sysfuzzer/libdatatype/hal_light.cpp
@@ -22,7 +22,7 @@
#include <hardware/lights.h>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "vts_datatype.h"
@@ -57,21 +57,22 @@
}
-light_state_t* GenerateLightStateUsingMessage(const ArgumentSpecificationMessage& msg) {
+light_state_t* GenerateLightStateUsingMessage(
+ const VariableSpecificationMessage& msg) {
cout << __func__ << " entry" << endl;
light_state_t* state = (light_state_t*) malloc(sizeof(light_state_t));
// TODO: use a dict in the proto and handle when the key is missing (i.e.,
// randomly generate that).
- state->color = msg.primitive_value(0).uint32_t();
+ state->color = msg.struct_value(0).scalar_value().uint32_t();
cout << __func__ << " color " << state->color << endl;
- state->flashMode = msg.primitive_value(1).int32_t();
+ state->flashMode = msg.struct_value(1).scalar_value().int32_t();
cout << __func__ << " flashMode " << state->flashMode << endl;
- state->flashOnMS = msg.primitive_value(2).int32_t();
+ state->flashOnMS = msg.struct_value(2).scalar_value().int32_t();
cout << __func__ << " flashOnMS " << state->flashOnMS << endl;
- state->flashOffMS = msg.primitive_value(3).int32_t();
+ state->flashOffMS = msg.struct_value(3).scalar_value().int32_t();
cout << __func__ << " flashOffMS " << state->flashOffMS << endl;
- state->brightnessMode = msg.primitive_value(4).int32_t();
+ state->brightnessMode = msg.struct_value(4).scalar_value().int32_t();
cout << __func__ << " brightnessMode " << state->brightnessMode << endl;
return state;
diff --git a/sysfuzzer/libdatatype/hal_light.h b/sysfuzzer/libdatatype/hal_light.h
index 30c11d4..3f6e9dd 100644
--- a/sysfuzzer/libdatatype/hal_light.h
+++ b/sysfuzzer/libdatatype/hal_light.h
@@ -19,7 +19,7 @@
#include <hardware/lights.h>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
namespace android {
namespace vts {
@@ -28,7 +28,7 @@
light_state_t* GenerateLightState();
light_state_t* GenerateLightStateUsingMessage(
- const ArgumentSpecificationMessage& msg);
+ const VariableSpecificationMessage& msg);
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/libinterfacespecification/specification/CameraHalV2.vts b/sysfuzzer/libinterfacespecification/specification/CameraHalV2.vts
index dcf2d89..397c8a5 100644
--- a/sysfuzzer/libinterfacespecification/specification/CameraHalV2.vts
+++ b/sysfuzzer/libinterfacespecification/specification/CameraHalV2.vts
@@ -18,17 +18,21 @@
api: {
name: "open"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- aggregate_type: "hw_module_t*"
+ type: TYPE_PREDEFINED
+ predefined_type: "hw_module_t*"
is_const: true
}
arg: {
- primitive_type: "char_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "char_pointer"
}
arg: {
- aggregate_type: "hw_device_t**"
+ type: TYPE_PREDEFINED
+ predefined_type: "hw_device_t**"
is_output: true
}
callflow: {
@@ -41,121 +45,152 @@
api: {
name: "get_number_of_cameras"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "get_camera_info"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- aggregate_type: "camera_info_t*"
+ type: TYPE_PREDEFINED
+ predefined_type: "camera_info_t*"
is_output: true
is_input: false
}
}
+attribute: {
+ type: TYPE_ENUM
+ enum_value: {
+ enumerator: "CAMERA_FACING_BACK"
+ value: 0
-aggregate_type_name: "const"
-aggregate_type_definition: {
- primitive_type: "int32_t"
- primitive_name: "CAMERA_FACING_BACK"
- primitive_value: {
- int32_t: 0
- }
-
- primitive_type: "int32_t"
- primitive_name: "CAMERA_FACING_FRONT"
- primitive_value: {
- int32_t: 1
+ enumerator: "CAMERA_FACING_FRONT"
+ value: 1
}
}
-aggregate_type_name: "camera_info_t"
-aggregate_type_definition: {
- primitive_type: "int32_t"
- primitive_name: "facing"
- primitive_value: {
- int32_t: 0
- }
+attribute: {
+ type: TYPE_STRUCT
+ name: "camera_info_t"
- primitive_type: "int32_t"
- primitive_name: "orientation"
- primitive_value: {
- int32_t: 0
- }
-
- primitive_type: "uint32_t"
- primitive_name: "device_version"
- primitive_value: {
- uint32_t: 772
- }
-
- aggregate_type: "camera_metadata_t"
- aggregate_name: "static_camera_characteristics"
- aggregate_value: {
- primitive_type: "int32_t"
- primitive_name: "xyz"
- primitive_value: {
+ struct_value: {
+ name: "facing"
+ type: TYPE_SCALAR
+ scalar_value: {
int32_t: 0
}
+ scalar_type: "int32_t"
+ }
+
+ struct_value: {
+ name: "orientation"
+ type: TYPE_SCALAR
+ scalar_value: {
+ int32_t: 0
+ }
+ scalar_type: "int32_t"
+ }
+
+ struct_value: {
+ name: "device_version"
+ type: TYPE_SCALAR
+ scalar_value: {
+ uint32_t: 772
+ }
+ scalar_type: "uint32_t"
+ }
+
+ struct_value: {
+ name: "static_camera_characteristics"
+ struct_type: "camera_metadata_t"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "xyz"
+ scalar_type: "int32_t"
+ scalar_value: {
+ int32_t: 0
+ }
+ }
}
- primitive_type: "int32_t"
- primitive_name: "resource_cost"
- primitive_value: {
- int32_t: 50
+ struct_value: {
+ name: "resource_cost"
+ type: TYPE_SCALAR
+ scalar_value: {
+ int32_t: 50
+ }
+ scalar_type: "int32_t"
}
- primitive_type: "pointer_pointer"
- primitive_name: "conflicting_devices"
- primitive_value: {
+ struct_value: {
+ name: "conflicting_devices"
+ type: TYPE_SCALAR
+ scalar_type: "pointer_pointer"
}
- primitive_type: "int32_t"
- primitive_name: "conflicting_devices_length"
- primitive_value: {
- int32_t: 0
+ struct_value: {
+ name: "conflicting_devices_length"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ scalar_value: {
+ int32_t: 0
+ }
}
}
-aggregate_type_name: "camera_module_callbacks_t"
-aggregate_type_definition: {
- primitive_type: "function_pointer"
- primitive_name: "camera_device_status_change"
- primitive_value: {
- }
- primitive_format: "%p %d %d"
- aggregate_value: {
- primitive_type: "pointer"
- primitive_name: "const struct camera_module_callbacks*"
+attribute: {
+ name: "camera_module_callbacks_t"
- primitive_type: "int32"
+ type: TYPE_FUNCTION_POINTER
- primitive_type: "int32"
+ function_pointer: {
+ function_name: "camera_device_status_change"
+ arg: {
+ type: TYPE_PREDEFINED
+ predefined_type: "const struct camera_module_callbacks*"
+ scalar_type: "pointer"
+ is_const: true
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
}
- primitive_type: "function_pointer"
- primitive_name: "torch_mode_status_change"
- primitive_value: {
+ function_pointer: {
+ function_name: "torch_mode_status_change"
+ arg: {
+ type: TYPE_PREDEFINED
+ predefined_type: "struct camera_module_callbacks*"
+ scalar_type: "pointer"
+ is_const: true
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "char_pointer"
+ is_const: true
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
}
- aggregate_value: {
- primitive_type: "pointer"
- primitive_name: "const struct camera_module_callbacks*"
-
- primitive_type: "pointer"
- primitive_name: "const char*"
-
- primitive_type: "int32"
- }
- primitive_format: "%p %s %d"
is_callback: true
}
@@ -164,10 +199,12 @@
api: {
name: "set_callbacks"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- aggregate_type: "camera_module_callbacks_t*"
+ type: TYPE_PREDEFINED
+ predefined_type: "camera_module_callbacks_t*"
is_const: true
is_callback: true
}
@@ -176,6 +213,7 @@
api: {
name: "init"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
diff --git a/sysfuzzer/libinterfacespecification/specification/CameraHalV2hw_device_t.vts b/sysfuzzer/libinterfacespecification/specification/CameraHalV2hw_device_t.vts
index 21339cf..5a023e7 100644
--- a/sysfuzzer/libinterfacespecification/specification/CameraHalV2hw_device_t.vts
+++ b/sysfuzzer/libinterfacespecification/specification/CameraHalV2hw_device_t.vts
@@ -1,4 +1,4 @@
-component_class: HAL_SUBMODULE
+component_class: HAL_CONVENTIONAL_SUBMODULE
component_type: CAMERA
component_type_version: 2.1
@@ -11,308 +11,497 @@
api: {
name: "set_preview_window"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct preview_stream_ops*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct preview_stream_ops*"
}
}
api: {
name: "set_callbacks"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "function_pointer"
- aggregate_type: "camera_notify_callback"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_notify_callback"
+ is_callback: true
}
arg: {
- primitive_type: "function_pointer"
- aggregate_type: "camera_data_callback"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_data_callback"
+ is_callback: true
}
arg: {
- primitive_type: "function_pointer"
- aggregate_type: "camera_data_timestamp_callback"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_data_timestamp_callback"
+ is_callback: true
}
arg: {
- primitive_type: "function_pointer"
- aggregate_type: "camera_request_memory"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_request_memory"
+ is_callback: true
}
arg: {
- primitive_type: "void_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
}
}
api: {
name: "enable_msg_type"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "disable_msg_type"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "msg_type_enabled"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "start_preview"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "stop_preview"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "preview_enabled"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "store_meta_data_in_buffers"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "start_recording"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "stop_recording"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "recording_enabled"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "release_recording_frame"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "void_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
}
}
api: {
name: "auto_focus"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "cancel_auto_focus"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "take_picture"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "cancel_picture"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "set_parameters"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "char_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "char_pointer"
}
}
api: {
name: "get_parameters"
return_type: {
- primitive_type: "char_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "char_pointer"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "put_parameters"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "char_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "char_pointer"
}
}
api: {
name: "send_command"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "release"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
}
api: {
name: "dump"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct camera_device*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct camera_device*"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
+
+attribute: {
+ name: "camera_notify_callback"
+
+ type: TYPE_FUNCTION_POINTER
+
+ function_pointer: {
+ function_name: "camera_notify_callback"
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
+ }
+ }
+
+ is_callback: true
+}
+
+attribute: {
+ name: "camera_data_callback"
+
+ type: TYPE_FUNCTION_POINTER
+
+ function_pointer: {
+ function_name: "camera_data_callback"
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_memory_t*"
+ is_const: true
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ arg: {
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_frame_metadata_t*"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
+ }
+ }
+
+ is_callback: true
+}
+
+attribute: {
+ name: "camera_data_timestamp_callback"
+
+ type: TYPE_FUNCTION_POINTER
+
+ function_pointer: {
+ function_name: "camera_data_timestamp_callback"
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int64_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_memory_t*"
+ is_const: true
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
+ }
+ }
+
+ is_callback: true
+}
+
+attribute: {
+ name: "camera_request_memory"
+
+ type: TYPE_FUNCTION_POINTER
+
+ function_pointer: {
+ function_name: "camera_request_memory"
+ return_type: {
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "camera_memory_t*"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "size_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ }
+ arg: {
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
+ }
+ }
+
+ is_callback: true
+}
\ No newline at end of file
diff --git a/sysfuzzer/libinterfacespecification/specification/GpsHalV1.vts b/sysfuzzer/libinterfacespecification/specification/GpsHalV1.vts
index 525c5e3..f101cab 100644
--- a/sysfuzzer/libinterfacespecification/specification/GpsHalV1.vts
+++ b/sysfuzzer/libinterfacespecification/specification/GpsHalV1.vts
@@ -10,10 +10,12 @@
api: {
name: "get_gps_interface"
return_type: {
- aggregate_type: "GpsInterface*"
+ type: TYPE_PREDEFINED
+ predefined_type: "GpsInterface*"
}
arg: {
- aggregate_type: "struct gps_device_t*"
+ type: TYPE_PREDEFINED
+ predefined_type: "struct gps_device_t*"
}
callflow: {
entry: true
diff --git a/sysfuzzer/libinterfacespecification/specification/GpsHalV1GpsInterface.vts b/sysfuzzer/libinterfacespecification/specification/GpsHalV1GpsInterface.vts
index b371da8..1f8ce64 100644
--- a/sysfuzzer/libinterfacespecification/specification/GpsHalV1GpsInterface.vts
+++ b/sysfuzzer/libinterfacespecification/specification/GpsHalV1GpsInterface.vts
@@ -1,4 +1,4 @@
-component_class: HAL_SUBMODULE
+component_class: HAL_CONVENTIONAL_SUBMODULE
component_type: GPS
component_type_version: 1.0
@@ -10,11 +10,13 @@
api: {
name: "init"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "function_pointer"
- aggregate_type: "GpsCallbacks*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "GpsCallbacks*"
}
callflow: {
entry: true
@@ -25,7 +27,8 @@
api: {
name: "start"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
callflow: {
next: "stop"
@@ -35,7 +38,8 @@
api: {
name: "stop"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
callflow: {
next: "cleanup"
@@ -45,7 +49,7 @@
api: {
name: "cleanup"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
callflow: {
exit: true
@@ -56,84 +60,101 @@
api: {
name: "inject_time"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "int64_t"
- aggregate_type: "GpsUtcTime"
+ type: TYPE_PREDEFINED
+ scalar_type: "int64_t"
+ predefined_type: "GpsUtcTime"
}
arg: {
- primitive_type: "int64_t"
- aggregate_type: "GpsUtcTime"
+ type: TYPE_PREDEFINED
+ scalar_type: "int64_t"
+ predefined_type: "GpsUtcTime"
}
arg: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
}
api: {
name: "inject_location"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "double_t"
- aggregate_type: "vts_gps_latitude"
+ type: TYPE_PREDEFINED
+ scalar_type: "double_t"
+ predefined_type: "vts_gps_latitude"
}
arg: {
- primitive_type: "double_t"
- aggregate_type: "vts_gps_longitude"
+ type: TYPE_PREDEFINED
+ scalar_type: "double_t"
+ predefined_type: "vts_gps_longitude"
}
arg: {
- primitive_type: "float_t"
- aggregate_type: "vts_gps_accuracy"
+ type: TYPE_PREDEFINED
+ scalar_type: "float_t"
+ predefined_type: "vts_gps_accuracy"
}
}
api: {
name: "delete_aiding_data"
return_type: {
- primitive_type: "void"
+ type: TYPE_VOID
}
arg: {
- primitive_type: "uint16_t"
- aggregate_type: "vts_gps_flags_uint16"
+ type: TYPE_PREDEFINED
+ scalar_type: "uint16_t"
+ predefined_type: "vts_gps_flags_uint16"
}
}
api: {
name: "set_position_mode"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "uint32_t"
- aggregate_type: "GpsPositionMode"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ predefined_type: "GpsPositionMode"
}
arg: {
- primitive_type: "uint32_t"
- aggregate_type: "GpsPositionRecurrence"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ predefined_type: "GpsPositionRecurrence"
}
arg: {
- primitive_type: "uint32_t"
- aggregate_type: "min_interval"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ predefined_type: "min_interval"
}
arg: {
- primitive_type: "uint32_t"
- aggregate_type: "preferred_accuracy"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ predefined_type: "preferred_accuracy"
}
arg: {
- primitive_type: "uint32_t"
- aggregate_type: "preferred_time"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ predefined_type: "preferred_time"
}
}
api: {
name: "get_extension"
return_type: {
- primitive_type: "void_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "void_pointer"
}
arg: {
- primitive_type: "char_pointer"
+ type: TYPE_SCALAR
+ scalar_type: "char_pointer"
}
}
diff --git a/sysfuzzer/libinterfacespecification/specification/LightHalV1.vts b/sysfuzzer/libinterfacespecification/specification/LightHalV1.vts
index 42b753d..8625b14 100644
--- a/sysfuzzer/libinterfacespecification/specification/LightHalV1.vts
+++ b/sysfuzzer/libinterfacespecification/specification/LightHalV1.vts
@@ -10,129 +10,168 @@
api: {
name: "set_light"
return_type: {
- primitive_type: "int32_t"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct light_device_t*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct light_device_t*"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "struct light_state_t*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "struct light_state_t*"
}
}
-aggregate_type_name: "light_state_t"
-aggregate_type_definition: {
- primitive_type: "uint32_t"
- primitive_name: "color"
- primitive_value: {
- uint32_t: 0xffffff00
+attribute: {
+ name: "light_state_t"
+ type: TYPE_STRUCT
+
+ struct_value: {
+ name: "color"
+ type: TYPE_SCALAR
+ scalar_type: "uint32_t"
+ scalar_value: {
+ uint32_t: 0xffffff00
+ }
}
- primitive_type: "int32_t"
- primitive_name: "flashMode"
- primitive_value: {
- int32_t: 0
+ struct_value: {
+ name: "flashMode"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ scalar_value: {
+ int32_t: 0
+ }
}
- primitive_type: "int32_t"
- primitive_name: "flashOnMs"
- primitive_value: {
- int32_t: 0
+ struct_value: {
+ name: "flashOnMs"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ scalar_value: {
+ int32_t: 0
+ }
}
- primitive_type: "int32_t"
- primitive_name: "flashOffMs"
- primitive_value: {
- int32_t: 0
+ struct_value: {
+ name: "flashOffMs"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ scalar_value: {
+ int32_t: 0
+ }
}
- primitive_type: "int32_t"
- primitive_name: "brightnessMode"
- primitive_value: {
- int32_t: 0
+ struct_value: {
+ name: "brightnessMode"
+ type: TYPE_SCALAR
+ scalar_type: "int32_t"
+ scalar_value: {
+ int32_t: 0
+ }
}
}
-aggregate_type_name: "const"
-aggregate_type_definition: {
- primitive_type: "int32_t"
- primitive_name: "LIGHT_FLASH_NONE"
- primitive_value: {
- int32_t: 0
- }
+attribute: {
+ type: TYPE_ENUM
- primitive_type: "int32_t"
- primitive_name: "LIGHT_FLASH_TIMED"
- primitive_value: {
- int32_t: 1
- }
+ enum_value: {
+ enumerator: "LIGHT_FLASH_NONE"
+ value: 0
- primitive_type: "int32_t"
- primitive_name: "LIGHT_FLASH_HARDWARE"
- primitive_value: {
- int32_t: 2
- }
+ enumerator: "LIGHT_FLASH_TIMED"
+ value: 1
- primitive_type: "int32_t"
- primitive_name: "BRIGHTNESS_MODE_USER"
- primitive_value: {
- int32_t: 0
- }
-
- primitive_type: "int32_t"
- primitive_name: "BRIGHTNESS_MODE_SENSOR"
- primitive_value: {
- int32_t: 1
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_BACKLIGHT"
- primitive_value: {
- bytes: "backlight"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_KEYBOARD"
- primitive_value: {
- bytes: "keyboard"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_BUTTONS"
- primitive_value: {
- bytes: "buttons"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_BATTERY"
- primitive_value: {
- bytes: "battery"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_NOTIFICATIONS"
- primitive_value: {
- bytes: "notifications"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_ATTENTION"
- primitive_value: {
- bytes: "attention"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_BLUETOOTH"
- primitive_value: {
- bytes: "bluetooth"
- }
-
- primitive_type: "bytes"
- primitive_name: "LIGHT_ID_WIFI"
- primitive_value: {
- bytes: "wifi"
+ enumerator: "LIGHT_FLASH_HARDWARE"
+ value: 2
}
}
+
+attribute: {
+ type: TYPE_ENUM
+
+ enum_value: {
+ enumerator: "BRIGHTNESS_MODE_USER"
+ value: 0
+
+ enumerator: "BRIGHTNESS_MODE_SENSOR"
+ value: 1
+ }
+}
+
+attribute: {
+ name: "LIGHT_ID_BACKLIGHT"
+ type: TYPE_STRING
+ string_value: {
+ message: "backlight"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_KEYBOARD"
+ type: TYPE_STRING
+ string_value: {
+ message: "keyboard"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_BUTTONS"
+ type: TYPE_STRING
+ string_value: {
+ message: "buttons"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_BATTERY"
+ type: TYPE_STRING
+ string_value: {
+ message: "battery"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_NOTIFICATIONS"
+ type: TYPE_STRING
+ string_value: {
+ message: "notifications"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_ATTENTION"
+ type: TYPE_STRING
+ string_value: {
+ message: "attention"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_BLUETOOTH"
+ type: TYPE_STRING
+ string_value: {
+ message: "bluetooth"
+ }
+ is_const: true
+}
+
+attribute: {
+ name: "LIGHT_ID_WIFI"
+ type: TYPE_STRING
+ string_value: {
+ message: "wifi"
+ }
+ is_const: true
+}
+
diff --git a/sysfuzzer/libinterfacespecification/specification/WifiHalV1.vts b/sysfuzzer/libinterfacespecification/specification/WifiHalV1.vts
index e0d2691..80dcf3e 100644
--- a/sysfuzzer/libinterfacespecification/specification/WifiHalV1.vts
+++ b/sysfuzzer/libinterfacespecification/specification/WifiHalV1.vts
@@ -8,10 +8,12 @@
api: {
name: "wifi_initialize"
return_type: {
- aggregate_type: "wifi_error"
+ type: TYPE_PREDEFINED
+ predefined_type: "wifi_error"
}
arg: {
- primitive_type: "pointer"
- aggregate_type: "wifi_handle*"
+ type: TYPE_PREDEFINED
+ scalar_type: "pointer"
+ predefined_type: "wifi_handle*"
}
}
diff --git a/sysfuzzer/vtscompiler/VtsCompilerMain.cpp b/sysfuzzer/vtscompiler/VtsCompilerMain.cpp
index 0b5d930..4e48d21 100644
--- a/sysfuzzer/vtscompiler/VtsCompilerMain.cpp
+++ b/sysfuzzer/vtscompiler/VtsCompilerMain.cpp
@@ -28,7 +28,7 @@
#include "specification_parser/InterfaceSpecificationParser.h"
#include "utils/InterfaceSpecUtil.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "VtsCompilerUtils.h"
#include "code_gen/CodeGenBase.h"
@@ -70,7 +70,7 @@
case HAL_CONVENTIONAL:
code_generator.reset(new HalCodeGen(input_vts_file_path, vts_name));
break;
- case HAL_SUBMODULE:
+ case HAL_CONVENTIONAL_SUBMODULE:
code_generator.reset(
new HalSubmoduleCodeGen(input_vts_file_path, vts_name));
break;
diff --git a/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp b/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp
index 1b724ed..786b3e0 100644
--- a/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp
+++ b/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp
@@ -27,10 +27,11 @@
#include <sstream>
#include <fstream>
+#include <google/protobuf/text_format.h>
+
#include "specification_parser/InterfaceSpecificationParser.h"
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
-
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
@@ -44,7 +45,7 @@
case HAL_CONVENTIONAL: return "hal_conventional";
case SHAREDLIB: return "sharedlib";
case HAL_HIDL: return "hal_hidl";
- case HAL_SUBMODULE: return "hal_submodule";
+ case HAL_CONVENTIONAL_SUBMODULE: return "hal_conventional_submodule";
}
cerr << "error: invalid component_class " << component_class << endl;
exit(-1);
@@ -64,170 +65,163 @@
}
-string GetCppVariableType(const std::string primitive_type_string) {
- const char* primitive_type = primitive_type_string.c_str();
- if (!strcmp(primitive_type, "void")
- || !strcmp(primitive_type, "bool")
- || !strcmp(primitive_type, "int32_t")
- || !strcmp(primitive_type, "uint32_t")
- || !strcmp(primitive_type, "int8_t")
- || !strcmp(primitive_type, "uint8_t")
- || !strcmp(primitive_type, "int64_t")
- || !strcmp(primitive_type, "uint64_t")
- || !strcmp(primitive_type, "int16_t")
- || !strcmp(primitive_type, "uint16_t")
- || !strcmp(primitive_type, "float")
- || !strcmp(primitive_type, "double")) {
- return primitive_type_string;
- } else if(!strcmp(primitive_type, "ufloat")) {
+string GetCppVariableType(const std::string scalar_type_string) {
+ if (scalar_type_string == "void"
+ || scalar_type_string == "bool"
+ || scalar_type_string == "int32_t"
+ || scalar_type_string == "uint32_t"
+ || scalar_type_string == "int8_t"
+ || scalar_type_string == "uint8_t"
+ || scalar_type_string == "int64_t"
+ || scalar_type_string == "uint64_t"
+ || scalar_type_string == "int16_t"
+ || scalar_type_string == "uint16_t"
+ || scalar_type_string == "float"
+ || scalar_type_string == "double") {
+ return scalar_type_string;
+ } else if(scalar_type_string == "ufloat") {
return "unsigned float";
- } else if(!strcmp(primitive_type, "udouble")) {
+ } else if(scalar_type_string == "udouble") {
return "unsigned double";
- } else if (!strcmp(primitive_type, "string")) {
+ } else if (scalar_type_string == "string") {
return "std::string";
- } else if (!strcmp(primitive_type, "pointer")) {
+ } else if (scalar_type_string == "pointer") {
return "void*";
- } else if (!strcmp(primitive_type, "char_pointer")) {
+ } else if (scalar_type_string == "char_pointer") {
return "char*";
- } else if (!strcmp(primitive_type, "uchar_pointer")) {
+ } else if (scalar_type_string == "uchar_pointer") {
return "unsigned char*";
- } else if (!strcmp(primitive_type, "void_pointer")) {
+ } else if (scalar_type_string == "void_pointer") {
return "void*";
- } else if (!strcmp(primitive_type, "function_pointer")) {
+ } else if (scalar_type_string == "function_pointer") {
return "void*";
}
- cerr << __FILE__ << ":" << __LINE__ << " "
- << "error: unknown primitive_type " << primitive_type << endl;
+ cerr << __func__ << ":" << __LINE__ << " "
+ << "error: unknown scalar_type " << scalar_type_string << endl;
exit(-1);
}
-string GetCppVariableType(ArgumentSpecificationMessage arg) {
- if (arg.aggregate_type().size() == 1) {
- return arg.aggregate_type(0);
- } else if (arg.primitive_type().size() == 1) {
- return GetCppVariableType(arg.primitive_type(0));
- } else if (arg.primitive_type().size() > 1
- || arg.aggregate_type().size() > 1) {
- cerr << __FUNCTION__
- << ": aggregate type with multiple attributes; not supported" << endl;
- exit(-1);
+string GetCppVariableType(VariableSpecificationMessage arg) {
+ if (arg.type() == TYPE_VOID) {
+ return "void";
+ } if (arg.type() == TYPE_PREDEFINED) {
+ return arg.predefined_type();
+ } else if (arg.type() == TYPE_SCALAR) {
+ return GetCppVariableType(arg.scalar_type());
}
- cerr << __FUNCTION__ << ": error: neither instance nor data type is set" << endl;
+ cerr << __func__ << ":" << __LINE__ << " "
+ << ": type " << arg.type() << " not supported" << endl;
+ string* output = new string();
+ google::protobuf::TextFormat::PrintToString(arg, output);
+ cerr << *output;
+ delete output;
exit(-1);
}
-string GetConversionToProtobufFunctionName(ArgumentSpecificationMessage arg) {
- if (arg.aggregate_type().size() == 1) {
- if (!strcmp(arg.aggregate_type(0).c_str(), "camera_info_t*")) {
+string GetConversionToProtobufFunctionName(VariableSpecificationMessage arg) {
+ if (arg.type() == TYPE_PREDEFINED) {
+ if (arg.predefined_type() == "camera_info_t*") {
return "ConvertCameraInfoToProtobuf";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "hw_device_t**")) {
+ } else if (arg.predefined_type() == "hw_device_t**") {
return "";
} else {
cerr << __FILE__ << ":" << __LINE__ << " "
- << "error: unknown instance type " << arg.aggregate_type(0) << endl;
+ << "error: unknown instance type " << arg.predefined_type() << endl;
}
- } else if (arg.aggregate_type().size() > 1) {
- cerr << __FUNCTION__
- << ": aggregate type with multiple attributes; not supported" << endl;
- exit(-1);
}
- if (arg.primitive_type().size() > 1) {
- cerr << __FUNCTION__
- << ": a structure with multiple attributes; not supported" << endl;
- exit(-1);
- } else if (arg.primitive_type().size() == 1) {
- cerr << __FILE__ << ":" << __LINE__ << " "
- << "error: unknown data type " << arg.primitive_type(0) << endl;
- exit(-1);
- }
- cerr << __FUNCTION__ << ": error: neither instance nor data type is set" << endl;
+ cerr << __FUNCTION__
+ << ": non-supported type " << arg.type() << endl;
exit(-1);
}
-string GetCppInstanceType(ArgumentSpecificationMessage arg, string msg) {
- if (arg.aggregate_type().size() == 1) {
- if (!strcmp(arg.aggregate_type(0).c_str(), "struct light_state_t*")) {
+string GetCppInstanceType(VariableSpecificationMessage arg, string msg) {
+ if (arg.type() == TYPE_PREDEFINED) {
+ if (arg.predefined_type() == "struct light_state_t*") {
if (msg.length() == 0) {
return "GenerateLightState()";
} else {
return "GenerateLightStateUsingMessage(" + msg + ")";
}
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "GpsCallbacks*")) {
+ } else if (arg.predefined_type() == "GpsCallbacks*") {
return "GenerateGpsCallbacks()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "GpsUtcTime")) {
+ } else if (arg.predefined_type() == "GpsUtcTime") {
return "GenerateGpsUtcTime()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "vts_gps_latitude")) {
+ } else if (arg.predefined_type() == "vts_gps_latitude") {
return "GenerateLatitude()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "vts_gps_longitude")) {
+ } else if (arg.predefined_type() == "vts_gps_longitude") {
return "GenerateLongitude()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "vts_gps_accuracy")) {
+ } else if (arg.predefined_type() == "vts_gps_accuracy") {
return "GenerateGpsAccuracy()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "vts_gps_flags_uint16")) {
+ } else if (arg.predefined_type() == "vts_gps_flags_uint16") {
return "GenerateGpsFlagsUint16()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "GpsPositionMode")) {
+ } else if (arg.predefined_type() == "GpsPositionMode") {
return "GenerateGpsPositionMode()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "GpsPositionRecurrence")) {
+ } else if (arg.predefined_type() == "GpsPositionRecurrence") {
return "GenerateGpsPositionRecurrence()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "hw_module_t*")) {
+ } else if (arg.predefined_type() == "hw_module_t*") {
return "(hw_module_t*) malloc(sizeof(hw_module_t))";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "hw_module_t**")) {
+ } else if (arg.predefined_type() == "hw_module_t**") {
return "(hw_module_t**) malloc(sizeof(hw_module_t*))";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "hw_device_t**")) {
+ } else if (arg.predefined_type() == "hw_device_t**") {
return "(hw_device_t**) malloc(sizeof(hw_device_t*))";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "camera_info_t*")) {
+ } else if (arg.predefined_type() == "camera_info_t*") {
if (msg.length() == 0) {
return "GenerateCameraInfo()";
} else {
return "GenerateCameraInfoUsingMessage(" + msg + ")";
}
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "camera_module_callbacks_t*")) {
+ } else if (arg.predefined_type() == "camera_module_callbacks_t*") {
return "GenerateCameraModuleCallbacks()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "camera_notify_callback")) {
+ } else if (arg.predefined_type() == "camera_notify_callback") {
return "GenerateCameraNotifyCallback()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "camera_data_callback")) {
+ } else if (arg.predefined_type() == "camera_data_callback") {
return "GenerateCameraDataCallback()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "camera_data_timestamp_callback")) {
+ } else if (arg.predefined_type() == "camera_data_timestamp_callback") {
return "GenerateCameraDataTimestampCallback()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "camera_request_memory")) {
+ } else if (arg.predefined_type() == "camera_request_memory") {
return "GenerateCameraRequestMemory()";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "wifi_handle*")) {
+ } else if (arg.predefined_type() == "wifi_handle*") {
return "(wifi_handle*) malloc(sizeof(wifi_handle))";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "struct camera_device*")) {
+ } else if (arg.predefined_type() == "struct camera_device*") {
return "(struct camera_device*) malloc(sizeof(struct camera_device))";
- } else if (!strcmp(arg.aggregate_type(0).c_str(), "struct preview_stream_ops*")) {
+ } else if (arg.predefined_type() == "struct preview_stream_ops*") {
return "(preview_stream_ops*) malloc(sizeof(preview_stream_ops))";
} else {
cerr << __FILE__ << ":" << __LINE__ << " "
- << "error: unknown instance type " << arg.aggregate_type(0) << endl;
+ << "error: unknown instance type " << arg.predefined_type() << endl;
}
- } else if (arg.aggregate_type().size() > 1) {
- cerr << __FUNCTION__
- << ": aggregate type with multiple attributes; not supported" << endl;
- exit(-1);
- }
- if (arg.primitive_type().size() > 1) {
- cerr << __FUNCTION__
- << ": a structure with multiple attributes; not supported" << endl;
- exit(-1);
- } else if (arg.primitive_type().size() == 1) {
- if (!strcmp(arg.primitive_type(0).c_str(), "uint32_t")) {
+ } else if (arg.type() == TYPE_SCALAR) {
+ if (arg.scalar_type() == "uint32_t") {
return "RandomUint32()";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "int32_t")) {
+ } else if (arg.scalar_type() == "int32_t") {
return "RandomInt32()";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "char_pointer")) {
+ } else if (arg.scalar_type() == "uint64_t") {
+ return "RandomUint64()";
+ } else if (arg.scalar_type() == "int64_t") {
+ return "RandomInt64()";
+ } else if (arg.scalar_type() == "uint16_t") {
+ return "RandomUint16()";
+ } else if (arg.scalar_type() == "int16_t") {
+ return "RandomInt16()";
+ } else if (arg.scalar_type() == "uint8_t") {
+ return "RandomUint8()";
+ } else if (arg.scalar_type() == "int8_t") {
+ return "RandomInt8()";
+ } else if (arg.scalar_type() == "char_pointer") {
return "RandomCharPointer()";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "void_pointer")) {
+ } else if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "void_pointer") {
return "RandomVoidPointer()";
}
cerr << __FILE__ << ":" << __LINE__ << " "
- << "error: unknown data type " << arg.primitive_type(0) << endl;
+ << "error: unsupported scalar data type " << arg.scalar_type() << endl;
exit(-1);
}
- cerr << __FUNCTION__ << ": error: neither instance nor data type is set" << endl;
+ cerr << __FUNCTION__ << ": error: unsupported type " << arg.type() << endl;
exit(-1);
}
diff --git a/sysfuzzer/vtscompiler/VtsCompilerUtils.h b/sysfuzzer/vtscompiler/VtsCompilerUtils.h
index 5f45108..fa74ad0 100644
--- a/sysfuzzer/vtscompiler/VtsCompilerUtils.h
+++ b/sysfuzzer/vtscompiler/VtsCompilerUtils.h
@@ -16,7 +16,7 @@
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
@@ -35,14 +35,14 @@
extern string GetCppVariableType(const string primitive_type_string);
// Returns the C/C++ basic variable type name of a given argument.
-extern string GetCppVariableType(ArgumentSpecificationMessage arg);
+extern string GetCppVariableType(VariableSpecificationMessage arg);
// Get the C/C++ instance type name of an argument.
-extern string GetCppInstanceType(ArgumentSpecificationMessage arg,
+extern string GetCppInstanceType(VariableSpecificationMessage arg,
string msg = string());
// Returns the name of a function which can convert the given arg to a protobuf.
-extern string GetConversionToProtobufFunctionName(ArgumentSpecificationMessage arg);
+extern string GetConversionToProtobufFunctionName(VariableSpecificationMessage arg);
// fs_mkdirs for VTS.
extern int vts_fs_mkdirs(char* file_path, mode_t mode);
diff --git a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
index 1438d24..f2cd380 100644
--- a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
@@ -56,14 +56,15 @@
string fuzzer_extended_class_name;
if (message.component_class() == HAL_CONVENTIONAL
- || message.component_class() == HAL_SUBMODULE
+ || message.component_class() == HAL_CONVENTIONAL_SUBMODULE
|| message.component_class() == HAL_LEGACY) {
fuzzer_extended_class_name = "FuzzerExtended_" + component_name;
}
GenerateAllHeader(fuzzer_extended_class_name, h_ss, message);
cpp_ss << endl << endl;
- if (message.component_class() == HAL_CONVENTIONAL) {
+ if (message.component_class() == HAL_CONVENTIONAL
+ || message.component_class() == HAL_CONVENTIONAL_SUBMODULE) {
GenerateCppBodyCallbackFunction(cpp_ss, message, fuzzer_extended_class_name);
}
@@ -132,7 +133,9 @@
h_ss << " " << fuzzer_extended_class_name << "() : FuzzerBase(";
if (message.component_class() == HAL_CONVENTIONAL) h_ss << "HAL_CONVENTIONAL";
- if (message.component_class() == HAL_SUBMODULE) h_ss << "HAL_SUBMODULE";
+ if (message.component_class() == HAL_CONVENTIONAL_SUBMODULE) {
+ h_ss << "HAL_CONVENTIONAL_SUBMODULE";
+ }
if (message.component_class() == HAL_LEGACY) h_ss << "HAL_LEGACY";
h_ss << ") { }" << endl;
@@ -145,7 +148,7 @@
GenerateFuzzFunctionForSubStruct(h_ss, sub_struct, "_");
}
- if (message.component_class() == HAL_SUBMODULE) {
+ if (message.component_class() == HAL_CONVENTIONAL_SUBMODULE) {
string component_name = GetComponentName(message);
h_ss << " void SetSubModule(" << component_name << "* submodule) {" << endl;
h_ss << " submodule_ = submodule;" << endl;
diff --git a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h
index 4233c98..04aa54a 100644
--- a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h
+++ b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h
@@ -22,7 +22,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
using namespace std;
diff --git a/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp
index f9b7fae..128a657 100644
--- a/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp
@@ -21,7 +21,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "VtsCompilerUtils.h"
@@ -50,107 +50,143 @@
std::stringstream& cpp_ss,
const InterfaceSpecificationMessage& message,
const string& fuzzer_extended_class_name) {
+ bool first_callback = true;
- if (message.aggregate_type_name_size()
- != message.aggregate_type_definition_size()) {
- cerr << "ERROR aggregate type's name and definition is not the equal" << endl;
- exit(-1);
- }
-
- for (int i = 0; i < message.aggregate_type_name_size(); i++) {
- // auto const& name = ;
- const ArgumentSpecificationMessage& definition = message.aggregate_type_definition(i);
- if (definition.is_callback()) {
- string name = "vts_callback_" + fuzzer_extended_class_name + "_" + message.aggregate_type_name(i);
- cpp_ss << "static int agent_port_ = -1;" << endl;
- cpp_ss << endl;
- cpp_ss << "class " << name << " : public FuzzerCallbackBase {" << endl;
- cpp_ss << " public:" << endl;
- cpp_ss << " " << name << "(int agent_port) {" << endl;
- cpp_ss << " agent_port_ = agent_port;" << endl;
- cpp_ss << " }" << endl;
- int primitive_format_index = 0;
- for (const auto& primitive_type : definition.primitive_type()) {
- if (primitive_type == "function_pointer") {
- const string& callback_name = definition.primitive_name(
- primitive_format_index);
- // TODO: callback's return value is assumed to be 'void'.
- cpp_ss << endl;
- cpp_ss << " static void " << callback_name << "(";
- for (int primitive_type_index = 0;
- primitive_type_index < definition.aggregate_value(
- primitive_format_index).primitive_type_size();
- primitive_type_index++) {
- const string& var_type = definition.aggregate_value(
- primitive_format_index).primitive_type(primitive_type_index);
- if (primitive_type_index != 0) {
- cpp_ss << ", ";
- }
- if (var_type == "pointer") {
- cpp_ss << definition.aggregate_value(
- primitive_format_index).primitive_name(primitive_type_index)
- << " ";
- } else if (var_type == "char_pointer") {
- cpp_ss << "char* ";
- } else if (var_type == "int32") {
- cpp_ss << "int ";
- }
- cpp_ss << "arg" << primitive_type_index;
- }
- cpp_ss << ") {" << endl;
-#if USE_VAARGS
- cpp_ss << " const char fmt[] = \""
- << definition.primitive_format(primitive_format_index) << "\";"
- << endl;
- cpp_ss << " va_list argp;" << endl;
- cpp_ss << " const char* p;" << endl;
- cpp_ss << " int i;" << endl;
- cpp_ss << " char* s;" << endl;
- cpp_ss << " char fmtbuf[256];" << endl;
- cpp_ss << endl;
- cpp_ss << " va_start(argp, fmt);" << endl;
- cpp_ss << endl;
- cpp_ss << " for (p = fmt; *p != '\\0'; p++) {" << endl;
- cpp_ss << " if (*p != '%') {" << endl;
- cpp_ss << " putchar(*p);" << endl;
- cpp_ss << " continue;" << endl;
- cpp_ss << " }" << endl;
- cpp_ss << " switch (*++p) {" << endl;
- cpp_ss << " case 'c':" << endl;
- cpp_ss << " i = va_arg(argp, int);" << endl;
- cpp_ss << " putchar(i);" << endl;
- cpp_ss << " break;" << endl;
- cpp_ss << " case 'd':" << endl;
- cpp_ss << " i = va_arg(argp, int);" << endl;
- cpp_ss << " s = itoa(i, fmtbuf, 10);" << endl;
- cpp_ss << " fputs(s, stdout);" << endl;
- cpp_ss << " break;" << endl;
- cpp_ss << " case 's':" << endl;
- cpp_ss << " s = va_arg(argp, char *);" << endl;
- cpp_ss << " fputs(s, stdout);" << endl;
- cpp_ss << " break;" << endl;
- //cpp_ss << " case 'p':
- cpp_ss << " case '%':" << endl;
- cpp_ss << " putchar('%');" << endl;
- cpp_ss << " break;" << endl;
- cpp_ss << " }" << endl;
- cpp_ss << " }" << endl;
- cpp_ss << " va_end(argp);" << endl;
-#endif
- // TODO: check whether bytes is set and handle properly if not.
- cpp_ss << " RpcCallToAgent(GetCallbackID(\"" << callback_name
- << "\"), agent_port_);" << endl;
- cpp_ss << " }" << endl;
- cpp_ss << endl;
-
- primitive_format_index++;
- }
- }
- cpp_ss << endl;
- cpp_ss << " private:" << endl;
- cpp_ss << "};" << endl;
- cpp_ss << endl;
+ for (int i = 0; i < message.attribute_size(); i++) {
+ const VariableSpecificationMessage& attribute = message.attribute(i);
+ if (attribute.type() != TYPE_FUNCTION_POINTER
+ || !attribute.is_callback()) {
+ continue;
}
+ string name = "vts_callback_" + fuzzer_extended_class_name
+ + "_" + attribute.name();
+ if (first_callback) {
+ cpp_ss << "static int agent_port_ = -1;" << endl;
+ first_callback = false;
+ }
+ cpp_ss << endl;
+ cpp_ss << "class " << name << " : public FuzzerCallbackBase {" << endl;
+ cpp_ss << " public:" << endl;
+ cpp_ss << " " << name << "(int agent_port) {" << endl;
+ cpp_ss << " agent_port_ = agent_port;" << endl;
+ cpp_ss << " }" << endl;
+
+ int primitive_format_index = 0;
+ for (const FunctionPointerSpecificationMessage& func_pt_spec
+ : attribute.function_pointer()) {
+ const string& callback_name = func_pt_spec.function_name();
+ // TODO: callback's return value is assumed to be 'void'.
+ cpp_ss << endl;
+ cpp_ss << " static ";
+ bool has_return_value = false;
+ if (!func_pt_spec.has_return_type()
+ || !func_pt_spec.return_type().has_type()
+ || func_pt_spec.return_type().type() == TYPE_VOID) {
+ cpp_ss << "void" << endl;
+ } else if (func_pt_spec.return_type().type() == TYPE_PREDEFINED){
+ cpp_ss << func_pt_spec.return_type().predefined_type();
+ has_return_value = true;
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " ERROR unknown type "
+ << func_pt_spec.return_type().type() << endl;
+ exit(-1);
+ }
+ cpp_ss << " " << callback_name << "(";
+ int primitive_type_index;
+ primitive_type_index = 0;
+ for (const auto& arg : func_pt_spec.arg()) {
+ if (primitive_type_index != 0) {
+ cpp_ss << ", ";
+ }
+ if (arg.is_const()) {
+ cpp_ss << "const ";
+ }
+ if (arg.type() == TYPE_SCALAR) {
+ /*
+ if (arg.scalar_type() == "pointer") {
+ cpp_ss << definition.aggregate_value(
+ primitive_format_index).primitive_name(primitive_type_index)
+ << " ";
+ } */
+ if (arg.scalar_type() == "char_pointer") {
+ cpp_ss << "char* ";
+ } else if (arg.scalar_type() == "int32_t"
+ || arg.scalar_type() == "uint32_t"
+ || arg.scalar_type() == "size_t"
+ || arg.scalar_type() == "int64_t"
+ || arg.scalar_type() == "uint64_t") {
+ cpp_ss << arg.scalar_type() << " ";
+ } else if (arg.scalar_type() == "void_pointer") {
+ cpp_ss << "void*";
+ } else {
+ cerr << __func__ << " unsupported scalar type " << arg.scalar_type() << endl;
+ exit(-1);
+ }
+ } else if (arg.type() == TYPE_PREDEFINED) {
+ cpp_ss << arg.predefined_type() << " ";
+ } else {
+ cerr << __func__ << " unsupported type" << endl;
+ exit(-1);
+ }
+ cpp_ss << "arg" << primitive_type_index;
+ primitive_type_index++;
+ }
+ cpp_ss << ") {" << endl;
+#if USE_VAARGS
+ cpp_ss << " const char fmt[] = \""
+ << definition.primitive_format(primitive_format_index) << "\";"
+ << endl;
+ cpp_ss << " va_list argp;" << endl;
+ cpp_ss << " const char* p;" << endl;
+ cpp_ss << " int i;" << endl;
+ cpp_ss << " char* s;" << endl;
+ cpp_ss << " char fmtbuf[256];" << endl;
+ cpp_ss << endl;
+ cpp_ss << " va_start(argp, fmt);" << endl;
+ cpp_ss << endl;
+ cpp_ss << " for (p = fmt; *p != '\\0'; p++) {" << endl;
+ cpp_ss << " if (*p != '%') {" << endl;
+ cpp_ss << " putchar(*p);" << endl;
+ cpp_ss << " continue;" << endl;
+ cpp_ss << " }" << endl;
+ cpp_ss << " switch (*++p) {" << endl;
+ cpp_ss << " case 'c':" << endl;
+ cpp_ss << " i = va_arg(argp, int);" << endl;
+ cpp_ss << " putchar(i);" << endl;
+ cpp_ss << " break;" << endl;
+ cpp_ss << " case 'd':" << endl;
+ cpp_ss << " i = va_arg(argp, int);" << endl;
+ cpp_ss << " s = itoa(i, fmtbuf, 10);" << endl;
+ cpp_ss << " fputs(s, stdout);" << endl;
+ cpp_ss << " break;" << endl;
+ cpp_ss << " case 's':" << endl;
+ cpp_ss << " s = va_arg(argp, char *);" << endl;
+ cpp_ss << " fputs(s, stdout);" << endl;
+ cpp_ss << " break;" << endl;
+ //cpp_ss << " case 'p':
+ cpp_ss << " case '%':" << endl;
+ cpp_ss << " putchar('%');" << endl;
+ cpp_ss << " break;" << endl;
+ cpp_ss << " }" << endl;
+ cpp_ss << " }" << endl;
+ cpp_ss << " va_end(argp);" << endl;
+#endif
+ // TODO: check whether bytes is set and handle properly if not.
+ cpp_ss << " RpcCallToAgent(GetCallbackID(\"" << callback_name
+ << "\"), agent_port_);" << endl;
+ if (has_return_value) {
+ // TODO: consider actual return type.
+ cpp_ss << " return NULL;";
+ }
+ cpp_ss << " }" << endl;
+ cpp_ss << endl;
+
+ primitive_format_index++;
+ }
+ cpp_ss << endl;
+ cpp_ss << " private:" << endl;
+ cpp_ss << "};" << endl;
+ cpp_ss << endl;
}
}
@@ -203,9 +239,9 @@
// args - definition;
int arg_count = 0;
for (auto const& arg : api.arg()) {
- if (arg.is_callback()) {
+ if (arg.is_callback()) { // arg.type() isn't always TYPE_FUNCTION_POINTER
string name = "vts_callback_" + fuzzer_extended_class_name + "_"
- + arg.aggregate_type(arg_count);
+ + arg.predefined_type(); // TODO - check to make sure name is always correct
if (name.back() == '*') name.pop_back();
cpp_ss << " " << name << "* arg" << arg_count << "callback = new ";
cpp_ss << name << "(agent_port);" << endl;
@@ -218,22 +254,26 @@
// TODO: think about how to free the malloced callback data structure.
// find the spec.
bool found = false;
- for (int aggregate_index = 0;
- aggregate_index < message.aggregate_type_name_size();
- aggregate_index++) {
- const ArgumentSpecificationMessage& definition =
- message.aggregate_type_definition(aggregate_index);
- if (definition.is_callback()) {
+ cout << name << endl;
+ for (auto const& attribute : message.attribute()) {
+ if (attribute.type() == TYPE_FUNCTION_POINTER
+ && attribute.is_callback()) {
string target_name = "vts_callback_" + fuzzer_extended_class_name
- + "_" + message.aggregate_type_name(aggregate_index);
+ + "_" + attribute.name();
+ cout << "compare" << endl;
+ cout << target_name << endl;
if (name == target_name) {
- for (int method_index = 0;
- method_index < definition.primitive_type_size();
- method_index++) {
- cpp_ss << " arg" << arg_count << "->"
- << definition.primitive_name(method_index)
+ if (attribute.function_pointer_size() > 1) {
+ for (auto const& func_pt : attribute.function_pointer()) {
+ cpp_ss << " arg" << arg_count << "->"
+ << func_pt.function_name()
+ << " = arg" << arg_count << "callback->"
+ << func_pt.function_name() << ";" << endl;
+ }
+ } else {
+ cpp_ss << " arg" << arg_count
<< " = arg" << arg_count << "callback->"
- << definition.primitive_name(method_index) << ";" << endl;
+ << attribute.name() << ";" << endl;
}
found = true;
break;
@@ -241,15 +281,16 @@
}
}
if (!found) {
- cerr << __func__ << " ERROR callback's definition missing." << endl;
+ cerr << __func__ << " ERROR callback definition missing for "
+ << name << " of " << api.name() << endl;
exit(-1);
}
} else {
cpp_ss << " " << GetCppVariableType(arg) << " ";
cpp_ss << "arg" << arg_count << " = ";
if (arg_count == 0
- && arg.aggregate_type().size() == 1
- && !strncmp(arg.aggregate_type(0).c_str(),
+ && arg.type() == TYPE_PREDEFINED
+ && !strncmp(arg.predefined_type().c_str(),
message.original_data_structure_name().c_str(),
message.original_data_structure_name().length())) {
cpp_ss << "reinterpret_cast<" << GetCppVariableType(arg) << ">("
@@ -259,45 +300,44 @@
msg_ss << "func_msg->arg(" << arg_count << ")";
string msg = msg_ss.str();
- if (arg.primitive_type().size() > 0) {
- cpp_ss << "(" << msg << ".aggregate_type().size() == 0 && "
- << msg << ".primitive_type().size() == 1)? ";
- if (!strcmp(arg.primitive_type(0).c_str(), "pointer")
- || !strcmp(arg.primitive_type(0).c_str(), "char_pointer")
- || !strcmp(arg.primitive_type(0).c_str(), "void_pointer")
- || !strcmp(arg.primitive_type(0).c_str(), "function_pointer")) {
+ if (arg.type() == TYPE_SCALAR) {
+ cpp_ss << "(" << msg << ".type() == TYPE_SCALAR)? ";
+ if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "pointer_pointer"
+ || arg.scalar_type() == "char_pointer"
+ || arg.scalar_type() == "void_pointer"
+ || arg.scalar_type() == "function_pointer") {
cpp_ss << "reinterpret_cast<" << GetCppVariableType(arg) << ">";
}
- cpp_ss << "(" << msg << ".primitive_value(0)";
+ cpp_ss << "(" << msg << ".scalar_value()";
- if (arg.primitive_type(0) == "int32_t"
- || arg.primitive_type(0) == "uint32_t"
- || arg.primitive_type(0) == "int64_t"
- || arg.primitive_type(0) == "uint64_t"
- || arg.primitive_type(0) == "int16_t"
- || arg.primitive_type(0) == "uint16_t"
- || arg.primitive_type(0) == "int8_t"
- || arg.primitive_type(0) == "uint8_t"
- || arg.primitive_type(0) == "float_t"
- || arg.primitive_type(0) == "double_t") {
- cpp_ss << "." << arg.primitive_type(0) << "() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "pointer")) {
- cpp_ss << ".pointer() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "char_pointer")) {
- cpp_ss << ".pointer() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "function_pointer")) {
- cpp_ss << ".pointer() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "void_pointer")) {
+ if (arg.scalar_type() == "int32_t"
+ || arg.scalar_type() == "uint32_t"
+ || arg.scalar_type() == "int64_t"
+ || arg.scalar_type() == "uint64_t"
+ || arg.scalar_type() == "int16_t"
+ || arg.scalar_type() == "uint16_t"
+ || arg.scalar_type() == "int8_t"
+ || arg.scalar_type() == "uint8_t"
+ || arg.scalar_type() == "float_t"
+ || arg.scalar_type() == "double_t") {
+ cpp_ss << "." << arg.scalar_type() << "() ";
+ } else if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "char_pointer"
+ || arg.scalar_type() == "void_pointer") {
cpp_ss << ".pointer() ";
} else {
- cerr << __func__ << " ERROR unsupported type " << arg.primitive_type(0) << endl;
+ cerr << __func__ << " ERROR unsupported scalar type " << arg.scalar_type() << endl;
exit(-1);
}
cpp_ss << ") : ";
+ } else {
+ cerr << __func__ << " unknown type " << msg << endl;
}
- cpp_ss << "( (" << msg << ".aggregate_value_size() > 0 || "
- << msg << ".primitive_value_size() > 0)? ";
+ cpp_ss << "( (" << msg << ".type() == TYPE_PREDEFINED || "
+ << msg << ".type() == TYPE_STRUCT || "
+ << msg << ".type() == TYPE_SCALAR)? ";
cpp_ss << GetCppInstanceType(arg, msg);
cpp_ss << " : " << GetCppInstanceType(arg) << " )";
// TODO: use the given message and call a lib function which converts
@@ -314,7 +354,7 @@
GenerateCodeToStartMeasurement(cpp_ss);
cpp_ss << " cout << \"hit2.\" << device_ << endl;" << endl;
- // checks whether the function is actaully defined.
+ // checks whether the function is actually defined.
cpp_ss << " if (reinterpret_cast<" << message.original_data_structure_name()
<< "*>(local_device)->" << api.name() << " == NULL";
cpp_ss << ") {" << endl;
@@ -326,8 +366,8 @@
cpp_ss << " cout << \"ok. let's call.\" << endl;" << endl;
cpp_ss << " ";
- if (api.return_type().primitive_type().size() == 1
- && !strcmp(api.return_type().primitive_type(0).c_str(), "void")) {
+ if (!api.has_return_type()
+ || api.return_type().type() == TYPE_VOID) {
cpp_ss << "*result = NULL;" << endl;
} else {
cpp_ss << "*result = const_cast<void*>(reinterpret_cast<const void*>(";
@@ -341,9 +381,9 @@
cpp_ss << "," << endl;
}
}
- if (api.return_type().primitive_type().size() == 0
- || (api.return_type().primitive_type().size() == 1
- && strcmp(api.return_type().primitive_type(0).c_str(), "void"))) {
+
+ if (api.has_return_type()
+ && api.return_type().type() != TYPE_VOID) {
cpp_ss << "))";
}
cpp_ss << ");" << endl;
@@ -426,8 +466,8 @@
cpp_ss << " " << GetCppVariableType(arg) << " ";
cpp_ss << "arg" << arg_count << " = ";
if (arg_count == 0
- && arg.aggregate_type().size() == 1
- && !strncmp(arg.aggregate_type(0).c_str(),
+ && arg.type() == TYPE_PREDEFINED
+ && !strncmp(arg.predefined_type().c_str(),
original_data_structure_name.c_str(),
original_data_structure_name.length())) {
cpp_ss << "reinterpret_cast<" << GetCppVariableType(arg) << ">("
@@ -437,39 +477,39 @@
msg_ss << "func_msg->arg(" << arg_count << ")";
string msg = msg_ss.str();
- if (arg.primitive_type().size() > 0) {
- cpp_ss << "(" << msg << ".aggregate_type().size() == 0 && "
- << msg << ".primitive_type().size() == 1 && "
- << msg << ".primitive_value().size() == 1)? ";
- if (!strcmp(arg.primitive_type(0).c_str(), "pointer")
- || !strcmp(arg.primitive_type(0).c_str(), "char_pointer")
- || !strcmp(arg.primitive_type(0).c_str(), "void_pointer")
- || !strcmp(arg.primitive_type(0).c_str(), "function_pointer")) {
+ if (arg.type() == TYPE_SCALAR) {
+ cpp_ss << "(" << msg << ".type() == TYPE_SCALAR && "
+ << msg << ".scalar_value()";
+ if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "char_pointer"
+ || arg.scalar_type() == "void_pointer"
+ || arg.scalar_type() == "function_pointer") {
+ cpp_ss << ".has_pointer())? ";
cpp_ss << "reinterpret_cast<" << GetCppVariableType(arg) << ">";
+ } else {
+ cpp_ss << ".has_" << arg.scalar_type() << "())? ";
}
- cpp_ss << "(" << msg << ".primitive_value(0)";
+ cpp_ss << "(" << msg << ".scalar_value()";
- if (arg.primitive_type(0) == "int32_t"
- || arg.primitive_type(0) == "uint32_t"
- || arg.primitive_type(0) == "int64_t"
- || arg.primitive_type(0) == "uint64_t"
- || arg.primitive_type(0) == "int16_t"
- || arg.primitive_type(0) == "uint16_t"
- || arg.primitive_type(0) == "int8_t"
- || arg.primitive_type(0) == "uint8_t"
- || arg.primitive_type(0) == "float_t"
- || arg.primitive_type(0) == "double_t") {
- cpp_ss << "." << arg.primitive_type(0) << "() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "pointer")) {
- cpp_ss << ".pointer() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "char_pointer")) {
- cpp_ss << ".pointer() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "function_pointer")) {
- cpp_ss << ".pointer() ";
- } else if (!strcmp(arg.primitive_type(0).c_str(), "void_pointer")) {
+ if (arg.scalar_type() == "int32_t"
+ || arg.scalar_type() == "uint32_t"
+ || arg.scalar_type() == "int64_t"
+ || arg.scalar_type() == "uint64_t"
+ || arg.scalar_type() == "int16_t"
+ || arg.scalar_type() == "uint16_t"
+ || arg.scalar_type() == "int8_t"
+ || arg.scalar_type() == "uint8_t"
+ || arg.scalar_type() == "float_t"
+ || arg.scalar_type() == "double_t") {
+ cpp_ss << "." << arg.scalar_type() << "() ";
+ } else if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "char_pointer"
+ || arg.scalar_type() == "function_pointer"
+ || arg.scalar_type() == "void_pointer") {
cpp_ss << ".pointer() ";
} else {
- cerr << __func__ << " ERROR unsupported type " << arg.primitive_type(0) << endl;
+ cerr << __func__ << " ERROR unsupported type "
+ << arg.scalar_type() << endl;
exit(-1);
}
cpp_ss << ") : ";
@@ -487,8 +527,9 @@
exit(-1);
}
} else {
- cpp_ss << "( (" << msg << ".aggregate_value_size() > 0 || "
- << msg << ".primitive_value_size() > 0)? ";
+ cpp_ss << "( (" << msg << ".type() == TYPE_PREDEFINED || "
+ << msg << ".type() == TYPE_STRUCT || "
+ << msg << ".type() == TYPE_SCALAR)? ";
cpp_ss << GetCppInstanceType(arg, msg);
cpp_ss << " : " << GetCppInstanceType(arg) << " )";
// TODO: use the given message and call a lib function which converts
@@ -497,7 +538,7 @@
}
cpp_ss << ";" << endl;
cpp_ss << " cout << \"arg" << arg_count << " = \" << arg" << arg_count
- << " << endl;" << endl;
+ << " << endl;" << endl << endl;
arg_count++;
}
@@ -517,8 +558,8 @@
cpp_ss << " cout << \"ok. let's call.\" << endl;" << endl;
cpp_ss << " ";
- if (api.return_type().primitive_type().size() == 1
- && !strcmp(api.return_type().primitive_type(0).c_str(), "void")) {
+ if (!api.has_return_type()
+ || api.return_type().type() == TYPE_VOID) {
cpp_ss << "*result = NULL;" << endl;
} else {
cpp_ss << "*result = const_cast<void*>(reinterpret_cast<const void*>(";
@@ -533,9 +574,8 @@
cpp_ss << "," << endl;
}
}
- if (api.return_type().primitive_type().size() == 0
- || (api.return_type().primitive_type().size() == 1
- && strcmp(api.return_type().primitive_type(0).c_str(), "void"))) {
+ if (api.has_return_type()
+ && api.return_type().type() != TYPE_VOID) {
cpp_ss << "))";
}
cpp_ss << ");" << endl;
diff --git a/sysfuzzer/vtscompiler/code_gen/HalCodeGen.h b/sysfuzzer/vtscompiler/code_gen/HalCodeGen.h
index 9c6cb74..9baac43 100644
--- a/sysfuzzer/vtscompiler/code_gen/HalCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/HalCodeGen.h
@@ -22,7 +22,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "code_gen/CodeGenBase.h"
diff --git a/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.cpp
index 330b5d1..1bf453c 100644
--- a/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.cpp
@@ -21,7 +21,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "VtsCompilerUtils.h"
diff --git a/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.h b/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.h
index a8a4418..5afa7b5 100644
--- a/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/HalSubmoduleCodeGen.h
@@ -22,7 +22,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "code_gen/CodeGenBase.h"
#include "code_gen/HalCodeGen.h"
diff --git a/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.cpp
index 89354bb..8e4ca98 100644
--- a/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.cpp
@@ -21,7 +21,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "VtsCompilerUtils.h"
@@ -55,8 +55,8 @@
cpp_ss << " " << GetCppVariableType(arg) << " ";
cpp_ss << "arg" << arg_count << " = ";
if (arg_count == 0
- && arg.aggregate_type().size() == 1
- && !strncmp(arg.aggregate_type(0).c_str(),
+ && arg.type() == TYPE_PREDEFINED
+ && !strncmp(arg.predefined_type().c_str(),
message.original_data_structure_name().c_str(),
message.original_data_structure_name().length())
&& message.original_data_structure_name().length() > 0) {
@@ -77,8 +77,8 @@
cpp_ss << ");" << endl;
// actual function call
- if (api.return_type().primitive_type().size() == 1
- && !strcmp(api.return_type().primitive_type(0).c_str(), "void")) {
+ if (!api.has_return_type()
+ || api.return_type().type() == TYPE_VOID) {
cpp_ss << "*result = NULL;" << endl;
} else {
cpp_ss << "*result = const_cast<void*>(reinterpret_cast<const void*>(";
@@ -97,9 +97,8 @@
cpp_ss << "," << endl;
}
}
- if (api.return_type().primitive_type().size() == 0
- || (api.return_type().primitive_type().size() == 1
- && strcmp(api.return_type().primitive_type(0).c_str(), "void"))) {
+ if (api.has_return_type()
+ || api.return_type().type() != TYPE_VOID) {
cpp_ss << "))";
}
cpp_ss << ");" << endl;
diff --git a/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.h b/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.h
index 90ec03c..a5db8b6 100644
--- a/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/LegacyHalCodeGen.h
@@ -22,7 +22,7 @@
#include <sstream>
#include <string>
-#include "test/vts/runners/host/proto/InterfaceSpecificationMessage.pb.h"
+#include "test/vts/proto/InterfaceSpecificationMessage.pb.h"
#include "code_gen/CodeGenBase.h"
#include "code_gen/HalCodeGen.h"
diff --git a/testcases/host/sample/SampleCameraTest.py b/testcases/host/sample/SampleCameraTest.py
index 52eb3d7..7dadf35 100644
--- a/testcases/host/sample/SampleCameraTest.py
+++ b/testcases/host/sample/SampleCameraTest.py
@@ -43,7 +43,7 @@
def testCameraNormal(self):
"""A simple testcase which just emulates a normal usage pattern."""
result = self.dut.hal.camera.get_number_of_cameras()
- count = result.return_type.primitive_value[0].int32_t
+ count = result.return_type.scalar_value.int32_t
logging.info(count)
for index in range(0, count):
arg = self.dut.hal.camera.camera_info_t(facing=0)
diff --git a/utils/python/mirror/hal_mirror.py b/utils/python/mirror/hal_mirror.py
index 3f6ace4..de5419d 100644
--- a/utils/python/mirror/hal_mirror.py
+++ b/utils/python/mirror/hal_mirror.py
@@ -20,7 +20,7 @@
from google.protobuf import text_format
from vts.runners.host import errors
-from vts.runners.host.proto import InterfaceSpecificationMessage_pb2 as IfaceSpecMsg
+from vts.proto import InterfaceSpecificationMessage_pb2 as IfaceSpecMsg
from vts.runners.host.tcp_client import vts_tcp_client
from vts.runners.host.tcp_server import vts_tcp_server
from vts.utils.python.mirror import mirror_object
@@ -28,7 +28,7 @@
COMPONENT_CLASS_DICT = {"hal_conventional": 1,
"sharedlib": 2,
"hal_hidl": 3,
- "hal_submodule": 4,
+ "hal_conventional_submodule": 4,
"hal_legacy": 5}
COMPONENT_TYPE_DICT = {"audio": 1,
diff --git a/utils/python/mirror/mirror_object.py b/utils/python/mirror/mirror_object.py
index f883522..1797b2e 100644
--- a/utils/python/mirror/mirror_object.py
+++ b/utils/python/mirror/mirror_object.py
@@ -20,7 +20,7 @@
import random
from vts.utils.python.fuzzer import FuzzerUtils
-from vts.runners.host.proto import InterfaceSpecificationMessage_pb2 as IfaceSpecMsg
+from vts.proto import InterfaceSpecificationMessage_pb2 as IfaceSpecMsg
from google.protobuf import text_format
# a dict containing the IDs of the registered function pointers.
@@ -78,10 +78,11 @@
logging.debug("remote call %s", func_msg.name)
if module_name:
arg = func_msg.arg.add()
- arg.primitive_type.append("string")
- value = arg.primitive_value.add()
- value.bytes = module_name
- func_msg.return_type.primitive_type.append("int32_t")
+ arg.type = IfaceSpecMsg.TYPE_STRING
+ arg.string_value.message = module_name
+
+ func_msg.return_type.type == IfaceSpecMsg.TYPE_SCALAR
+ func_msg.return_type.scalar_type = "int32_t"
logging.debug("final msg %s", func_msg)
result = self._client.CallApi(text_format.MessageToString(func_msg))
@@ -129,14 +130,12 @@
type_name: string, the name of the target data type.
Returns:
- ArgumentSpecificationMessage if found, None otherwise
+ VariableSpecificationMessage if found, None otherwise
"""
try:
- for name, definition in zip(
- self._if_spec_msg.aggregate_type_name,
- self._if_spec_msg.aggregate_type_definition):
- if name != "const" and name == type_name:
- return copy.copy(definition)
+ for attribute in self._if_spec_msg.attribute:
+ if not attribute.is_const and attribute.name == type_name:
+ return copy.copy(attribute)
return None
except AttributeError as e:
# TODO: check in advance whether self._if_spec_msg Interface
@@ -150,14 +149,17 @@
type_name: string, the name of the target const data variable.
Returns:
- ArgumentSpecificationMessage if found, None otherwise
+ VariableSpecificationMessage if found, None otherwise
"""
try:
- for name, definition in zip(
- self._if_spec_msg.aggregate_type_name,
- self._if_spec_msg.aggregate_type_definition):
- if name == "const":
- return copy.copy(definition)
+ for attribute in self._if_spec_msg.attribute:
+ if attribute.is_const and attribute.name == type_name:
+ return copy.copy(attribute)
+ elif attribute.type == IfaceSpecMsg.TYPE_ENUM:
+ for enumerator, value in zip(attribute.enum_value.enumerator,
+ attribute.enum_value.value):
+ if enumerator == type_name:
+ return copy.copy(attribute)
return None
except AttributeError as e:
# TODO: check in advance whether self._if_spec_msg Interface
@@ -180,36 +182,52 @@
raise MirrorObjectError("api %s unknown", func_msg)
logging.debug("remote call %s.%s", self._parent_path, api_name)
- logging.debug("remote call %s%s", api_name, args)
+ logging.info("remote call %s%s", api_name, args)
if args:
for arg_msg, value_msg in zip(func_msg.arg, args):
- logging.debug("arg msg value %s %s", arg_msg, value_msg)
+ logging.debug("arg msg %s", arg_msg)
+ logging.debug("value %s", value_msg)
if value_msg is not None:
# check whether value_msg is a message
- # value_msg.HasField("primitive_value")
+ # value_msg.type == "primitive_value"?
if isinstance(value_msg, int):
- pv = arg_msg.primitive_value.add()
- pv.int32_t = value_msg
+ arg_msg.type = IfaceSpecMsg.TYPE_SCALAR
+ arg_msg.scalar_value.int32_t = value_msg
+ arg_msg.scalar_type = "int32_t"
else:
# TODO: check in advance (whether it's a message)
if isinstance(
- value_msg,
- IfaceSpecMsg.ArgumentSpecificationMessage):
- arg_msg.CopyFrom(value_msg)
- arg_msg.ClearField("primitive_value")
+ value_msg,
+ IfaceSpecMsg.VariableSpecificationMessage):
+ if value_msg.type == IfaceSpecMsg.TYPE_STRUCT:
+ arg_msg.CopyFrom(value_msg)
+ elif value_msg.type == IfaceSpecMsg.TYPE_FUNCTION_POINTER:
+ arg_msg.CopyFrom(value_msg)
+ else:
+ raise MirrorObjectError(
+ "unknown msg type %s" % value_msg.type)
else:
- logging.error("unknown type %s",
- type(value_msg))
+ raise MirrorObjectError(
+ "unknown type %s" % type(value_msg))
try:
- for primitive_value in value_msg.primitive_value:
- pv = arg_msg.primitive_value.add()
- if primitive_value.HasField("uint32_t"):
- pv.uint32_t = primitive_value.uint32_t
- if primitive_value.HasField("int32_t"):
- pv.int32_t = primitive_value.int32_t
- if primitive_value.HasField("bytes"):
- pv.bytes = primitive_value.bytes
+ for arg, value in zip(arg_msg.struct_value,
+ value_msg.struct_value):
+ if value.type == IfaceSpecMsg.TYPE_SCALAR:
+ arg.scalar_type = value.scalar_type
+ setattr(arg.scalar_value, value.scalar_type,
+ getattr(value.scalar_value, value.scalar_type))
+ elif value.type == IfaceSpecMsg.TYPE_STRING:
+ arg.string_value.message = value.string_value.length
+ arg.string_value.length = value.string_value.message
+ elif value.type == IfaceSpecMsg.TYPE_STRUCT:
+ # TODO: assign recursively
+ logging.error("TYPE_STRUCT unsupported")
+ elif value.type == IfaceSpecMsg.TYPE_FUNCTION_POINTER:
+ logging.error("TYPE_FUNCTION_POINTER unsupported")
+ else:
+ raise MirrorObjectError(
+ "unsupport type %s" % value.type)
except AttributeError as e:
logging.exception(e)
raise
@@ -218,15 +236,14 @@
# TODO: use kwargs
for arg in func_msg.arg:
# TODO: handle other
- if arg.primitive_type == "pointer":
- value = arg.primitive_value.add()
- value.pointer = 0
+ if (arg.type == IfaceSpecMsg.TYPE_SCALAR
+ and arg.scalar_type == "pointer"):
+ arg.scalar_value.pointer = 0
logging.debug(func_msg)
if self._parent_path:
func_msg.parent_path = self._parent_path
- result = self._client.CallApi(text_format.MessageToString(
- func_msg))
+ result = self._client.CallApi(text_format.MessageToString(func_msg))
logging.debug(result)
return result
@@ -235,39 +252,49 @@
arg_msg = self.GetCustomAggregateType(api_name)
if not arg_msg:
raise MirrorObjectError("arg %s unknown" % arg_msg)
+ logging.info("MessageGenerator %s %s", api_name, arg_msg)
logging.debug("MESSAGE %s", api_name)
- for p_type, name, value in zip(arg_msg.primitive_type,
- arg_msg.primitive_name,
- arg_msg.primitive_value):
- logging.debug("for %s %s %s", p_type, name, value)
- for given_name, given_value in kwargs.iteritems():
- logging.debug("check %s %s", name, given_name)
- if given_name == name:
- logging.debug("match p_type=%s", p_type)
- if p_type == "uint32_t":
- value.uint32_t = given_value
- elif p_type == "int32_t":
- value.int32_t = given_value
- elif p_type == "function_pointer":
- value.bytes = self.GetFunctionPointerID(
- given_value)
+ if arg_msg.type == IfaceSpecMsg.TYPE_STRUCT:
+ for struct_value in arg_msg.struct_value:
+ logging.debug("for %s %s",
+ struct_value.name, struct_value.scalar_type)
+ for given_name, given_value in kwargs.iteritems():
+ logging.debug("check %s %s", struct_value.name, given_name)
+ if given_name == struct_value.name:
+ logging.debug("match type=%s", struct_value.scalar_type)
+ if struct_value.type == IfaceSpecMsg.TYPE_SCALAR:
+ if struct_value.scalar_type == "uint32_t":
+ struct_value.scalar_value.uint32_t = given_value
+ elif struct_value.scalar_type == "int32_t":
+ struct_value.scalar_value.int32_t = given_value
+ else:
+ raise MirrorObjectError(
+ "support %s" % struct_value.scalar_type)
+ continue
+ elif arg_msg.type == IfaceSpecMsg.TYPE_FUNCTION_POINTER:
+ for fp_value in arg_msg.function_pointer:
+ logging.debug("for %s", fp_value.function_name)
+ for given_name, given_value in kwargs.iteritems():
+ logging.debug("check %s %s", fp_value.function_name, given_name)
+ if given_name == fp_value.function_name:
+ fp_value.id = self.GetFunctionPointerID(given_value)
+ break
+
+ if arg_msg.type == IfaceSpecMsg.TYPE_STRUCT:
+ for struct_value, given_value in zip(arg_msg.struct_value, args):
+ logging.debug("arg match type=%s", struct_value.scalar_type)
+ if struct_value.type == IfaceSpecMsg.TYPE_SCALAR:
+ if struct_value.scalar_type == "uint32_t":
+ struct_value.scalar_value.uint32_t = given_value
+ elif struct_value.scalar_type == "int32_t":
+ struct_value.scalar_value.int32_t = given_value
else:
raise MirrorObjectError("support %s" % p_type)
- continue
- for p_type, name, value, given_value in zip(arg_msg.primitive_type,
- arg_msg.primitive_name,
- arg_msg.primitive_value,
- args):
- logging.debug("arg match type=%s", p_type)
- if p_type == "uint32_t":
- value.uint32_t = given_value
- elif p_type == "int32_t":
- value.int32_t = given_value
- elif p_type == "function_pointer":
- value.bytes = self.GetFunctionPointerID(given_value)
- else:
- raise MirrorObjectError("support %s" % p_type)
- continue
+ elif arg_msg.type == IfaceSpecMsg.TYPE_FUNCTION_POINTER:
+ for fp_value, given_value in zip(arg_msg.function_pointer, args):
+ logging.debug("for %s", fp_value.function_name)
+ fp_value.id = self.GetFunctionPointerID(given_value)
+ logging.debug("fp %s", fp_value)
logging.debug("generated %s", arg_msg)
return arg_msg
@@ -276,26 +303,28 @@
if not self.GetCustomAggregateType(api_name):
raise MirrorObjectError("fuzz arg %s unknown" % arg_msg)
- index = random.randint(0, len(arg_msg.primitive_type))
- count = 0
- for p_type, name, value in zip(arg_msg.primitive_type,
- arg_msg.primitive_name,
- arg_msg.primitive_value):
- if count == index:
- if p_type == "uint32_t":
- value.uint32_t ^= FuzzerUtils.mask_uint32_t()
- elif p_type == "int32_t":
- mask = FuzzerUtils.mask_int32_t()
- if mask == (1 << 31):
- value.int32_t *= -1
- value.int32_t += 1
+ if arg_msg.type == IfaceSpecMsg.TYPE_STRUCT:
+ index = random.randint(0, len(arg_msg.struct_value))
+ count = 0
+ for struct_value in arg_msg.struct_value:
+ if count == index:
+ if struct_value.scalar_type == "uint32_t":
+ struct_value.scalar_value.uint32_t ^= FuzzerUtils.mask_uint32_t()
+ elif struct_value.scalar_type == "int32_t":
+ mask = FuzzerUtils.mask_int32_t()
+ if mask == (1 << 31):
+ struct_value.scalar_value.int32_t *= -1
+ struct_value.scalar_value.int32_t += 1
+ else:
+ struct_value.scalar_value.int32_t ^= mask
else:
- value.int32_t ^= mask
- else:
- raise MirrorObjectError("support %s" % p_type)
- break
- count += 1
- logging.debug("fuzzed %s", arg_msg)
+ raise MirrorObjectError("support %s" % struct_value.scalar_type)
+ break
+ count += 1
+ logging.debug("fuzzed %s", arg_msg)
+ else:
+ raise MirrorObjectError(
+ "unsupported fuzz message type %s." % arg_msg.type)
return arg_msg
def ConstGenerator():
@@ -304,17 +333,19 @@
if not arg_msg:
raise MirrorObjectError("const %s unknown" % arg_msg)
logging.debug("check %s", api_name)
- for p_type, name, value in zip(arg_msg.primitive_type,
- arg_msg.primitive_name,
- arg_msg.primitive_value):
- logging.debug("for %s %s %s", p_type, name, value)
- if api_name == name:
- logging.debug("Found match for API name %s.", name)
- ret_v = getattr(value, p_type, None)
- if ret_v is None:
- raise MirrorObjectError(
- "No value found for type %s in %s." % (p_type, value))
- return ret_v
+ if arg_msg.type == IfaceSpecMsg.TYPE_SCALAR:
+ ret_v = getattr(arg_msg.scalar_value, arg_msg.scalar_type, None)
+ if ret_v is None:
+ raise MirrorObjectError(
+ "No value found for type %s in %s." % (p_type, value))
+ return ret_v
+ elif arg_msg.type == IfaceSpecMsg.TYPE_STRING:
+ return arg_msg.string_value.message
+ elif arg_msg.type == IfaceSpecMsg.TYPE_ENUM:
+ for enumerator, value in zip(arg_msg.enum_value.enumerator,
+ arg_msg.enum_value.value):
+ if enumerator == api_name:
+ return value
raise MirrorObjectError("const %s not found" % api_name)
# handle APIs.