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
Changes from 1 commit
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
31 changes: 0 additions & 31 deletions umodbus/common.py
Original file line number Diff line number Diff line change
@@ -99,37 +99,6 @@ def send_exception(self, exception_code: int) -> None:
self.function,
exception_code)

"""
def data_as_bits(self) -> List[int]:
bits = []

for byte in self.data:
for i in range(0, 8):
bits.append((byte >> i) & 1)

if len(bits) == self.quantity:
return bits
"""

'''
def data_as_registers(self, signed: bool = True) -> bytes:
"""
Convert bytes to tuple of integer values

:param byte_array: The byte array
:type byte_array: bytes
:param signed: Indicates if signed
:type signed: bool

:returns: Integer representation
:rtype: bytes
"""
qty = self.quantity if (self.quantity is not None) else 1
fmt = ('h' if signed else 'H') * qty

return struct.unpack('>' + fmt, self.data)
'''


class ModbusException(Exception):
"""Exception for signaling modbus errors"""