Skip to content

Commit ff9e77e

Browse files
authored
Merge pull request #916 from karlding/backport_vector_canfd_discovery
vector: Skip channels without CAN support
2 parents 551cc94 + 453a4b7 commit ff9e77e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

can/interfaces/vector/canlib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ def _detect_available_configs():
387387
channel_configs = get_channel_configs()
388388
LOG.info('Found %d channels', len(channel_configs))
389389
for channel_config in channel_configs:
390+
if not channel_config.channelBusCapabilities & vxlapi.XL_BUS_ACTIVE_CAP_CAN:
391+
continue
390392
LOG.info('Channel index %d: %s',
391393
channel_config.channelIndex,
392394
channel_config.name.decode('ascii'))

can/interfaces/vector/vxlapi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
XL_INTERFACE_VERSION = 3
6464
XL_INTERFACE_VERSION_V4 = 4
6565

66+
XL_BUS_ACTIVE_CAP_CAN = XL_BUS_TYPE_CAN << 16
6667
XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT = 0x80000000
6768

6869
# structure for XL_RECEIVE_MSG, XL_TRANSMIT_MSG

0 commit comments

Comments
 (0)