It is about abstracting all hardware (related) data from the code of Enigma and plugins, so that no code in both needs to apply logic to that data.
For Enigma, and for plugins, it should be 100% transparent on what hardware the software runs.
That mains that ANY code that applies logic to the values returned, like in the examples above, need to be converted into an API method.
And note, this is about API definition, not about implementation. So given the example above, the API should define:
list: BoxInfo::getSupportedVideoModes(); => Returns a list of strings containing all video modes the hardware supports. If no modes are supported, it returns an empty list
and nothing more (well, maybe a bit more documentation and/or examples),
How this method is implemented by each team is up to them, the only requirement is that the method is defined so code can call it and get the expected result back.
So this cross-team group that I think should be setup to manage the API definition should do a few things:
- Agree on a python, C and ash shell interface, so it can be called from Python, C and ash shell
- Agree on a name for the interface, which is needed to be able to call it
- Agree on the way it will be implemented (for example a global singleton you call methods on, or something else)
- Do an inventory of the current solutions already implemented, and make sure the API has corresponding methods
- Publish the API definition so each team can migrate to it
- Setup a governing body to maintain the API (versioning, deprecation or addtion of methods, etc), making sure the teams stay up to date
As to 1, I would suggest to not do anything special for shell access, but to make it so that a Python script can be called from an ash script that would return the required data.