Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2224c6a2 authored by Zach Johnson's avatar Zach Johnson
Browse files

Clean up facade naming and paths

Remove "cert" from build rules that apply to stack under test

hal/facade/* -> hal/
api.proto -> facade.proto

In proto -> [x]Facade
Module -> [x]FacadeModule
Grpc service -> [x]FacadeService

A few straggling references to HciCmd and HciEvt

Test: atest --host bluetooth_test_gd and ./cert/run_cert.sh

Change-Id: I471a49f65a216d6669b3cb7f5ffebc7c069e2d6d
parent 00b25120
Loading
Loading
Loading
Loading
+18 −20
Original line number Diff line number Diff line
@@ -121,14 +121,14 @@ cc_binary {
    srcs: [
        "facade/stack_with_grpc_main.cc",
        "grpc/grpc_module.cc",
        ":BluetoothCertFacade_hci_hal",
        ":BluetoothFacade_hci_hal",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
        "BluetoothCertFacadeGeneratedStub_h",
        "BluetoothFacadeGeneratedStub_h",
    ],
    generated_sources: [
        "BluetoothCertFacadeGeneratedStub_cc",
        "BluetoothFacadeGeneratedStub_cc",
    ],
    static_libs: [
        "libbluetooth_gd",
@@ -255,51 +255,51 @@ genrule {
}

filegroup {
    name: "BluetoothCertFacadeProto",
    name: "BluetoothFacadeProto",
    srcs: [
        "facade/common.proto",
        "hal/facade/api.proto",
        "hal/facade.proto",
    ],
}

genrule {
    name: "BluetoothCertFacadeGeneratedStub_h",
    name: "BluetoothFacadeGeneratedStub_h",
    tools: [
        "aprotoc",
        "protoc-gen-grpc-cpp-plugin",
    ],
    cmd: "$(location aprotoc) -Ipackages/modules/Bluetooth/system/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
    srcs: [
        ":BluetoothCertFacadeProto",
        ":BluetoothFacadeProto",
    ],
    out: [
        "facade/common.grpc.pb.h",
        "facade/common.pb.h",
        "hal/facade/api.grpc.pb.h",
        "hal/facade/api.pb.h",
        "hal/facade.grpc.pb.h",
        "hal/facade.pb.h",
    ],
}

genrule {
    name: "BluetoothCertFacadeGeneratedStub_cc",
    name: "BluetoothFacadeGeneratedStub_cc",
    tools: [
        "aprotoc",
        "protoc-gen-grpc-cpp-plugin",
    ],
    cmd: "$(location aprotoc) -Ipackages/modules/Bluetooth/system/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
    srcs: [
        ":BluetoothCertFacadeProto",
        ":BluetoothFacadeProto",
    ],
    out: [
        "facade/common.grpc.pb.cc",
        "facade/common.pb.cc",
        "hal/facade/api.grpc.pb.cc",
        "hal/facade/api.pb.cc",
        "hal/facade.grpc.pb.cc",
        "hal/facade.pb.cc",
    ],
}

genrule {
    name: "BluetoothCertFacadeGeneratedStub_py",
    name: "BluetoothFacadeGeneratedStub_py",
    tools: [
        "aprotoc",
        "protoc-gen-grpc-python-plugin",
@@ -307,10 +307,9 @@ genrule {
    cmd: "$(location aprotoc) -Ipackages/modules/Bluetooth/system/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-python-plugin) $(in) --grpc_out=$(genDir) --python_out=$(genDir); " +
        "touch $(genDir)/__init__.py; " +
        "touch $(genDir)/facade/__init__.py; " +
        "touch $(genDir)/hal/__init__.py; " +
        "touch $(genDir)/hal/facade/__init__.py; ",
        "touch $(genDir)/hal/__init__.py; ",
    srcs: [
        ":BluetoothCertFacadeProto",
        ":BluetoothFacadeProto",
    ],
    out: [
        "__init__.py",
@@ -318,8 +317,7 @@ genrule {
        "facade/common_pb2_grpc.py",
        "facade/common_pb2.py",
        "hal/__init__.py",
        "hal/facade/__init__.py",
        "hal/facade/api_pb2_grpc.py",
        "hal/facade/api_pb2.py",
        "hal/facade_pb2_grpc.py",
        "hal/facade_pb2.py",
    ],
}
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import subprocess

ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')

sys.path.append(ANDROID_BUILD_TOP + '/out/soong/.intermediates/packages/modules/Bluetooth/system/gd/BluetoothCertFacadeGeneratedStub_py/gen')
sys.path.append(ANDROID_BUILD_TOP + '/out/soong/.intermediates/packages/modules/Bluetooth/system/gd/BluetoothFacadeGeneratedStub_py/gen')

ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
ROOTCANAL = ANDROID_HOST_OUT + "/nativetest64/root-canal/root-canal"
+2 −3
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@ from acts.libs.proc import job

import grpc

from hal.facade import api_pb2
from hal.facade import api_pb2_grpc
from hal import facade_pb2_grpc as hal_facade_pb2_grpc

ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
@@ -112,7 +111,7 @@ class GdDevice:
            stderr=self.backing_process_logs)

        self.grpc_channel = grpc.insecure_channel("localhost:" + grpc_port)
        self.hal = api_pb2_grpc.HciTransportationStub(self.grpc_channel)
        self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel)

    def clean_up(self):
        self.grpc_channel.close()
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

#include "grpc/grpc_module.h"
#include "hal/hci_hal_host_rootcanal.h"
#include "hal/facade/facade.h"
#include "hal/facade.h"

#include <csignal>
#include <string>
@@ -58,7 +58,7 @@ int main(int argc, const char** argv) {
  }

  ModuleList modules;
  modules.add<::bluetooth::hal::facade::HalFacadeModule>();
  modules.add<::bluetooth::hal::HciHalFacadeModule>();

  Thread* stack_thread = new Thread("stack_thread", Thread::Priority::NORMAL);
  stack = new StackManager();
+2 −2
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@ filegroup {
}

filegroup {
    name: "BluetoothCertFacade_hci_hal",
    name: "BluetoothFacade_hci_hal",
    srcs: [
        "facade/facade.cc",
        "facade.cc",
    ],
}
Loading