samsta / BatteryController

GNU General Public License v3.0
0 stars 0 forks source link

Autogenerate CAN messages #9

Open samsta opened 3 years ago

samsta commented 3 years ago

Writing the code for CAN messages is slowly becoming repetitive. Perhaps we could autogenerate them based on an XML file or similar. Heck (drawing in air through pursed lips), we could even generate them from a DBC, although that's a really horrible file format.

Alternatively, generate code and DBC from our spec?

samsta commented 3 years ago

It's been done before:

https://sourceforge.net/projects/comframe/

NiallDarwin commented 3 years ago

Looks good. Is that something you'd be willing to incorporate as-is? If so it almost looks like I could contribute here!

samsta commented 3 years ago

You mean the comFramework? Nah, I doubt that we'll be able to incorporate it as-is. It'll either need tweaking or additions, and we'd have to look carefully at any licensing issues that might arise, although I don't envisage there'd be any as we plan to open source our code anyway.

Either way, we're talking about gold plating here (hence the label), so in the short term it's definitely not needed. But if we'll ever get to a point where we support 10 battery manufacturers and 10 inverters we'll thank ourselves if we have this part automated to some extent.

If we end up actually doing this it definitely pays to have a quick look at what's out there and have a play to see what it gives us.