mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
don't connect if already connected
This commit is contained in:
parent
932a491986
commit
4bf5f425ec
1 changed files with 4 additions and 0 deletions
|
|
@ -52,6 +52,10 @@ class BLEConnection:
|
||||||
if self.client:
|
if self.client:
|
||||||
logger.debug("Using pre-configured BleakClient.")
|
logger.debug("Using pre-configured BleakClient.")
|
||||||
assert isinstance(self.client, BleakClient)
|
assert isinstance(self.client, BleakClient)
|
||||||
|
if client.is_connected :
|
||||||
|
logger.error("Client is already connected !!! weird")
|
||||||
|
self.address = self.client.address
|
||||||
|
return self.address
|
||||||
self.address = self.client.address
|
self.address = self.client.address
|
||||||
# If a client is provided it surely does not have disconnect callback
|
# If a client is provided it surely does not have disconnect callback
|
||||||
# so recreate it as set_disconnected_callback can't be used anymore ...
|
# so recreate it as set_disconnected_callback can't be used anymore ...
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue