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

Method _connected

examples/basicparam.py:72–93  ·  view source on GitHub ↗

This callback is called form the Crazyflie API when a Crazyflie has been connected and the TOCs have been downloaded.

(self, link_uri)

Source from the content-addressed store, hash-verified

70 random.seed()
71
72 def _connected(self, link_uri):
73 """ This callback is called form the Crazyflie API when a Crazyflie
74 has been connected and the TOCs have been downloaded."""
75 print('Connected to %s' % link_uri)
76
77 # Print the param TOC
78 p_toc = self._cf.param.toc.toc
79 for group in sorted(p_toc.keys()):
80 print('{}'.format(group))
81 for param in sorted(p_toc[group].keys()):
82 print('\t{}'.format(param))
83 self._param_check_list.append('{0}.{1}'.format(group, param))
84 self._param_groups.append('{}'.format(group))
85 # For every group, register the callback
86 self._cf.param.add_update_callback(group=group, name=None,
87 cb=self._param_callback)
88
89 # You can also register a callback for a specific group.name combo
90 self._cf.param.add_update_callback(group='cpu', name='flash',
91 cb=self._cpu_flash_callback)
92
93 print('')
94
95 def _cpu_flash_callback(self, name, value):
96 """Specific callback for the cpu.flash parameter"""

Callers

nothing calls this directly

Calls 1

add_update_callbackMethod · 0.80

Tested by

no test coverage detected