This callback is called form the Crazyflie API when a Crazyflie has been connected and the TOCs have been downloaded.
(self, link_uri)
| 66 | self.is_connected = True |
| 67 | |
| 68 | def _connected(self, link_uri): |
| 69 | """ This callback is called form the Crazyflie API when a Crazyflie |
| 70 | has been connected and the TOCs have been downloaded.""" |
| 71 | print('Connected to %s' % link_uri) |
| 72 | |
| 73 | mems = self._cf.mem.get_mems(MemoryElement.TYPE_1W) |
| 74 | print('Found {} 1-wire memories'.format(len(mems))) |
| 75 | if len(mems) > 0: |
| 76 | print('Writing test configuration to' |
| 77 | ' memory {}'.format(mems[0].id)) |
| 78 | |
| 79 | mems[0].vid = 0xBC |
| 80 | mems[0].pid = 0xFF |
| 81 | |
| 82 | board_name_id = OWElement.element_mapping[1] |
| 83 | board_rev_id = OWElement.element_mapping[2] |
| 84 | |
| 85 | mems[0].elements[board_name_id] = 'Test board' |
| 86 | mems[0].elements[board_rev_id] = 'A' |
| 87 | |
| 88 | mems[0].write_data(self._data_written) |
| 89 | |
| 90 | def _data_written(self, mem, addr): |
| 91 | print('Data written, reading back...') |
nothing calls this directly
no test coverage detected