Skip to content

Commit e8c2ee9

Browse files
authored
Merge pull request #641 from jsee23/vectorCanFdConfig
vector: specify CAN FD support in config detection
2 parents 12eae4d + 407c16c commit e8c2ee9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

can/interfaces/vector/canlib.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ def _detect_available_configs():
474474
channel_configs = get_channel_configs()
475475
LOG.info("Found %d channels", len(channel_configs))
476476
for channel_config in channel_configs:
477+
if not channel_config.channelBusCapabilities & vxlapi.XL_BUS_ACTIVE_CAP_CAN:
478+
continue
477479
LOG.info(
478480
"Channel index %d: %s",
479481
channel_config.channelIndex,
@@ -484,6 +486,10 @@ def _detect_available_configs():
484486
"interface": "vector",
485487
"app_name": None,
486488
"channel": channel_config.channelIndex,
489+
"supports_fd": bool(
490+
channel_config.channelBusCapabilities
491+
& vxlapi.XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT
492+
),
487493
}
488494
)
489495
return configs

can/interfaces/vector/vxlapi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
XL_INTERFACE_VERSION = 3
118118
XL_INTERFACE_VERSION_V4 = 4
119119

120+
XL_BUS_ACTIVE_CAP_CAN = XL_BUS_TYPE_CAN << 16
120121
XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT = 0x80000000
121122

122123
# structure for XL_RECEIVE_MSG, XL_TRANSMIT_MSG

0 commit comments

Comments
 (0)