Skip to content
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
23 changes: 13 additions & 10 deletions can/interfaces/vector/canlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,16 +538,19 @@ def _check_can_settings(
)

# check CAN operation mode
if fd:
settings_acceptable &= bool(
bus_params_data.can_op_mode
& xldefine.XL_CANFD_BusParams_CanOpMode.XL_BUS_PARAMS_CANOPMODE_CANFD
)
elif bus_params_data.can_op_mode != 0: # can_op_mode is always 0 for cancaseXL
settings_acceptable &= bool(
bus_params_data.can_op_mode
& xldefine.XL_CANFD_BusParams_CanOpMode.XL_BUS_PARAMS_CANOPMODE_CAN20
)
# skip the check if can_op_mode is 0
# as it happens for cancaseXL, VN7600 and sometimes on other hardware (VN1640)
if bus_params_data.can_op_mode:
if fd:
settings_acceptable &= bool(
bus_params_data.can_op_mode
& xldefine.XL_CANFD_BusParams_CanOpMode.XL_BUS_PARAMS_CANOPMODE_CANFD
)
else:
settings_acceptable &= bool(
bus_params_data.can_op_mode
& xldefine.XL_CANFD_BusParams_CanOpMode.XL_BUS_PARAMS_CANOPMODE_CAN20
)

# check bitrates
if bitrate:
Expand Down