Loading tools/rootcanal/Android.bp +3 −8 Original line number Diff line number Diff line Loading @@ -18,18 +18,13 @@ cc_defaults { tidy: true, tidy_checks: [ "-*", "readability-*", "-readability-function-size", "-readability-identifier-length", "-readability-implicit-bool-conversion", "-readability-magic-numbers", "-readability-use-anyofallof", "readability-inconsistent-declaration-parameter-name", ], tidy_checks_as_errors: [ "readability-*", "readability-inconsistent-declaration-parameter-name", ], tidy_flags: [ "--header-filter=^.*tools\\/rootcanal\\/(model|include|net|desktop)\\/(.(?!\\.pb\\.h))*$", "--header-filter=^((?!BluetoothGeneratedPackets_h|RootCanalGeneratedPackets_h|RootCanalBrEdrBBGeneratedPackets_h).)*$", ], defaults: [ "fluoride_common_options", Loading tools/rootcanal/desktop/root_canal_main.cc +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ int main(int argc, char** argv) { for (int arg = 0; arg < argc; arg++) { int port = (int)strtol(argv[arg], nullptr, 0); LOG_INFO("%d: %s (%d)", arg, argv[arg], port); if (port < 0 || port > UINT16_MAX) { if (port < 0 || port > 0xffff) { LOG_WARN("%s out of range", argv[arg]); } else { switch (arg) { Loading tools/rootcanal/desktop/test_environment.cc +5 −7 Original line number Diff line number Diff line Loading @@ -156,9 +156,7 @@ void TestEnvironment::SetUpLinkLayerServer() { std::shared_ptr<Device> TestEnvironment::ConnectToRemoteServer( const std::string& server, int port, Phy::Type phy_type) { auto socket = connector_->ConnectToRemoteServer(server, port); if (!socket->Connected()) { return nullptr; } if (!socket->Connected()) return nullptr; return LinkLayerSocketDevice::Create(socket, phy_type); } Loading @@ -170,14 +168,14 @@ void TestEnvironment::SetUpTestChannel() { server->StartListening(); if (test_channel_open_) { LOG_WARN("Only one connection at a time is supported"); rootcanal::TestChannelTransport::SendResponse( conn_fd, "The connection is broken"); test_channel_transport_.SendResponse(conn_fd, "The connection is broken"); return false; } test_channel_open_ = true; test_channel_.RegisterSendResponse( [conn_fd](const std::string& response) { rootcanal::TestChannelTransport::SendResponse(conn_fd, response); [this, conn_fd](const std::string& response) { test_channel_transport_.SendResponse(conn_fd, response); }); conn_fd->WatchForNonBlockingRead([this](AsyncDataChannel* conn_fd) { Loading tools/rootcanal/include/hci/address_with_type.h +1 −3 Original line number Diff line number Diff line Loading @@ -51,9 +51,7 @@ class AddressWithType final { /* Is this an Resolvable Private Address, that was generated from given irk ? */ bool IsRpaThatMatchesIrk(const rootcanal::crypto::Octet16& irk) const { if (!IsRpa()) { return false; } if (!IsRpa()) return false; /* use the 3 MSB of bd address as prand */ uint8_t prand[3]; Loading tools/rootcanal/model/controller/connected_isochronous_group.h +6 −4 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #pragma once #include <algorithm> #include <cstdint> #include "hci/hci_packets.h" Loading Loading @@ -44,9 +43,12 @@ class ConnectedIsochronousGroup { virtual ~ConnectedIsochronousGroup() = default; bool HasConnectedStream() const { return std::any_of( streams_.begin(), streams_.end(), [&](const ConnectedIsochronousStream& s) { return s.IsConnected(); }); for (auto& stream : streams_) { if (stream.IsConnected()) { return true; } } return false; } bool StreamIsConnected(uint16_t handle) const { Loading Loading
tools/rootcanal/Android.bp +3 −8 Original line number Diff line number Diff line Loading @@ -18,18 +18,13 @@ cc_defaults { tidy: true, tidy_checks: [ "-*", "readability-*", "-readability-function-size", "-readability-identifier-length", "-readability-implicit-bool-conversion", "-readability-magic-numbers", "-readability-use-anyofallof", "readability-inconsistent-declaration-parameter-name", ], tidy_checks_as_errors: [ "readability-*", "readability-inconsistent-declaration-parameter-name", ], tidy_flags: [ "--header-filter=^.*tools\\/rootcanal\\/(model|include|net|desktop)\\/(.(?!\\.pb\\.h))*$", "--header-filter=^((?!BluetoothGeneratedPackets_h|RootCanalGeneratedPackets_h|RootCanalBrEdrBBGeneratedPackets_h).)*$", ], defaults: [ "fluoride_common_options", Loading
tools/rootcanal/desktop/root_canal_main.cc +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ int main(int argc, char** argv) { for (int arg = 0; arg < argc; arg++) { int port = (int)strtol(argv[arg], nullptr, 0); LOG_INFO("%d: %s (%d)", arg, argv[arg], port); if (port < 0 || port > UINT16_MAX) { if (port < 0 || port > 0xffff) { LOG_WARN("%s out of range", argv[arg]); } else { switch (arg) { Loading
tools/rootcanal/desktop/test_environment.cc +5 −7 Original line number Diff line number Diff line Loading @@ -156,9 +156,7 @@ void TestEnvironment::SetUpLinkLayerServer() { std::shared_ptr<Device> TestEnvironment::ConnectToRemoteServer( const std::string& server, int port, Phy::Type phy_type) { auto socket = connector_->ConnectToRemoteServer(server, port); if (!socket->Connected()) { return nullptr; } if (!socket->Connected()) return nullptr; return LinkLayerSocketDevice::Create(socket, phy_type); } Loading @@ -170,14 +168,14 @@ void TestEnvironment::SetUpTestChannel() { server->StartListening(); if (test_channel_open_) { LOG_WARN("Only one connection at a time is supported"); rootcanal::TestChannelTransport::SendResponse( conn_fd, "The connection is broken"); test_channel_transport_.SendResponse(conn_fd, "The connection is broken"); return false; } test_channel_open_ = true; test_channel_.RegisterSendResponse( [conn_fd](const std::string& response) { rootcanal::TestChannelTransport::SendResponse(conn_fd, response); [this, conn_fd](const std::string& response) { test_channel_transport_.SendResponse(conn_fd, response); }); conn_fd->WatchForNonBlockingRead([this](AsyncDataChannel* conn_fd) { Loading
tools/rootcanal/include/hci/address_with_type.h +1 −3 Original line number Diff line number Diff line Loading @@ -51,9 +51,7 @@ class AddressWithType final { /* Is this an Resolvable Private Address, that was generated from given irk ? */ bool IsRpaThatMatchesIrk(const rootcanal::crypto::Octet16& irk) const { if (!IsRpa()) { return false; } if (!IsRpa()) return false; /* use the 3 MSB of bd address as prand */ uint8_t prand[3]; Loading
tools/rootcanal/model/controller/connected_isochronous_group.h +6 −4 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #pragma once #include <algorithm> #include <cstdint> #include "hci/hci_packets.h" Loading Loading @@ -44,9 +43,12 @@ class ConnectedIsochronousGroup { virtual ~ConnectedIsochronousGroup() = default; bool HasConnectedStream() const { return std::any_of( streams_.begin(), streams_.end(), [&](const ConnectedIsochronousStream& s) { return s.IsConnected(); }); for (auto& stream : streams_) { if (stream.IsConnected()) { return true; } } return false; } bool StreamIsConnected(uint16_t handle) const { Loading