Skip to content

Commit

Permalink
Snoop
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Oct 23, 2023
1 parent 29d8969 commit 6ccfcc7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#

enable_foyer_probers = False
enable_foyer_probers = True
21 changes: 15 additions & 6 deletions src/tools/interop/idt/capture/platform/android/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from capture.platform.android import Android

from capture.utils import log
from . import config

logger = log.get_logger(__file__)

Expand All @@ -26,6 +27,10 @@ def __repr__(self):
s += f"{item}: {getattr(self, item)}\n"
return s

def check_snoop_log(self) -> bool:
return config.hci_log_level in self.platform.run_adb_command("getprop persist.bluetooth.btsnooplogmode",
capture_output=True).get_captured_output()

def check_capabilities(self):
self.logger.info("Checking if device has root")
self.c_has_root = self.platform.run_adb_command(
Expand All @@ -39,10 +44,14 @@ def check_capabilities(self):
self.logger.info("Checking device CPU arch")
self.c_is_64 = "8" in self.platform.run_adb_command("shell cat /proc/cpuinfo | grep rch",
capture_output=True).get_captured_output()
self.logger.info("Attempting to enable HCI snoop logs")
self.platform.run_adb_command("shell setprop persist.bluetooth.btsnooplogmode full").start_command()
self.platform.run_adb_command("shell svc bluetooth disable").start_command()
self.platform.run_adb_command("shell svc bluetooth enable").start_command()
self.c_hci_snoop_enabled = "full" in self.platform.run_adb_command("getprop persist.bluetooth.btsnooplogmode",
capture_output=True).get_captured_output()
self.c_hci_snoop_enabled = self.check_snoop_log()
if not self.c_hci_snoop_enabled:
self.logger.info("HCI not enabled, attempting to enable!")
self.platform.run_adb_command(
f"shell setprop persist.bluetooth.btsnooplogmode {config.hci_log_level}").start_command()
self.platform.run_adb_command("shell svc bluetooth disable").start_command()
self.platform.run_adb_command("shell svc bluetooth enable").start_command()
self.c_hci_snoop_enabled = self.check_snoop_log()
if not self.c_hci_snoop_enabled:
self.logger.error("Failed to enabled HCI snoop log")
self.logger.info(self)
3 changes: 2 additions & 1 deletion src/tools/interop/idt/capture/platform/android/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
#

enable_build_push_tcpdump = True
enable_bug_report = False
enable_bug_report = True
hci_log_level = "full"

0 comments on commit 6ccfcc7

Please sign in to comment.