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

Commit 0c50afcb authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

L2CAP: Add L2CAP Module

am: d6bd62e3

Change-Id: I794fb1e289ac44a5badb07a46f0afe2f716fb25b
parents 2ed92627 d6bd62e3
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ cc_library {
        ":BluetoothCryptoToolboxSources",
        ":BluetoothHalSources",
        ":BluetoothHciSources",
        ":BluetoothL2capSources",
        ":BluetoothPacketSources",
        ":BluetoothSmpSources",
    ],
@@ -141,6 +142,7 @@ cc_binary {
        "grpc/grpc_module.cc",
        ":BluetoothFacade_hci_hal",
        ":BluetoothFacade_hci_layer",
        ":BluetoothFacade_l2cap_layer",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
@@ -185,6 +187,7 @@ cc_binary {
        "grpc/grpc_module.cc",
        ":BluetoothCertSource_hci_hal",
        ":BluetoothCertSource_hci_layer",
        ":BluetoothCertSource_l2cap_layer",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
@@ -334,6 +337,7 @@ filegroup {
        "facade/rootservice.proto",
        "hal/facade.proto",
        "hci/facade.proto",
        "l2cap/facade.proto",
    ],
}

@@ -356,6 +360,8 @@ genrule {
        "hal/facade.pb.h",
        "hci/facade.grpc.pb.h",
        "hci/facade.pb.h",
        "l2cap/facade.grpc.pb.h",
        "l2cap/facade.pb.h",
    ],
}

@@ -378,6 +384,8 @@ genrule {
        "hal/facade.pb.cc",
        "hci/facade.grpc.pb.cc",
        "hci/facade.pb.cc",
        "l2cap/facade.grpc.pb.cc",
        "l2cap/facade.pb.cc",
    ],
}

@@ -392,7 +400,9 @@ genrule {
        "touch $(genDir)/hal/__init__.py; " +
        "touch $(genDir)/hal/cert/__init__.py; " +
        "touch $(genDir)/hci/__init__.py; " +
        "touch $(genDir)/hci/cert/__init__.py; ",
        "touch $(genDir)/hci/cert/__init__.py; " +
        "touch $(genDir)/l2cap/__init__.py; " +
        "touch $(genDir)/l2cap/cert/__init__.py; ",
    srcs: [
        ":BluetoothFacadeProto",
        ":BluetoothCertStackProto",
@@ -411,12 +421,18 @@ genrule {
        "hci/__init__.py",
        "hci/facade_pb2_grpc.py",
        "hci/facade_pb2.py",
        "l2cap/__init__.py",
        "l2cap/facade_pb2_grpc.py",
        "l2cap/facade_pb2.py",
        "hal/cert/__init__.py",
        "hal/cert/api_pb2_grpc.py",
        "hal/cert/api_pb2.py",
        "hci/cert/__init__.py",
        "hci/cert/api_pb2_grpc.py",
        "hci/cert/api_pb2.py",
        "l2cap/cert/__init__.py",
        "l2cap/cert/api_pb2_grpc.py",
        "l2cap/cert/api_pb2.py",
    ],
}

@@ -426,6 +442,7 @@ filegroup {
        "cert/rootservice.proto",
        "hal/cert/api.proto",
        "hci/cert/api.proto",
        "l2cap/cert/api.proto",
    ],
}

@@ -449,6 +466,8 @@ genrule {
        "hal/cert/api.pb.h",
        "hci/cert/api.grpc.pb.h",
        "hci/cert/api.pb.h",
        "l2cap/cert/api.grpc.pb.h",
        "l2cap/cert/api.pb.h",
    ],
}

@@ -472,5 +491,7 @@ genrule {
        "hal/cert/api.pb.cc",
        "hci/cert/api.grpc.pb.cc",
        "hci/cert/api.pb.cc",
        "l2cap/cert/api.grpc.pb.cc",
        "l2cap/cert/api.pb.cc",
    ],
}
+1 −0
Original line number Diff line number Diff line
SimpleHalTest
SimpleHciTest
SimpleL2capTest
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ from cert.event_stream import EventStream
from cert import rootservice_pb2_grpc as cert_rootservice_pb2_grpc
from hal.cert import api_pb2_grpc as hal_cert_pb2_grpc
from hci.cert import api_pb2_grpc as hci_cert_pb2_grpc
from l2cap.cert import api_pb2_grpc as l2cap_cert_pb2_grpc

ACTS_CONTROLLER_CONFIG_NAME = "GdCertDevice"
ACTS_CONTROLLER_REFERENCE_NAME = "gd_cert_devices"
@@ -67,6 +68,7 @@ class GdCertDevice(GdDeviceBase):
        self.rootservice = cert_rootservice_pb2_grpc.RootCertStub(self.grpc_root_server_channel)
        self.hal = hal_cert_pb2_grpc.HciHalCertStub(self.grpc_channel)
        self.hci = hci_cert_pb2_grpc.AclManagerCertStub(self.grpc_channel)
        self.l2cap = l2cap_cert_pb2_grpc.L2capModuleCertStub(self.grpc_channel)

        # Event streams
        self.hci.connection_complete_stream = EventStream(self.hci.FetchConnectionComplete)
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ from cert.event_stream import EventStream
from facade import rootservice_pb2_grpc as facade_rootservice_pb2_grpc
from hal import facade_pb2_grpc as hal_facade_pb2_grpc
from hci import facade_pb2_grpc as hci_facade_pb2_grpc
from l2cap import facade_pb2_grpc as l2cap_facade_pb2_grpc

ACTS_CONTROLLER_CONFIG_NAME = "GdDevice"
ACTS_CONTROLLER_REFERENCE_NAME = "gd_devices"
@@ -67,6 +68,7 @@ class GdDevice(GdDeviceBase):
        self.rootservice = facade_rootservice_pb2_grpc.RootFacadeStub(self.grpc_root_server_channel)
        self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel)
        self.hci = hci_facade_pb2_grpc.AclManagerFacadeStub(self.grpc_channel)
        self.l2cap = l2cap_facade_pb2_grpc.L2capModuleFacadeStub(self.grpc_channel)

        # Event streams
        self.hal.hci_event_stream = EventStream(self.hal.FetchHciEvent)
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "grpc/grpc_module.h"
#include "hal/cert/cert.h"
#include "hci/cert/cert.h"
#include "l2cap/cert/cert.h"
#include "os/log.h"
#include "os/thread.h"
#include "stack_manager.h"
@@ -54,6 +55,9 @@ class RootCertService : public ::bluetooth::cert::RootCert::Service {
      case BluetoothModule::HCI:
        modules.add<::bluetooth::hci::cert::AclManagerCertModule>();
        break;
      case BluetoothModule::L2CAP:
        modules.add<::bluetooth::l2cap::cert::L2capModuleCertModule>();
        break;
      default:
        return ::grpc::Status(::grpc::StatusCode::INVALID_ARGUMENT, "invalid module under test");
    }
Loading