Skip to content

Commit

Permalink
Merge pull request #406 from bitcraze/krichardsson/log-reset
Browse files Browse the repository at this point in the history
Add reset method to the log sub system
  • Loading branch information
krichardsson authored Jun 27, 2023
2 parents 1f2c361 + 5703871 commit f341d63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cflib/crazyflie/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,13 @@ def add_config(self, logconf):
'The log configuration is too large or has an invalid '
'parameter')

def reset(self):
"""
Reset the log system and remove all log blocks
"""
self.log_blocks = []
self._send_reset_packet()

def refresh_toc(self, refresh_done_callback, toc_cache):
"""Start refreshing the table of loggale variables"""

Expand All @@ -517,6 +524,9 @@ def refresh_toc(self, refresh_done_callback, toc_cache):
self._refresh_callback = refresh_done_callback
self.toc = None

self._send_reset_packet()

def _send_reset_packet(self):
pk = CRTPPacket()
pk.set_header(CRTPPort.LOGGING, CHAN_SETTINGS)
pk.data = (CMD_RESET_LOGGING,)
Expand Down

0 comments on commit f341d63

Please sign in to comment.