hardbyte / hardbyte/python-can

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

Đang mở
#2,033 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
1.6k
Fork
697
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.