Skip to content
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

skip the can_op_mode check if the device reports can_op_mode=0 #1678

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

danielhrisca
Copy link
Contributor

Some device report can_op_mode=0 so the check will always fail.

For example this happened on a VN1640

can.detect_available_configs(interfaces=["vector"])
[{'interface': 'vector', 'channel': 0, 'serial': 23347, 'hw_type': <XL_HardwareType.XL_HWTYPE_VN1640: 59>, 'hw_index': 0, 'hw_channel': 0, 'supports_fd': True, 'vector_channel_config': VectorChannelConfig(name='VN1640A Channel 1', hw_type=<XL_HardwareType.XL_HWTYPE_VN1640: 59>, hw_index=0, hw_channel=0, channel_index=0, channel_mask=1, channel_capabilities=<XL_ChannelCapabilities.XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT|33554432|32768|16|4|2|XL_CHANNEL_FLAG_TIME_SYNC_RUNNING: 2181070871>, channel_bus_capabilities=<XL_BusCapabilities.XL_BUS_ACTIVE_CAP_CAN|XL_BUS_COMPATIBLE_KLINE|XL_BUS_COMPATIBLE_J1708|XL_BUS_COMPATIBLE_LIN|XL_BUS_COMPATIBLE_CAN: 67843>, is_on_bus=False, connected_bus_type=<XL_BusTypes.XL_BUS_TYPE_NONE: 0>, bus_params=VectorBusParams(bus_type=<XL_BusTypes.XL_BUS_TYPE_CAN: 1>, can=VectorCanParams(bitrate=500000, sjw=1, tseg1=4, tseg2=3, sam=1, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>), canfd=VectorCanFdParams(bitrate=500000, data_bitrate=0, sjw_abr=1, tseg1_abr=4, tseg2_abr=3, sam_abr=1, sjw_dbr=0, tseg1_dbr=0, tseg2_dbr=0, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>)), serial_number=23347, article_number=7114, transceiver_name='CANpiggy 1051cap (Highspeed)')}, 

{'interface': 'vector', 'channel': 1, 'serial': 23347, 'hw_type': <XL_HardwareType.XL_HWTYPE_VN1640: 59>, 'hw_index': 0, 'hw_channel': 1, 'supports_fd': True, 'vector_channel_config': VectorChannelConfig(name='VN1640A Channel 2', hw_type=<XL_HardwareType.XL_HWTYPE_VN1640: 59>, hw_index=0, hw_channel=1, channel_index=1, channel_mask=2, channel_capabilities=<XL_ChannelCapabilities.XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT|33554432|32768|16|4|2|XL_CHANNEL_FLAG_TIME_SYNC_RUNNING: 2181070871>, channel_bus_capabilities=<XL_BusCapabilities.XL_BUS_ACTIVE_CAP_CAN|XL_BUS_COMPATIBLE_KLINE|XL_BUS_COMPATIBLE_J1708|XL_BUS_COMPATIBLE_LIN|XL_BUS_COMPATIBLE_CAN: 67843>, 
is_on_bus=False, connected_bus_type=<XL_BusTypes.XL_BUS_TYPE_NONE: 0>, bus_params=VectorBusParams(bus_type=<XL_BusTypes.XL_BUS_TYPE_CAN: 1>, can=VectorCanParams(bitrate=500000, sjw=1, tseg1=4, tseg2=3, sam=1, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>), canfd=VectorCanFdParams(bitrate=500000, data_bitrate=0, sjw_abr=1, tseg1_abr=4, tseg2_abr=3, sam_abr=1, sjw_dbr=0, tseg1_dbr=0, tseg2_dbr=0, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>)), serial_number=23347, article_number=7114, transceiver_name='CANpiggy 1051cap (Highspeed)')}, 

{'interface': 'vector', 'channel': 2, 'serial': 23347, 'hw_type': <XL_HardwareType.XL_HWTYPE_VN1640: 59>, 'hw_index': 0, 'hw_channel': 2, 'supports_fd': True, 'vector_channel_config': VectorChannelConfig(name='VN1640A Channel 3', hw_type=<XL_HardwareType.XL_HWTYPE_VN1640: 59>, hw_index=0, hw_channel=2, channel_index=2, channel_mask=4, channel_capabilities=<XL_ChannelCapabilities.XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT|33554432|32768|16|4|2|XL_CHANNEL_FLAG_TIME_SYNC_RUNNING: 2181070871>, channel_bus_capabilities=<XL_BusCapabilities.XL_BUS_ACTIVE_CAP_CAN|XL_BUS_COMPATIBLE_J1708|XL_BUS_COMPATIBLE_LIN|XL_BUS_COMPATIBLE_CAN: 65795>, 
is_on_bus=True, connected_bus_type=<XL_BusTypes.XL_BUS_TYPE_CAN: 1>, bus_params=VectorBusParams(bus_type=<XL_BusTypes.XL_BUS_TYPE_CAN: 1>, can=VectorCanParams(bitrate=500000, sjw=16, tseg1=63, tseg2=16, sam=0, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>), canfd=VectorCanFdParams(bitrate=500000, data_bitrate=2000000, sjw_abr=16, tseg1_abr=63, tseg2_abr=16, sam_abr=0, sjw_dbr=4, tseg1_dbr=15, tseg2_dbr=4, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>)), serial_number=23347, article_number=7114, transceiver_name='CANpiggy 1051cap (Highspeed)')}, 

{'interface': 'vector', 'channel': 3, 'serial': 23347, 'hw_type': <XL_HardwareType.XL_HWTYPE_VN1640: 59>, 'hw_index': 0, 'hw_channel': 3, 'supports_fd': True, 'vector_channel_config': VectorChannelConfig(name='VN1640A Channel 4', hw_type=<XL_HardwareType.XL_HWTYPE_VN1640: 59>, hw_index=0, hw_channel=3, channel_index=3, channel_mask=8, channel_capabilities=<XL_ChannelCapabilities.XL_CHANNEL_FLAG_CANFD_ISO_SUPPORT|33554432|32768|16|4|2|XL_CHANNEL_FLAG_TIME_SYNC_RUNNING: 2181070871>, channel_bus_capabilities=<XL_BusCapabilities.XL_BUS_ACTIVE_CAP_CAN|XL_BUS_COMPATIBLE_J1708|XL_BUS_COMPATIBLE_LIN|XL_BUS_COMPATIBLE_CAN: 65795>, is_on_bus=False, connected_bus_type=<XL_BusTypes.XL_BUS_TYPE_NONE: 0>, bus_params=VectorBusParams(bus_type=<XL_BusTypes.XL_BUS_TYPE_CAN: 1>, can=VectorCanParams(bitrate=500000, sjw=1, tseg1=4, tseg2=3, sam=1, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>), canfd=VectorCanFdParams(bitrate=500000, data_bitrate=0, sjw_abr=1, tseg1_abr=4, tseg2_abr=3, sam_abr=1, sjw_dbr=0, tseg1_dbr=0, tseg2_dbr=0, output_mode=<XL_OutputMode.XL_OUTPUT_MODE_NORMAL: 1>, can_op_mode=<XL_CANFD_BusParams_CanOpMode.0: 0>)), serial_number=23347, article_number=7114, transceiver_name='CANpiggy 1051cap (Highspeed)')}, ]

@zariiii9003 zariiii9003 merged commit b0ba12f into hardbyte:develop Oct 12, 2023
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants