Skip to content

Commit

Permalink
Merge pull request pymodbus-dev#71 from patrickfuller/master
Browse files Browse the repository at this point in the history
Endianness now used in packing bytes
  • Loading branch information
bashwork committed Feb 18, 2015
2 parents 134f170 + 65138ff commit e61b799
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 e61b799

Please sign in to comment.