Skip to content

Adding detect_available_configs support to neovi #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2018
Merged
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: 16 additions & 0 deletions can/interfaces/ics_neovi/neovi_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,22 @@ def shutdown(self):
super(NeoViBus, self).shutdown()
self.opened = False
ics.close_device(self.dev)

@staticmethod
def _detect_available_configs():
"""Detect all configurations/channels that this interface could
currently connect with.

:rtype: Iterator[dict]
:return: an iterable of dicts, each being a configuration suitable
for usage in the interface's bus constructor.
"""
if ics is None:
return []
# TODO: add the channel(s)
return [{
'serial': NeoViBus.get_serial_number(device)
} for device in ics.find_devices()]

def _find_device(self, type_filter=None, serial=None):
if type_filter is not None:
Expand Down