Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all missing docstrings and typing hints, improve docs, fix some but not all bugs #39

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3fa00ee
add private functions to documentation, improve summary
brainelectronics Dec 16, 2022
e81b68a
reorder API documentation modules
brainelectronics Dec 16, 2022
cb36e4f
add doc strings and typing hints in common module, see #27
brainelectronics Dec 16, 2022
9beeda2
add description to all constant modbus values
brainelectronics Dec 16, 2022
ed0f82d
add docstrings and summary for modbus module, see also #27
brainelectronics Dec 16, 2022
ae6ef0f
add doc strings and typing hints in serial module, see #27
brainelectronics Dec 16, 2022
0e315ac
add doc strings and typing hints in tcp module, see #27
brainelectronics Dec 16, 2022
745e939
validate reponse data of write_multiple_registers with respect to val…
brainelectronics Dec 16, 2022
c6c61cb
add doc strings and typing hints in functions module, see #27
brainelectronics Dec 16, 2022
7e75392
enable reading more than 8 coils in a row, fix #36
brainelectronics Dec 16, 2022
a0fde44
add example coil definition with more than 8 coils to verify fix of #36
brainelectronics Dec 16, 2022
fabb9d9
add test for reading more than 8 coils in a row to verify fix of #36
brainelectronics Dec 16, 2022
23e3280
add negative HREG value in example JSON
brainelectronics Dec 16, 2022
99f0c6d
add test for reading a negative holding register value
brainelectronics Dec 16, 2022
16869a4
fix writing multiple coils in TCP, resolve #22
brainelectronics Dec 17, 2022
0cbb444
add test to verify write multiple coils fix #22, #38 is still open an…
brainelectronics Dec 17, 2022
c5ccd28
document usage of coil reading and writing, relates to #15 and #22
brainelectronics Dec 17, 2022
f0d06e1
document usage of discrete input reading
brainelectronics Dec 17, 2022
0b80c6a
comment unused common function data_as_registers
brainelectronics Dec 17, 2022
9b0662b
fix writing multiple registers in TCP, resolve #23
brainelectronics Dec 17, 2022
75c1b7e
add test to verify write multiple registers fix #23
brainelectronics Dec 17, 2022
dcb537c
document usage of holding register reading and writing, relates to #23
brainelectronics Dec 17, 2022
ce220e1
add is_bound property to TCPServer class
brainelectronics Dec 17, 2022
d0b1415
document usage of input registers reading
brainelectronics Dec 17, 2022
dd6deca
simplify _process_write_access logic of TCP client
brainelectronics Dec 17, 2022
072f5c2
update changelog
brainelectronics Dec 17, 2022
4ab4d1c
remove not yet ready modbus register files, accidentially added
brainelectronics Dec 17, 2022
53c6694
use MSB and LSB data properly in bytes_to_bool unit test, see #36
brainelectronics Dec 17, 2022
debf453
remove unused functions data_as_bits and data_as_registers from commo…
brainelectronics Dec 17, 2022
3e8a376
hightlight notes and warnings of Usage documentation in Sphinx suppor…
brainelectronics Dec 17, 2022
c1e51cb
return only requested amount of registers during read request, contri…
brainelectronics Dec 27, 2022
9934dd3
add unittest for reading coils, holding registers, input registers an…
brainelectronics Dec 27, 2022
b177204
update changelog and mention partial data request fix, see #35
brainelectronics Dec 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ described in the [installation section](#install-package-on-board-with-pip)
the following commands can be used to request a coil state of a target/client
device. Further usage examples can be found in the
[examples folder][ref-examples-folder] and in the
[Micropython section of USAGE](USAGE.md#micropython)
[Micropython section of USAGE](USAGE.md)

#### TCP

Expand Down Expand Up @@ -175,7 +175,7 @@ of this library.

* **sfera-labs** - *Initial work* - [giampiero7][ref-sferalabs-exo-sense]
* **pycom** - *Initial Modbus work* - [pycom-modbus][ref-pycom-modbus]
* **pfalcon** - *Initial MicroPython unittest module* - [micropython-unittest][ref-pfalcon-unittest]:
* **pfalcon** - *Initial MicroPython unittest module* - [micropython-unittest][ref-pfalcon-unittest]

<!-- Links -->
[ref-sferalabs-exo-sense]: https://github.com/sfera-labs/exo-sense-py-modbus
Expand Down
29 changes: 28 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- ## [Unreleased] -->

## Released
## [2.1.0] - 2022-12-27
### Added
- Typing hints available for all functions of [umodbus](umodbus), see #27
- Docstrings available for all constants, functions and classes of [umodbus](umodbus/), see #27
- Test for reading more than 8 coils in a row to verify fix of #36
- Test for reading single negative holding register value
- Test for writing multiple coils to verify fix of #22
- Test for writing multiple registers to verify fix of #23
- Usage documentation for coil, discrete inputs, holding register and input register usage
- Modbus TCP IP and port binding can be checked with `is_bound` property in [tcp.py](umodbus/tcp.py)

### Changed
- Reordered modules of API documentation
- `data_as_registers` and `data_as_bits` of [common.py](umodbus/common.py) removed
- Send illegal function code `0x01` if a register other than coil or holding register is requested to be set
- Simplified `_process_write_access` logic of [tcp.py](umodbus/tcp.py)

### Fixed
- Typing hints of function input parameters and return values
- Response data of multiple changed registers (`write_multiple_registers`) is validated with respect to the provided `signed` flag in [serial.py](umodbus/serial.py) and [tcp.py](umodbus/tcp.py), see #23
- Enable reading more than 8 coils in a row, see #36
- Writing multiple coils in TCP, see #22
- Writing multiple registers in TCP, see #23
- Unit test `test_bytes_to_bool` uses MSB and LSB data correctly
- Only requested amount of registers are returned by `_process_read_access` logic of [tcp.py](umodbus/tcp.py), see #35

## [2.0.0] - 2022-12-03
### Added
- Perform MicroPython based unittests on every `Test` workflow run
Expand Down Expand Up @@ -151,8 +177,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- PEP8 style issues on all files of [`lib/uModbus`](lib/uModbus)

<!-- Links -->
[Unreleased]: https://github.com/brainelectronics/micropython-modbus/compare/2.0.0...develop
[Unreleased]: https://github.com/brainelectronics/micropython-modbus/compare/2.1.0...develop

[2.1.0]: https://github.com/brainelectronics/micropython-modbus/tree/2.1.0
[2.0.0]: https://github.com/brainelectronics/micropython-modbus/tree/2.0.0
[1.2.0]: https://github.com/brainelectronics/micropython-modbus/tree/1.2.0
[1.1.1]: https://github.com/brainelectronics/micropython-modbus/tree/1.1.1
Expand Down
Loading