MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _check_scan_status

Method _check_scan_status

actions/ble.py:189–205  ·  view source on GitHub ↗

Check if scanning is actually active by checking bluetoothctl status Returns: True if scanning, False if not scanning, None if unable to determine

(self)

Source from the content-addressed store, hash-verified

187 return status
188
189 def _check_scan_status(self) -> Optional[bool]:
190 """
191 Check if scanning is actually active by checking bluetoothctl status
192 Returns: True if scanning, False if not scanning, None if unable to determine
193 """
194 try:
195 result = subprocess.run(['bluetoothctl', 'show'],
196 capture_output=True, text=True, timeout=5)
197 if result.returncode == 0:
198 output = result.stdout.lower()
199 if 'discovering: yes' in output:
200 return True
201 elif 'discovering: no' in output:
202 return False
203 except Exception:
204 pass
205 return None
206
207 def power_on(self) -> Tuple[bool, str]:
208 """

Callers 3

get_statusMethod · 0.95
start_scanMethod · 0.95

Calls 1

runMethod · 0.45

Tested by

no test coverage detected