Skip to content

Commit

Permalink
Endianness now used in packing bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickfuller committed Jan 7, 2015
1 parent 11b10c3 commit 65138ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymodbus/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def fromRegisters(klass, registers, endian=Endian.Little):
:returns: An initialized PayloadDecoder
'''
if isinstance(registers, list): # repack into flat binary
payload = ''.join(pack('>H', x) for x in registers)
payload = ''.join(pack(endian + 'H', x) for x in registers)
return klass(payload, endian)
raise ParameterException('Invalid collection of registers supplied')

Expand Down

0 comments on commit 65138ff

Please sign in to comment.