From 43d910427dd33b0207c8173fdb0463f34f3fbe6f Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Fri, 15 Sep 2023 13:12:52 +0200 Subject: [PATCH] v2.3.9 Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/bluetoothsniffer.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pwnagotchi/plugins/default/bluetoothsniffer.py b/pwnagotchi/plugins/default/bluetoothsniffer.py index b78c93bf..e7d0aa6b 100644 --- a/pwnagotchi/plugins/default/bluetoothsniffer.py +++ b/pwnagotchi/plugins/default/bluetoothsniffer.py @@ -2,17 +2,15 @@ import logging import os import subprocess import json -import re import time -import pwnagotchi -import pwnagotchi.agent import pwnagotchi.plugins as plugins import pwnagotchi.ui.fonts as fonts from pwnagotchi.ui.components import LabeledValue from pwnagotchi.ui.view import BLACK from datetime import datetime + class BluetoothSniffer(plugins.Plugin): __author__ = 'diytechtinker' __version__ = '0.1.3' @@ -31,7 +29,6 @@ class BluetoothSniffer(plugins.Plugin): self.data = {} self.last_scan_time = 0 - def on_loaded(self): logging.info("[BtS] bluetoothsniffer plugin loaded.") logging.info("[BtS] Bluetooth devices file location: %s", self.options['devices_file']) @@ -48,7 +45,6 @@ class BluetoothSniffer(plugins.Plugin): with open(self.options['devices_file'], 'r') as f: self.data = json.load(f) - def on_ui_setup(self, ui): ui.add_element('BtS', LabeledValue(color=BLACK, label='BT SNFD', @@ -62,7 +58,6 @@ class BluetoothSniffer(plugins.Plugin): with ui._lock: ui.remove_element('BtS') - def on_ui_update(self, ui): current_time = time.time() # Checking the time elapsed since last scan @@ -70,11 +65,10 @@ class BluetoothSniffer(plugins.Plugin): self.last_scan_time = current_time #logging.info("[BtS] Bluetooth sniffed: %s", str(self.bt_sniff_info())) ui.set('BtS', str(self.bt_sniff_info())) - self.scan() - + self.scan(ui) # Method for scanning the nearby bluetooth devices - def scan(self): + def scan(self, display): logging.info("[BtS] Scanning for bluetooths...") current_time = time.time() changed = False