您好,我有一个带有MCP2515 CAN总线设备的树莓,用于读取广播的全部值,这是Python中使用Python CAN的唯一来源:
import can
bus = can.interface.Bus(channel='can0', bustype='socketcan_native')
notifier = can.Notifier(bus, [can.Printer()])
我需要过滤id的结果,它是如何工作的?有人能举个例子说明制造过滤器的可能性吗?我在图书馆的网站上看了,这是过滤的网页: https://python-can.readthedocs.io/en/stable/bus.html#filtering
它是如何工作的?谢谢你的回复
应该使用
Bus
类实例的set_filters()
方法设置过滤器。参数是一个包含can_id
、一个can_mask
和一个可选的extended
键的字典的iterable查看internal api docs了解更多详细信息
我想这意味着
另一个引用[Json]https://github.com/normaldotcom/CANard/blob/master/examples/example_db.json
相关问题 更多 >
编程相关推荐