hardbyte / hardbyte/python-can

[Introspection] Expose supported nominal/data bitrate capabilities for detected CAN channels

未关闭
#2,033 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
1.6k
派生
697
PR 合并指标
30 天内没有已合并 PR

描述

Hi maintainers,

I’m integrating `python-can` into a UI tool that uses `can.interface.detect_available_configs()` to list adapters/channels.

Current situation:
- `detect_available_configs()` gives interface/channel candidates, which is great.
- But there is no standardized way to discover supported nominal bitrate(s) and CAN-FD data bitrate(s) per detected channel.
- As a result, UIs have to hardcode bitrate presets, which can be wrong for specific hardware/drivers.

Feature request:
- Add optional capability fields to auto-detected configs (or a related capability API), e.g.:
- `supported_bitrates: list[int] | None`
- `supported_data_bitrates: list[int] | None` (for FD-capable channels)
- `supports_fd: bool | None`

Example output shape:
```python
{
"interface": "socketcan",
"channel": "can0",
"supports_fd": True,
"supported_bitrates": [125000, 250000, 500000, 1000000],
"supported_data_bitrates": [1000000, 2000000, 4000000]
}

Would that make sense?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。