Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mechanism for hosts to adjust their behavior based on HDC-spec version reported by device #11

Open
kiksotik opened this issue Oct 28, 2022 · 1 comment
Labels
enhancement New feature or request Python About the hdcproto Python package

Comments

@kiksotik
Copy link
Owner

HDC-spec mandates all devices, also those compliant with future versions of HDC-spec, to reply to the MessageTypeID=0xF0 with a sting like "HDC 1.0". This was implemented in issue #4

This issue is about designing an (elegant?) mechanism for HDC-host implementations to cope with devices that are compliant to different HDC-spec versions.

Some approaches, sorted from simple to complex:

  • Refuse to communicate at all with devices compliant to a different HDC-spec version.
  • Tolerate older MINOR versions of HDC-spec and suppress proxies for their missing capabilities.
  • Use a different hdcproto.host.router.MessageRouter class, depending on the MAJOR version of the HDC-spec of a device.
@kiksotik kiksotik added the enhancement New feature or request label Oct 28, 2022
@kiksotik kiksotik added the Python About the hdcproto Python package label Nov 11, 2022
@kiksotik
Copy link
Owner Author

The mechanism, as it's now pretty obvious, will be through a proxy factory, like the one I'm about to commit as DeviceProxyBase.proxy_factory().
The factory is given the full device-descriptor which contains at the top-level the HDC-version string. Based on its value either parametrized proxy classes or completely different proxy-class-modules can be instantiated.
This is still a potentiality and not yet a reality, but the roadmap is pretty clear now. 😄

kiksotik added a commit that referenced this issue Nov 22, 2022
…on and customizable proxy factory.

First working version of fully automated proxy creation, based on the descriptors reported by a device.
Generic proxy classes get customized with information contained in descriptors.

Even more customization is possible via the proxy factory. Not only custom proxy classes can be instantiated, but also descriptors and constructors can be "tweaked".

Transitioning from the obsolete "introspection" architecture to the fully IDL based architecture is now complete!

The proxy factory is also the obvious way how proxies will in future be able to adapt to different HDC protocol versions.

Fixes #1
Fixes #24
Work in progress on #11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Python About the hdcproto Python package
Projects
None yet
Development

No branches or pull requests

1 participant