kiksotik / hdc

Host Device Communication protocol
MIT License
2 stars 0 forks source link

Proxy class generator #1

Closed kiksotik closed 1 year ago

kiksotik commented 2 years ago

Since a device is able to report its capabilities via HDC-introspection it is technically possible to automatically create at least a scaffold of the proxy classes for its HDC-host implementation. This is not only useful as a Rapid Application Development tool, but might also be an interesting way to explain the HDC interface of any given device to potential HDC-host authors, who might prefer to read source-code of the proxy API, instead of unfamiliar HDC descriptors.

kiksotik commented 1 year ago

This goal benefits from improvements introduced in #21 :

kiksotik commented 1 year ago

We have realized in the context of #24, that it is quite straightforward to translate "Descriptors" into different languages:

Pending: explore to which extent it is possible to dynamically instantiate a Proxy for a device, solely based on it's descriptors and generic Proxy-classes wrapping those.

kiksotik commented 1 year ago

Yes, it is quite easy and elegant to instantiate proxy-classes based on the descriptors reported by a device. 😄 I'm about to commit a first working version, which still needs some clean-up but illustrates that the automatically generated proxy instances work as nicely as the manually authored ones.