summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
author Henri Chataing <henrichataing@google.com> 2025-02-04 16:42:08 -0800
committer Henri Chataing <henrichataing@google.com> 2025-02-14 19:31:11 +0000
commit430514b530047c70e8475091409a42d7e1301e54 (patch)
tree7d13a90d58149334f2cf38af5b28e3980f559164 /tools
parent9dbe9a85ddc8a05b3f4f7128cdc11428912bf073 (diff)
RootCanal: Deprecate the beacon_swarm device
Bug: 331817295 Test: m root-canal Flag: EXEMPT, tool change Change-Id: Id38b79278d6b14c6a607f9e6531869f0384584f7
Diffstat (limited to 'tools')
-rw-r--r--tools/rootcanal/Android.bp1
-rw-r--r--tools/rootcanal/CMakeLists.txt1
-rw-r--r--tools/rootcanal/model/devices/beacon_swarm.cc75
-rw-r--r--tools/rootcanal/model/devices/beacon_swarm.h47
4 files changed, 0 insertions, 124 deletions
diff --git a/tools/rootcanal/Android.bp b/tools/rootcanal/Android.bp
index b35e46d649..e7ccec6657 100644
--- a/tools/rootcanal/Android.bp
+++ b/tools/rootcanal/Android.bp
@@ -91,7 +91,6 @@ cc_library_static {
"model/controller/vendor_commands/le_apcf.cc",
"model/devices/baseband_sniffer.cc",
"model/devices/beacon.cc",
- "model/devices/beacon_swarm.cc",
"model/devices/device.cc",
"model/devices/hci_device.cc",
"model/devices/link_layer_socket_device.cc",
diff --git a/tools/rootcanal/CMakeLists.txt b/tools/rootcanal/CMakeLists.txt
index 413d2989f7..bc5a291392 100644
--- a/tools/rootcanal/CMakeLists.txt
+++ b/tools/rootcanal/CMakeLists.txt
@@ -186,7 +186,6 @@ android_add_library(
model/controller/sco_connection.cc
model/controller/vendor_commands/le_apcf.cc
model/devices/beacon.cc
- model/devices/beacon_swarm.cc
model/devices/device.cc
model/devices/hci_device.cc
model/devices/link_layer_socket_device.cc
diff --git a/tools/rootcanal/model/devices/beacon_swarm.cc b/tools/rootcanal/model/devices/beacon_swarm.cc
deleted file mode 100644
index b0013d9b2b..0000000000
--- a/tools/rootcanal/model/devices/beacon_swarm.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "model/devices/beacon_swarm.h"
-
-#include <chrono>
-#include <cstdint>
-#include <string>
-#include <vector>
-
-#include "model/devices/beacon.h"
-#include "model/setup/device_boutique.h"
-#include "packets/link_layer_packets.h"
-
-namespace rootcanal {
-using namespace model::packets;
-using namespace std::chrono_literals;
-
-bool BeaconSwarm::registered_ = DeviceBoutique::Register("beacon_swarm", &BeaconSwarm::Create);
-
-BeaconSwarm::BeaconSwarm(const std::vector<std::string>& args) : Beacon(args) {
- advertising_interval_ = 1280ms;
- advertising_type_ = LegacyAdvertisingType::ADV_NONCONN_IND;
- advertising_data_ = {
- 0x15 /* Length */,
- 0x09 /* TYPE_NAME_COMPLETE */,
- 'g',
- 'D',
- 'e',
- 'v',
- 'i',
- 'c',
- 'e',
- '-',
- 'b',
- 'e',
- 'a',
- 'c',
- 'o',
- 'n',
- '_',
- 's',
- 'w',
- 'a',
- 'r',
- 'm',
- 0x02 /* Length */,
- 0x01 /* TYPE_FLAG */,
- 0x4 /* BREDR_NOT_SUPPORTED */ | 0x2 /* GENERAL_DISCOVERABLE */,
- };
-
- scan_response_data_ = {0x06 /* Length */, 0x08 /* TYPE_NAME_SHORT */, 'c', 'b', 'e', 'a', 'c'};
-}
-
-void BeaconSwarm::Tick() {
- // Rotate the advertising address.
- uint8_t* low_order_byte = address_.data();
- *low_order_byte += 1;
- Beacon::Tick();
-}
-
-} // namespace rootcanal
diff --git a/tools/rootcanal/model/devices/beacon_swarm.h b/tools/rootcanal/model/devices/beacon_swarm.h
deleted file mode 100644
index 70fe492821..0000000000
--- a/tools/rootcanal/model/devices/beacon_swarm.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "model/devices/beacon.h"
-#include "model/devices/device.h"
-
-namespace rootcanal {
-
-// Pretend to be a lot of beacons by changing the advertising address.
-class BeaconSwarm : public Beacon {
-public:
- BeaconSwarm(const std::vector<std::string>& args);
- virtual ~BeaconSwarm() = default;
-
- static std::shared_ptr<Device> Create(const std::vector<std::string>& args) {
- return std::make_shared<BeaconSwarm>(args);
- }
-
- // Return a string representation of the type of device.
- virtual std::string GetTypeString() const override { return "beacon_swarm"; }
-
- virtual void Tick() override;
-
-private:
- static bool registered_;
-};
-
-} // namespace rootcanal