Skip to main content

Host Device Communication protocol

Project description

The HDC protocol

The purpose of the Host Device Communication protocol is to simplify the communication between the firmware of a device with severely limited computing resources and the software on the computer to which it's connected via a serial communication link, like UART / USB-CDC / Virtual COM Port.

Python implementation of the HDC protocol

The hdcproto package contains the Python implementation of the HDC protocol, and it's mainly meant for the implementation of HDC-host software.

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

WARNING: The HDC-device implementation in the hdcproto package is still work in progress.

Installation

The hdcproto package is currently in pre-alpha stage, thus might be not listed by default in your graphical package management tool.
You can install it into your project's virtual environment via the usual command:

pip install hdcproto
Attention testers!

Installing from the alternative Test-PyPi repository is a bit trickier:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hdcproto

Alternatively, if you take care of installing any missing dependency yourself:

pip install --index-url https://test.pypi.org/simple/ --no-deps hdcproto

Usage

The hdcproto.host.proxy module implements generic proxy base-classes that can be used as building blocks to define proxy-classes that are specific for a given device and provide a convenient API for the HDC-host software to interact with the HDC-device.

Have a look at the hdcproto.demo.minimal sub-package, where you'll see an example of how proxy-classes are defined and how they are used to communicate with an HDC-device running the Demo_Minimal firmware example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hdcproto-0.0.8.tar.gz (33.6 kB view hashes)

Uploaded Source

Built Distribution

hdcproto-0.0.8-py3-none-any.whl (36.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page