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

Commit 0f066135 authored by Henri Chataing's avatar Henri Chataing
Browse files

gdcert: Remove pybind l2cap bindings from python3 packets module

Bug: 329663555
Test: cert/run LeIsoTest
Flag: EXEMPT, test change
Change-Id: I09564981aae1f52bcbb31b0d7bcfa23dd91ab503
parent 77c7f170
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -874,19 +874,14 @@ cc_library_host_shared {
    srcs: [
        ":BluetoothPacketSources",
        "common/strings.cc",
        "l2cap/fcs.cc",
        "packet/python3_module.cc",

    ],
    generated_sources: [
        "BluetoothGeneratedPackets_python3_cc",
    ],
    header_libs: [
        "pybind11_headers",
    ],
    static_libs: [
        "libbase",
        "libbluetooth_l2cap_pdl",
        "libbluetooth_log",
    ],
    cflags: [
+4 −7
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@ GD_DIR = os.path.join(ANDROID_BUILD_TOP, "packages/modules/Bluetooth/system/gd")
BT_PACKETS_GEN_DIR = os.path.join(
    ANDROID_BUILD_TOP,
    "out/soong/.intermediates/packages/modules/Bluetooth/system/pdl/l2cap/BluetoothGeneratedPacketsL2cap_h/gen")
BT_PACKETS_PY3_GEN_DIR = os.path.join(
    ANDROID_BUILD_TOP,
    "out/soong/.intermediates/packages/modules/Bluetooth/system/gd/BluetoothGeneratedPackets_python3_cc/gen")

BT_PACKETS_BASE_SRCS = [
    os.path.join(GD_DIR, "l2cap/fcs.cc"),
@@ -50,14 +47,14 @@ BT_PACKETS_BASE_SRCS = [
    os.path.join(GD_DIR, "packet/view.cc"),
]

BT_PACKETS_PY3_SRCs = \
  [os.path.join(GD_DIR, "packet/python3_module.cc")] \
  + glob.glob(os.path.join(BT_PACKETS_PY3_GEN_DIR, "l2cap", "*.cc")) \
BT_PACKETS_PY3_SRCs = [
    os.path.join(GD_DIR, "packet/python3_module.cc"),
]

bluetooth_packets_python3_module = Extension(
    'bluetooth_packets_python3',
    sources=BT_PACKETS_BASE_SRCS + BT_PACKETS_PY3_SRCs,
    include_dirs=[GD_DIR, BT_PACKETS_GEN_DIR, BT_PACKETS_PY3_GEN_DIR, PYBIND11_INCLUDE_DIR],
    include_dirs=[GD_DIR, BT_PACKETS_GEN_DIR, PYBIND11_INCLUDE_DIR],
    extra_compile_args=['-std=c++17'])

setup(
+0 −8
Original line number Diff line number Diff line
@@ -32,11 +32,6 @@
namespace py = pybind11;

namespace bluetooth {

namespace l2cap {
void define_l2cap_packets_submodule(py::module&);
}

namespace packet {

using ::bluetooth::packet::BasePacketBuilder;
@@ -94,9 +89,6 @@ PYBIND11_MODULE(bluetooth_packets_python3, m) {
    auto bytes_shared = std::make_shared<std::vector<uint8_t>>(bytes);
    return std::make_unique<PacketView<!kLittleEndian>>(bytes_shared);
  }));

  py::module l2cap_m = m.def_submodule("l2cap_packets", "A submodule of l2cap_packets");
  bluetooth::l2cap::define_l2cap_packets_submodule(l2cap_m);
}

}  // namespace packet
+0 −25
Original line number Diff line number Diff line
@@ -4,28 +4,3 @@ genrule_defaults {
    cmd: "$(location bluetooth_packetgen) --fuzzing --testing --include=packages/modules/Bluetooth/system/pdl --out=$(genDir) $(in)",
    defaults_visibility: [":__subpackages__"],
}

// TODO get rid of this by converting the l2cap cert tests (or deprecating them)
genrule {
    name: "BluetoothGeneratedPackets_python3_cc",
    tools: [
        "bluetooth_packetgen",
    ],
    cmd: "$(location bluetooth_packetgen) --include=packages/modules/Bluetooth/system/pdl --out=$(genDir) --num_shards=10 $(in)",
    srcs: [
        "l2cap/l2cap_packets.pdl",
    ],
    out: [
        "l2cap/l2cap_packets_python3.cc",
        "l2cap/l2cap_packets_python3_shard_0.cc",
        "l2cap/l2cap_packets_python3_shard_1.cc",
        "l2cap/l2cap_packets_python3_shard_2.cc",
        "l2cap/l2cap_packets_python3_shard_3.cc",
        "l2cap/l2cap_packets_python3_shard_4.cc",
        "l2cap/l2cap_packets_python3_shard_5.cc",
        "l2cap/l2cap_packets_python3_shard_6.cc",
        "l2cap/l2cap_packets_python3_shard_7.cc",
        "l2cap/l2cap_packets_python3_shard_8.cc",
        "l2cap/l2cap_packets_python3_shard_9.cc",
    ],
}