kiksotik / hdc

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

Python implementation for HDC-devices #17

Closed kiksotik closed 1 year ago

kiksotik commented 2 years ago

As already described in the python README:

Implementing HDC-devices in Python offers some interesting possibilities:

  • Mocking an HDC-device:
    • For demonstration purposes of the HDC-host software, whenever a physical device is not available.
    • For testing purposes, to create test-scenarios for the HDC-host software, which would otherwise be difficult to recreate on a physical HDC-device. e.g.: A Continuous Integration build server.
  • Implementing an actual HDC-device on sufficiently powerful hardware:
    • Because you can. ;-)
    • In most cases, though, you would be better off using more conventional technologies like gRPC or RESTful API
kiksotik commented 2 years ago

It's work in progress. Have now working descriptor base classes. Althogh mostly unrelated, the blocker now is because of pyserial only being able to connect via TCP as a client, but not a server. Since an HDC-device implemented in Python will very unlikely be used via a serial port, it is now the next step to implement a TcpServerTransport class that we can use to spawn a HDC-device process that exposes its HDC interface via TCP sockets.

kiksotik commented 1 year ago

Implemented a TCP socket server transport class, but it was actually the MockTransport class that allowed me to use unit-tests to debug and mature the Python implementation of HDC-device descriptor classes. It has proven to be a more suitable playground to implement the proof-of-concept of for example #21. Closing this issue! :-)