Metadata-Version: 2.1
Name: mchplnet
Version: 0.4.2
Summary: Python implementation of Microchip LNet protocol
Home-page: https://x2cscope.github.io/
License: Proprietary
Author: Yash Agarwal
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: pyserial (>=3.5,<4.0)
Requires-Dist: python-socketio (>=5.16.1,<6.0.0)
Project-URL: Documentation, https://x2cscope.github.io/
Project-URL: Repository, https://github.com/X2Cscope/mchplnet
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/X2Cscope/pyx2cscope/refs/heads/main/doc/images/pyx2cscope_logo.png" alt="PyX2CScope Logo" width="250">
</p>

# 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
1. Navigate to the Examples directory in the mchplnet project to explore the available examples or create a new .py file based on your requirements.
2. Import the necessary classes:
```
from mchplnet.interfaces.factory import InterfaceFactory
from mchplnet.interfaces.factory import InterfaceType as IType
from mchplnet.lnet import LNet
```
3. Create an interface according to your requirements and initialize the LNet with the interface:
```
interface = InterfaceFactory.get_interface(IType.SERIAL, port="COM8", baudrate=115200)
l_net = mchplnet.LNet(interface))
```
4. 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)
```
5. 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:

1. Fork the repository.
2. Create a new branch for your changes.
3. Make the necessary changes and commit them. 
4. Push your changes to your forked repository. 
5. Open a pull request on the main repository, describing your changes.

We appreciate your contribution!

## Development Setup

To set up the development environment:

1. Clone the repository:
   ```bash
   git clone https://github.com/X2Cscope/mchplnet.git
   cd mchplnet
   ```

2. Install development dependencies:
   ```bash
   pip install -r requirements.txt
   pip install -r quality.txt
   ```

3. Install pre-commit hooks:
   ```bash
   pre-commit install
   ```

4. The pre-commit hook will now run automatically on each commit to ensure code quality and version consistency.



-------------------------------------------------------------------




