Skip to content

Commit

Permalink
pymavlink: support param() method for .bin and .log files
Browse files Browse the repository at this point in the history
useful in mavextra.py
  • Loading branch information
Andrew Tridgell committed May 2, 2014
1 parent 198849f commit c44d2ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pymavlink/DFReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ def check_condition(self, condition):
'''check if a condition is true'''
return mavutil.evaluate_condition(condition, self.messages)

def param(self, name, default=None):
'''convenient function for returning an arbitrary MAVLink
parameter with a default'''
if not name in self.params:
return default
return self.params[name]

class DFReader_binary(DFReader):
'''parse a binary dataflash file'''
def __init__(self, filename, zero_time_base):
Expand Down

0 comments on commit c44d2ae

Please sign in to comment.