Upload data into a buffer on the Crazyflie
(self, target_id, page, address, buff)
| 311 | page += m[(2 * i) + 1] |
| 312 | |
| 313 | def upload_buffer(self, target_id, page, address, buff): |
| 314 | """Upload data into a buffer on the Crazyflie""" |
| 315 | # print len(buff) |
| 316 | count = 0 |
| 317 | pk = CRTPPacket() |
| 318 | pk.set_header(0xFF, 0xFF) |
| 319 | pk.data = struct.pack('=BBHH', target_id, 0x14, page, address) |
| 320 | |
| 321 | for i in range(0, len(buff)): |
| 322 | pk.data.append(buff[i]) |
| 323 | |
| 324 | count += 1 |
| 325 | |
| 326 | if count > 24: |
| 327 | self.link.send_packet(pk) |
| 328 | count = 0 |
| 329 | pk = CRTPPacket() |
| 330 | pk.set_header(0xFF, 0xFF) |
| 331 | pk.data = struct.pack('=BBHH', target_id, 0x14, page, |
| 332 | i + address + 1) |
| 333 | |
| 334 | self.link.send_packet(pk) |
| 335 | |
| 336 | def read_flash(self, addr=0xFF, page=0x00): |
| 337 | """Read back a flash page from the Crazyflie and return it""" |
no test coverage detected