openxc/openxc-python — pull request #23 by jacobhartsoch (2013-09-05 21:04:02+00:00)
Title: Added simple python code generator.

.py source code generator for the vehicle interface firmware.

Notes:

-This is just a simple proof of concept implementation.
1) currently just creates appropriate data structures so CAN translation
can be done via python

2)rather than leveraging existing python classes for json parsing and
codifying their memory state after the parse (that would be slick),
we are creating simple arrays of dicts to loosely match the C structs. This gives the most flexibility
with small Python interpreters.

3) supports a single message set, needs fixed

4) does not implement decode or filter, commands and handlers, these are the responsibility of the consumer of the module. We are trying to limit the built code to the mininum subset necessary to expose the specific CAN profile based on the json

5) This does not hide the CAN profiles in the same was as the current model. Python has limited "obfuscation", but the script could be re-architected to use locally scoped python object and expose just Filter and Decode entry points. Of course, the .pyc could still easily be dissassembled.

6) One idea as this moves along is to re-architect the resulting python so it literally only exposes the Filter and Decoder function and uses locally scoped objects to identify the messages, signals, etc This has the potential to protect the CAN profiles a bit better.