MCPcopy Create free account
hub / github.com/bitcraze/crazyflie-lib-python / wait_for_connection

Method wait_for_connection

examples/flash-memory.py:66–81  ·  view source on GitHub ↗

Busy loop until connection is established. Will abort after timeout (seconds). Return value is a boolean, whether connection could be established.

(self, timeout=10)

Source from the content-addressed store, hash-verified

64 self._cf.close_link()
65
66 def wait_for_connection(self, timeout=10):
67 """
68 Busy loop until connection is established.
69
70 Will abort after timeout (seconds). Return value is a boolean, whether
71 connection could be established.
72
73 """
74 start_time = datetime.datetime.now()
75 while True:
76 if self.connected:
77 return True
78 now = datetime.datetime.now()
79 if (now - start_time).total_seconds() > timeout:
80 return False
81 time.sleep(0.5)
82
83 def search_memories(self):
84 """

Callers 1

flash-memory.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected