Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _connected(self, link_uri):
""" This callback is called form the Crazyflie API when a Crazyflie
has been connected and the TOCs have been downloaded."""
print("Connected to %s" % link_uri)
mems = self._cf.mem.get_mems(MemoryElement.TYPE_1W)
print("Found {} 1-wire memories".format(len(mems)))
if len(mems) > 0:
print("Writing test configuration to"
" memory {}".format(mems[0].id))
mems[0].vid = 0xBC
mems[0].pid = 0xFF
board_name_id = OWElement.element_mapping[1]
board_rev_id = OWElement.element_mapping[2]
mems[0].elements[board_name_id] = "Test board"
mems[0].elements[board_rev_id] = "A"
mems[0].write_data(self._data_written)
def search_memories(self):
"""
Search and return list of 1-wire memories.
"""
if not self.connected:
raise NotConnected()
return self._cf.mem.get_mems(MemoryElement.TYPE_1W)
def _request_deck_data_update(self):
self._decks_text = ""
mems = self._helper.cf.mem.get_mems(MemoryElement.TYPE_1W)
for mem in mems:
mem.update(self._cb_deck_data_updated_signal.emit)
def _poll_anchor_positions(self):
mems = self._helper.cf.mem.get_mems(MemoryElement.TYPE_LOCO)
if len(mems) > 0:
mems[0].update(self._anchor_position_signal.emit)