hardbyte / hardbyte/python-can

Align with the new CAN frame structure for socketcan adding optional DLC element

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

描述

### Is your feature request related to a problem? Please describe.

SocketCAN allows for passing an optional DLC element in its `can_frame` structure in addition to the length element, this allow accessing the raw DLC value that can be 0-15 (with 9-15 interpreted as 8 in classic CAN).
This feature is good for testing compliance with the ISO.
To enable this some changes are implemented in the Linux kernel and in can-utils.
You can see the change being introduced to can-utils in here: https://github.com/linux-can/can-utils/commit/c398e56afb9b60441232736e05fdfb5a525363ca

### Describe the solution you'd like

I would like to suggest an adaptation to the way CAN_FRAME_HEADER_STRUCT is being defined and un/packed.

### Describe alternatives you've considered
I did not find a way to achieve this with the current implementation.

### Additional context
See a patch used in a fork I've created that allowed me to achieve this capability.
[socktcan_over8_dlc.patch](https://github.com/hardbyte/python-can/files/15244735/socktcan_over8_dlc.patch)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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