Skip to content

Commit

Permalink
Sync with aosp main
Browse files Browse the repository at this point in the history
Synchronized to packages/modules/Bluetooth
commit b6245f8beee5e87e66659d54136bc9714826585f

Changelist:
- Set support for APCF Transport Discovery Service filter to false
- Use Jacobian Coordinates in Point implementation
- Use pow for consistency
- Do not report an invalid packet for unsupported LE Apcf Transport Discovert Service command
- Send well formatted Apcf command complete event
- Update to pdl 0.3.0
- Typo in LE Apcf Transport Discovery Data command handling
- Reset APCF scanner in LinkLayerController::Reset()
- Set the default value of acl_data_packet_length to 1023
- Encryption Change V2
- Implement the command LE Read Local P-256 Public Key
- Add Authenticated Payload Timeout Expired event
- Update to Core version 6.0
- Update build.rs to directly use the pdl_compiler library
- Add INTEL_BE200 controller preset
- Update controller_info.py script
  • Loading branch information
hchataing committed Feb 3, 2025
1 parent 5f7ab5f commit dba0cff
Show file tree
Hide file tree
Showing 155 changed files with 8,352 additions and 9,442 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/avatar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python -m pip install pandora-avatar
- name: Rootcanal
run: |
cargo install pdl-compiler --version 0.2.2
cargo install pdl-compiler --version 0.3.2
bazel build :rootcanal
- name: Test
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install dependencies
run: |
cargo install pdl-compiler --version 0.2.2
cargo install pdl-compiler --version 0.3.2
- name: Build
run: |
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:

- name: Install dependencies
run: |
cargo install pdl-compiler --version 0.2.2
cargo install pdl-compiler --version 0.3.2
python3 -m pip install hatch
- name: Set VERSION
Expand Down
138 changes: 61 additions & 77 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ cc_proto_library(

genrule(
name = "lmp_packets_rs",
cmd = "pdlc --output-format rust $(location rust/lmp_packets.pdl) > $(location lmp_packets.rs)",
cmd = "pdlc --output-format rust_legacy $(location rust/lmp_packets.pdl) > $(location lmp_packets.rs)",
outs = ["lmp_packets.rs"],
srcs = ["rust/lmp_packets.pdl"],
)

genrule(
name = "llcp_packets_rs",
cmd = "pdlc --output-format rust $(location rust/llcp_packets.pdl) > $(location llcp_packets.rs)",
cmd = "pdlc --output-format rust_legacy $(location rust/llcp_packets.pdl) > $(location llcp_packets.rs)",
outs = ["llcp_packets.rs"],
srcs = ["rust/llcp_packets.pdl"],
)

genrule(
name = "hci_packets_rs",
cmd = "pdlc --output-format rust $(location //packets:hci_packets.pdl) > $(location hci_packets.rs)",
cmd = "pdlc --output-format rust_legacy $(location //packets:hci_packets.pdl) > $(location hci_packets.rs)",
outs = ["hci_packets.rs"],
srcs = ["//packets:hci_packets.pdl"],
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -103,10 +103,10 @@ rust_static_library(
],
)

cc_library(
name = "rootcanal_lib",
cc_binary(
name = "librootcanal_ffi.so",
linkopts = ["-shared"],
srcs = [
"desktop/test_environment.cc",
"include/crypto/crypto.h",
"include/hci/address.h",
"include/hci/address_with_type.h",
Expand All @@ -116,7 +116,6 @@ cc_library(
"include/phy.h",
"lib/crypto/crypto.cc",
"lib/hci/address.cc",
"lib/hci/pcap_filter.cc",
"model/controller/acl_connection.cc",
"model/controller/acl_connection.h",
"model/controller/acl_connection_handler.cc",
Expand All @@ -134,58 +133,12 @@ cc_library(
"model/controller/vendor_commands/csr.h",
"model/controller/vendor_commands/le_apcf.cc",
"model/controller/vendor_commands/le_apcf.h",
"model/devices/baseband_sniffer.cc",
"model/devices/baseband_sniffer.h",
"model/devices/beacon.cc",
"model/devices/beacon.h",
"model/devices/beacon_swarm.cc",
"model/devices/beacon_swarm.h",
"model/controller/ffi.cc",
"model/controller/ffi.h",
"model/devices/device.cc",
"model/devices/device.h",
"model/devices/hci_device.cc",
"model/devices/hci_device.h",
"model/devices/link_layer_socket_device.cc",
"model/devices/link_layer_socket_device.h",
"model/devices/sniffer.cc",
"model/devices/sniffer.h",
"model/hci/h4.h",
"model/hci/h4_data_channel_packetizer.cc",
"model/hci/h4_data_channel_packetizer.h",
"model/hci/h4_parser.cc",
"model/hci/h4_parser.h",
"model/hci/hci_sniffer.cc",
"model/hci/hci_sniffer.h",
"model/hci/hci_socket_transport.cc",
"model/hci/hci_socket_transport.h",
"model/hci/hci_transport.h",
"model/setup/async_manager.cc",
"model/setup/device_boutique.cc",
"model/setup/device_boutique.h",
"model/setup/phy_device.cc",
"model/setup/phy_device.h",
"model/setup/phy_layer.cc",
"model/setup/phy_layer.h",
"model/setup/test_channel_transport.cc",
"model/setup/test_channel_transport.h",
"model/setup/test_command_handler.cc",
"model/setup/test_command_handler.h",
"model/setup/test_model.cc",
"model/setup/test_model.h",
"net/async_data_channel.h",
"net/async_data_channel_connector.h",
"net/async_data_channel_server.h",
"net/posix/posix_async_socket.cc",
"net/posix/posix_async_socket.h",
"net/posix/posix_async_socket_connector.cc",
"net/posix/posix_async_socket_server.cc",
"rust/include/rootcanal_rs.h",
],
hdrs = [
"desktop/test_environment.h",
"model/setup/async_manager.h",
"net/posix/posix_async_socket_connector.h",
"net/posix/posix_async_socket_server.h",
],
copts = [
"-std=c++17",
"-Wno-c99-designator",
Expand All @@ -210,16 +163,18 @@ cc_library(
":rootcanal_log",
":rootcanal_rs",
"//packets:generated",
"@pdl//:packet_runtime",
"@fmtlib",
"@openssl//:crypto",
"@pdl//:packet_runtime",
],
)

cc_binary(
name = "librootcanal_ffi.so",
linkopts = ["-shared"],
name = "rootcanal",
srcs = [
"desktop/root_canal_main.cc",
"desktop/test_environment.cc",
"desktop/test_environment.h",
"include/crypto/crypto.h",
"include/hci/address.h",
"include/hci/address_with_type.h",
Expand All @@ -229,6 +184,7 @@ cc_binary(
"include/phy.h",
"lib/crypto/crypto.cc",
"lib/hci/address.cc",
"lib/hci/pcap_filter.cc",
"model/controller/acl_connection.cc",
"model/controller/acl_connection.h",
"model/controller/acl_connection_handler.cc",
Expand All @@ -246,10 +202,53 @@ cc_binary(
"model/controller/vendor_commands/csr.h",
"model/controller/vendor_commands/le_apcf.cc",
"model/controller/vendor_commands/le_apcf.h",
"model/controller/ffi.cc",
"model/controller/ffi.h",
"model/devices/baseband_sniffer.cc",
"model/devices/baseband_sniffer.h",
"model/devices/beacon.cc",
"model/devices/beacon.h",
"model/devices/beacon_swarm.cc",
"model/devices/beacon_swarm.h",
"model/devices/device.cc",
"model/devices/device.h",
"model/devices/hci_device.cc",
"model/devices/hci_device.h",
"model/devices/link_layer_socket_device.cc",
"model/devices/link_layer_socket_device.h",
"model/devices/sniffer.cc",
"model/devices/sniffer.h",
"model/hci/h4.h",
"model/hci/h4_data_channel_packetizer.cc",
"model/hci/h4_data_channel_packetizer.h",
"model/hci/h4_parser.cc",
"model/hci/h4_parser.h",
"model/hci/hci_sniffer.cc",
"model/hci/hci_sniffer.h",
"model/hci/hci_socket_transport.cc",
"model/hci/hci_socket_transport.h",
"model/hci/hci_transport.h",
"model/setup/async_manager.cc",
"model/setup/async_manager.h",
"model/setup/device_boutique.cc",
"model/setup/device_boutique.h",
"model/setup/phy_device.cc",
"model/setup/phy_device.h",
"model/setup/phy_layer.cc",
"model/setup/phy_layer.h",
"model/setup/test_channel_transport.cc",
"model/setup/test_channel_transport.h",
"model/setup/test_command_handler.cc",
"model/setup/test_command_handler.h",
"model/setup/test_model.cc",
"model/setup/test_model.h",
"net/async_data_channel.h",
"net/async_data_channel_connector.h",
"net/async_data_channel_server.h",
"net/posix/posix_async_socket.cc",
"net/posix/posix_async_socket.h",
"net/posix/posix_async_socket_connector.cc",
"net/posix/posix_async_socket_connector.h",
"net/posix/posix_async_socket_server.cc",
"net/posix/posix_async_socket_server.h",
"rust/include/rootcanal_rs.h",
],
copts = [
Expand All @@ -276,27 +275,12 @@ cc_binary(
":rootcanal_log",
":rootcanal_rs",
"//packets:generated",
"@pdl//:packet_runtime",
"@gflags",
"@fmtlib",
"@openssl//:crypto",
"@pdl//:packet_runtime",
],
)

cc_binary(
name = "rootcanal",
srcs = ["desktop/root_canal_main.cc"],
copts = ["-std=c++17"],
# TODO enable thin_lto
# breaks the device registration
# features = ["-thin_lto"],
visibility = ["//visibility:public"],
deps = [
":rootcanal_lib",
":rootcanal_config",
":rootcanal_log",
":rootcanal_rs",
"@gflags",
"@fmtlib",
"@openssl//:crypto",
],
)
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ crate.spec(package = "num-derive", version = "0.3.3")
crate.spec(package = "num-integer", version = "0.1.45")
crate.spec(package = "num-traits", version = "0.2.14")
crate.spec(package = "paste", version = "1.0.4")
crate.spec(package = "pdl-runtime", version = "0.2.2")
crate.spec(package = "pdl-runtime", version = "0.3.2")
crate.spec(package = "pin-utils", version = "0.1.0")
crate.spec(package = "rand", version = "0.8.3")
crate.spec(package = "thiserror", version = "1.0.23")
Expand Down
25 changes: 10 additions & 15 deletions desktop/root_canal_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ using namespace rootcanal;

DEFINE_string(controller_properties_file, "", "deprecated");
DEFINE_string(configuration, "", "controller configuration (see config.proto)");
DEFINE_string(configuration_file, "",
"controller configuration file path (see config.proto)");
DEFINE_string(configuration_file, "", "controller configuration file path (see config.proto)");
DEFINE_string(default_commands_file, "", "deprecated");
DEFINE_bool(enable_log_color, false, "enable log colors");
DEFINE_bool(enable_hci_sniffer, false, "enable hci sniffer");
DEFINE_bool(enable_baseband_sniffer, false, "enable baseband sniffer");
DEFINE_bool(enable_pcap_filter, false, "enable PCAP filter");
DEFINE_bool(disable_address_reuse, false,
"prevent rootcanal from reusing device addresses");
DEFINE_bool(disable_address_reuse, false, "prevent rootcanal from reusing device addresses");
DEFINE_uint32(test_port, 6401, "test tcp port");
DEFINE_uint32(hci_port, 6402, "hci server tcp port");
DEFINE_uint32(link_port, 6403, "link server tcp port");
Expand Down Expand Up @@ -95,17 +93,14 @@ int main(int argc, char** argv) {
}

TestEnvironment root_canal(
[](AsyncManager* am, int port) {
return std::make_shared<PosixAsyncSocketServer>(port, am);
},
[](AsyncManager* am) {
return std::make_shared<PosixAsyncSocketConnector>(am);
},
static_cast<int>(FLAGS_test_port), static_cast<int>(FLAGS_hci_port),
static_cast<int>(FLAGS_link_port), static_cast<int>(FLAGS_link_ble_port),
configuration_str, FLAGS_enable_hci_sniffer,
FLAGS_enable_baseband_sniffer, FLAGS_enable_pcap_filter,
FLAGS_disable_address_reuse);
[](AsyncManager* am, int port) {
return std::make_shared<PosixAsyncSocketServer>(port, am);
},
[](AsyncManager* am) { return std::make_shared<PosixAsyncSocketConnector>(am); },
static_cast<int>(FLAGS_test_port), static_cast<int>(FLAGS_hci_port),
static_cast<int>(FLAGS_link_port), static_cast<int>(FLAGS_link_ble_port),
configuration_str, FLAGS_enable_hci_sniffer, FLAGS_enable_baseband_sniffer,
FLAGS_enable_pcap_filter, FLAGS_disable_address_reuse);

std::promise<void> barrier;
std::future<void> barrier_future = barrier.get_future();
Expand Down
Loading

0 comments on commit dba0cff

Please sign in to comment.