Loading system/vendor_libs/test_vendor_lib/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ cc_binary_host { "libscriptedbeaconpayload-protos-lite", "libbt-rootcanal", "breakpad_client", "libgflags", ], sanitize: { address: true, Loading system/vendor_libs/test_vendor_lib/data/Android.bp 0 → 100644 +5 −0 Original line number Diff line number Diff line prebuilt_etc_host { name: "controller_properties.json", src: "controller_properties.json", sub_dir: "rootcanal/data", } No newline at end of file system/vendor_libs/test_vendor_lib/desktop/root_canal_main.cc +12 −1 Original line number Diff line number Diff line Loading @@ -23,10 +23,17 @@ #include <backtrace/Backtrace.h> #include <backtrace/backtrace_constants.h> #include <gflags/gflags.h> #include "os/log.h" using ::android::bluetooth::root_canal::TestEnvironment; DEFINE_string(controller_properties_file, "", "controller_properties.json file path"); DEFINE_string(default_commands_file, "", "commands file which root-canal runs it as default"); constexpr uint16_t kTestPort = 6401; constexpr uint16_t kHciServerPort = 6402; constexpr uint16_t kLinkServerPort = 6403; Loading Loading @@ -74,6 +81,8 @@ int main(int argc, char** argv) { true, -1); eh.set_crash_handler(crash_callback); gflags::ParseCommandLineFlags(&argc, &argv, true); LOG_INFO("main"); uint16_t test_port = kTestPort; uint16_t hci_server_port = kHciServerPort; Loading Loading @@ -103,7 +112,9 @@ int main(int argc, char** argv) { } } TestEnvironment root_canal(test_port, hci_server_port, link_server_port); TestEnvironment root_canal(test_port, hci_server_port, link_server_port, FLAGS_controller_properties_file, FLAGS_default_commands_file); std::promise<void> barrier; std::future<void> barrier_future = barrier.get_future(); root_canal.initialize(std::move(barrier)); Loading system/vendor_libs/test_vendor_lib/desktop/test_environment.cc +2 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,8 @@ void TestEnvironment::SetUpTestChannel() { test_channel_.SetTimerPeriod({"5"}); test_channel_.StartTimer({}); test_channel_.FromFile(default_commands_file_); if (socket_fd == -1) { LOG_ERROR("Test channel SetUp(%d) failed.", test_port_); return; Loading system/vendor_libs/test_vendor_lib/desktop/test_environment.h +11 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,16 @@ namespace root_canal { class TestEnvironment { public: TestEnvironment(uint16_t test_port, uint16_t hci_server_port, uint16_t link_server_port) : test_port_(test_port), hci_server_port_(hci_server_port), link_server_port_(link_server_port) {} TestEnvironment(uint16_t test_port, uint16_t hci_server_port, uint16_t link_server_port, const std::string& controller_properties_file = "", const std::string& default_commands_file = "") : test_port_(test_port), hci_server_port_(hci_server_port), link_server_port_(link_server_port), default_commands_file_(default_commands_file), controller_(std::make_shared<test_vendor_lib::DualModeController>( controller_properties_file)) {} void initialize(std::promise<void> barrier); Loading @@ -41,6 +49,7 @@ class TestEnvironment { uint16_t test_port_; uint16_t hci_server_port_; uint16_t link_server_port_; std::string default_commands_file_; std::promise<void> barrier_; test_vendor_lib::AsyncManager async_manager_; Loading Loading
system/vendor_libs/test_vendor_lib/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ cc_binary_host { "libscriptedbeaconpayload-protos-lite", "libbt-rootcanal", "breakpad_client", "libgflags", ], sanitize: { address: true, Loading
system/vendor_libs/test_vendor_lib/data/Android.bp 0 → 100644 +5 −0 Original line number Diff line number Diff line prebuilt_etc_host { name: "controller_properties.json", src: "controller_properties.json", sub_dir: "rootcanal/data", } No newline at end of file
system/vendor_libs/test_vendor_lib/desktop/root_canal_main.cc +12 −1 Original line number Diff line number Diff line Loading @@ -23,10 +23,17 @@ #include <backtrace/Backtrace.h> #include <backtrace/backtrace_constants.h> #include <gflags/gflags.h> #include "os/log.h" using ::android::bluetooth::root_canal::TestEnvironment; DEFINE_string(controller_properties_file, "", "controller_properties.json file path"); DEFINE_string(default_commands_file, "", "commands file which root-canal runs it as default"); constexpr uint16_t kTestPort = 6401; constexpr uint16_t kHciServerPort = 6402; constexpr uint16_t kLinkServerPort = 6403; Loading Loading @@ -74,6 +81,8 @@ int main(int argc, char** argv) { true, -1); eh.set_crash_handler(crash_callback); gflags::ParseCommandLineFlags(&argc, &argv, true); LOG_INFO("main"); uint16_t test_port = kTestPort; uint16_t hci_server_port = kHciServerPort; Loading Loading @@ -103,7 +112,9 @@ int main(int argc, char** argv) { } } TestEnvironment root_canal(test_port, hci_server_port, link_server_port); TestEnvironment root_canal(test_port, hci_server_port, link_server_port, FLAGS_controller_properties_file, FLAGS_default_commands_file); std::promise<void> barrier; std::future<void> barrier_future = barrier.get_future(); root_canal.initialize(std::move(barrier)); Loading
system/vendor_libs/test_vendor_lib/desktop/test_environment.cc +2 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,8 @@ void TestEnvironment::SetUpTestChannel() { test_channel_.SetTimerPeriod({"5"}); test_channel_.StartTimer({}); test_channel_.FromFile(default_commands_file_); if (socket_fd == -1) { LOG_ERROR("Test channel SetUp(%d) failed.", test_port_); return; Loading
system/vendor_libs/test_vendor_lib/desktop/test_environment.h +11 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,16 @@ namespace root_canal { class TestEnvironment { public: TestEnvironment(uint16_t test_port, uint16_t hci_server_port, uint16_t link_server_port) : test_port_(test_port), hci_server_port_(hci_server_port), link_server_port_(link_server_port) {} TestEnvironment(uint16_t test_port, uint16_t hci_server_port, uint16_t link_server_port, const std::string& controller_properties_file = "", const std::string& default_commands_file = "") : test_port_(test_port), hci_server_port_(hci_server_port), link_server_port_(link_server_port), default_commands_file_(default_commands_file), controller_(std::make_shared<test_vendor_lib::DualModeController>( controller_properties_file)) {} void initialize(std::promise<void> barrier); Loading @@ -41,6 +49,7 @@ class TestEnvironment { uint16_t test_port_; uint16_t hci_server_port_; uint16_t link_server_port_; std::string default_commands_file_; std::promise<void> barrier_; test_vendor_lib::AsyncManager async_manager_; Loading