hardbyte / hardbyte/python-can

Using kvaser revealed issues with connect.

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

描述

bus = can.interface.Bus(interface='kvaser', channel=0, bitrate=500000)
when run this report error

File "\Lib\site-packages\can\interfaces\kvaser\canlib.py", line 563, in __init__
canIoCtlInit(
~~~~~~~~~~~~^
^^^^^^^^^^^^^^^^^^
...<2 lines>...
1,
^^
)
^
File "\Lib\site-packages\can\interfaces\kvaser\canlib.py", line 102, in __check_status_operation
raise CANLIBOperationError(function, result, arguments)
can.interfaces.kvaser.canlib.CANLIBOperationError: Function canIoCtl failed - Error in parameter [Error Code -1]

examining the original files of canlib, there is no longer a definition for canIOCTL_SET_LOCAL_TXACK.

so I commented out the following code, and it works fine now.

# enable canMSG_LOCAL_TXACK flag in received messages

# canIoCtlInit(
# self._read_handle,
# canstat.canIOCTL_SET_LOCAL_TXACK,
# ctypes.byref(ctypes.c_byte(local_echo)),
# 1,
# )

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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