MCPcopy Create free account
hub / github.com/FastLED/FastLED / close

Method close

ci/util/ble_interface.py:75–89  ·  view source on GitHub ↗

Disconnect from BLE device.

(self)

Source from the content-addressed store, hash-verified

73 print(f" [BLE] Subscribed to TX notifications")
74
75 async def close(self) -> None:
76 """Disconnect from BLE device."""
77 if self._client and self._client.is_connected:
78 try:
79 await self._client.stop_notify(BLE_CHAR_TX_UUID)
80 except KeyboardInterrupt:
81 import _thread
82
83 _thread.interrupt_main()
84 raise
85 except Exception:
86 pass
87 await self._client.disconnect()
88 print(f" [BLE] Disconnected")
89 self._client = None
90
91 async def write(self, data: str) -> None:
92 """Write string data to RX characteristic (host -> device)."""

Callers 1

run_ble_autoresearchFunction · 0.95

Calls 2

printFunction · 0.50
disconnectMethod · 0.45

Tested by

no test coverage detected