Skip to content

Commit 5124afc

Browse files
committed
Merge pull request #111 from Letitflow/python3
FIX: Ability to chose Endianness in fromRegisters function
2 parents d7fc4f1 + e2699c6 commit 5124afc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymodbus/payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def fromRegisters(klass, registers, endian=Endian.Little):
205205
:returns: An initialized PayloadDecoder
206206
'''
207207
if isinstance(registers, list): # repack into flat binary
208-
payload = b''.join(pack('>H', x) for x in registers)
208+
payload = b''.join(pack(endian + 'H', x) for x in registers)
209209
return klass(payload, endian)
210210
raise ParameterException('Invalid collection of registers supplied')
211211

0 commit comments

Comments
 (0)