Skip to content

Commit debf453

Browse files
remove unused functions data_as_bits and data_as_registers from common module
1 parent 53c6694 commit debf453

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

umodbus/common.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -99,37 +99,6 @@ def send_exception(self, exception_code: int) -> None:
9999
self.function,
100100
exception_code)
101101

102-
"""
103-
def data_as_bits(self) -> List[int]:
104-
bits = []
105-
106-
for byte in self.data:
107-
for i in range(0, 8):
108-
bits.append((byte >> i) & 1)
109-
110-
if len(bits) == self.quantity:
111-
return bits
112-
"""
113-
114-
'''
115-
def data_as_registers(self, signed: bool = True) -> bytes:
116-
"""
117-
Convert bytes to tuple of integer values
118-
119-
:param byte_array: The byte array
120-
:type byte_array: bytes
121-
:param signed: Indicates if signed
122-
:type signed: bool
123-
124-
:returns: Integer representation
125-
:rtype: bytes
126-
"""
127-
qty = self.quantity if (self.quantity is not None) else 1
128-
fmt = ('h' if signed else 'H') * qty
129-
130-
return struct.unpack('>' + fmt, self.data)
131-
'''
132-
133102

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

0 commit comments

Comments
 (0)