davefiddes / openinverter-can-tool

A tool to allow configuration and operating of openinverter systems for electric vehicles over a CAN connection
MIT License
14 stars 3 forks source link

Support Extended CAN frames in CAN message mapping #5

Closed davefiddes closed 4 months ago

davefiddes commented 4 months ago

Request from a768phoenix on the OI forum asking if extended CAN frame IDs can be specified when mapping message parameters. Their BMS uses these frames when talking to the FOCCCI charge controller.

A change has been incorporated into libopeninv in https://github.com/jsphuebner/libopeninv/commit/7c97559435c5a895ed22919b086aed17bbdcfbdd which allows a small range of extended IDs to be mapped using the existing CAN SDO message mapping API. A better API allowing the full 29-bit range of extended IDs would be desirable.

This will affect how CAN IDs are represented internally, the CAN SDO API and in DBC file generation.

jsphuebner commented 4 months ago

So the current implementation already supports the full range of extended ids as 32 bits are reserved for the ID specifier.

The issue "solved" by 7c97559 is forcing the CAN hardware to register an extended filter even though the message ID is actually in the 11-bit standard range

davefiddes commented 4 months ago

Complete extended CAN frame support has now been implemented for the 0.1.0 release. The support for can maps with extended frames is limited in libopeninv currently (rx maps with CAN IDs up to 0x7ff). The protocol changes are generic, have been extensive unit tests and the feature allows maps for either TX or RX and any valid CAN ID. If a device doesn't support a feature it reports Command or parameter not supported.