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
hdcprotopackage 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.
Metadata
Release files for hdcproto 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hdcproto-0.0.8.tar.gz | 33.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hdcproto-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.2 kB
Release files / hdcproto-0.0.8.tar.gz
| Download URL | hdcproto-0.0.8.tar.gz |
|---|---|
| Size | 33.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e33ade12951931cb0425a80a445ccb28dce6ca71f6fd564c3c064e86e42aef2
|
|
BLAKE2b-256 checksum How to use checksums |
fe9610e9b2ce912456ab1e0f9d87198ddfc8e1abd6f9f32403b3195b646fa137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / hdcproto-0.0.8-py3-none-any.whl
| Download URL | hdcproto-0.0.8-py3-none-any.whl |
|---|---|
| Size | 36.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e476e19ce98b1b62e54433968298f723f2f8e35065d2a71c438b8cbde26d765
|
|
BLAKE2b-256 checksum How to use checksums |
6765f46dca328d9b24e02f7456c269e726f0a382962894e4f2cc7c0f2e88c00d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|