Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions dronecan/driver/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __str__(self):
return "%12.6f %12.6f %s %s '%s'" % \
(self.ts_monotonic, self.ts_real, id_str, hex_data, ascii_data)

@staticmethod
def dlc_to_datalength(dlc):
# Data Length Code 9 10 11 12 13 14 15
# Number of data bytes 12 16 20 24 32 48 64
Expand All @@ -72,6 +73,7 @@ def dlc_to_datalength(dlc):
return 48
return 64

@staticmethod
def datalength_to_dlc(data_length):
if (data_length <= 8):
return data_length
Expand Down Expand Up @@ -134,10 +136,10 @@ def set_filter_list(self, ids):
'''set list of message IDs to accept, sent to the remote capture node with mavcan'''
pass

def get_filter_list(self, ids):
'''get list of message IDs to accept, None means accept all'''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the parameters change?

Copy link
Author

@joshanne joshanne Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this looks to be a copy/paste error.

The get_filter_list function exists below with no additional parameters.
As far as I can tell, no other callers are making use of the get_filter_list while specifying additional parameters.

The only thing that should possibly be changed is to update the function comment to:

        '''get list of message IDs to accept, None means accept all'''

def get_filter_list(self):
'''get the current filter list'''
return None

def set_bus(self, busnum):
'''set the remote bus number to attach to'''
pass
Expand All @@ -146,14 +148,6 @@ def get_bus(self):
'''get the remote bus number we are attached to'''
return None

def get_filter_list(self):
'''get the current filter list'''
return None

def set_bus(self, busnum):
'''set the remote bus number to attach to'''
pass

def set_signing_passphrase(self, passphrase):
'''set MAVLink2 signing passphrase'''
pass
Expand Down
8 changes: 3 additions & 5 deletions dronecan/driver/mavcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def send_frame(self, frame):
self._tx_hook(frame)
self.tx_queue.put_nowait(frame)

@staticmethod
def is_mavlink_port(device_name, baudrate):
'''check if a device is sending mavlink'''
os.environ['MAVLINK20'] = '1'
Expand All @@ -263,8 +264,8 @@ def set_filter_list(self, ids):
self.filter_list = ids
self.tx_queue.put_nowait(ControlMessage('FilterList', self.filter_list))

def get_filter_list(self, ids):
'''set list of message IDs to accept, sent to the remote capture node with mavcan'''
def get_filter_list(self):
'''get list of message IDs to accept'''
return self.filter_list

def set_bus(self, busnum):
Expand All @@ -278,9 +279,6 @@ def get_bus(self):
'''get the remote bus number we are attached to'''
return self.bus+1

def get_filter_list(self):
'''get the current filter list'''
return self.filter_list

def passphrase_to_key(self, passphrase):
'''convert a passphrase to a 32 byte key'''
Expand Down