mchplnet
- mchplnet is the Python implementation of the LNet protocol.
- It implements multiple LNet services to communicate to embedded systems/microcontrollers.
- Currently only pyserial interface is supported.
- It is recommended to use the pyx2cscope package, which offers a higher-level interface.
Getting Started
- Navigate to the Examples directory in the mchplnet project to explore the available examples or create a new .py file based on your requirements.
- Import the necessary classes:
from mchplnet.interfaces.factory import InterfaceFactory
from mchplnet.interfaces.factory import InterfaceType as IType
from mchplnet.lnet import LNet
- Create an interface according to your requirements and initialize the LNet with the interface:
Option A: Auto-detection (Recommended for single device)
# Automatically detect the COM port with an LNet device
interface = InterfaceFactory.get_interface(IType.SERIAL, port="AUTO", baudrate=115200)
l_net = LNet(interface)
print(f"Connected to {interface.com_port}")
Option B: Manual port specification
# Specify the COM port explicitly
interface = InterfaceFactory.get_interface(IType.SERIAL, port="COM8", baudrate=115200)
l_net = LNet(interface)
- Use the appropriate functions, such as get_ram, to interact with variables by specifying their address and size:
var_address = 0x00000000
var_size = 4
var_value = l_net.get_ram(var_address, var_size)
logging.debug(var_value)
- To modify the value of a variable, use the put_ram function:
var_newValue = 500
l_net.put_ram(var_address, var_size, var_newValue)
Contribute
If you discover a bug or have an idea for an improvement, we encourage you to contribute! You can do so by following these steps:
- Fork the repository.
- Create a new branch for your changes.
- Make the necessary changes and commit them.
- Push your changes to your forked repository.
- Open a pull request on the main repository, describing your changes.
We appreciate your contribution!
Development Setup
To set up the development environment:
-
Clone the repository:
git clone https://github.com/X2Cscope/mchplnet.git cd mchplnet
-
Install development dependencies:
pip install -e ".[dev,docs,build]"
-
Install pre-commit hooks:
pre-commit install -
The pre-commit hook will now run automatically on each commit to ensure code quality and version consistency.
Publishing a release
Package releases are handled by GitHub Actions as part of the maintainer release workflow.
Metadata
Release files for mchplnet 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mchplnet-0.5.1.tar.gz | 30.9 kB | Without provenance | Details for mchplnet-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mchplnet-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for mchplnet-0.5.1-py3-none-any.whl |
Total release size: 65.4 kB
Release files / mchplnet-0.5.1.tar.gz
| Download URL | mchplnet-0.5.1.tar.gz |
|---|---|
| Size | 30.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f4f78bc98482b7fd35897d6e1e01a298e0db926900c7617cdda312f03c9ca4f
|
|
BLAKE2b-256 checksum How to use checksums |
92d6671606f1b79ec45e5a6f6db03da19c2f6c6b152e95f5c8e4b1110fdccab0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / mchplnet-0.5.1-py3-none-any.whl
| Download URL | mchplnet-0.5.1-py3-none-any.whl |
|---|---|
| Size | 34.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23cfd422547f327306f0c66676cd7c29a754f13f419037ec5e4a1cd65e23e5f0
|
|
BLAKE2b-256 checksum How to use checksums |
92a66dc739af50eb46c8cc9fcc2603c8a3bd740a26c43e569ba48645f3f8f9ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for mchplnet 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.