diff --git a/test/test_messages.py b/test/test_messages.py index d692fab..a3f40c6 100644 --- a/test/test_messages.py +++ b/test/test_messages.py @@ -282,7 +282,7 @@ class TestProtocolAny(unittest.TestCase): self.assertEqual(request.opcode, 0xc5) self.assertEqual(request.length, 1) self.assertEqual(request[0], 0x00) - data = list(count.to_bytes(4, byteorder='little')) + data = list(count.to_bytes(4, byteorder='big')) return NordicData([0xc7, len(data)] + data) else: t = time.strftime('%y%m%d%H%M%S', time.gmtime(ts)) diff --git a/tuhi/protocol.py b/tuhi/protocol.py index d784bc0..76cb5a9 100644 --- a/tuhi/protocol.py +++ b/tuhi/protocol.py @@ -878,7 +878,7 @@ class MsgGetStrokesSpark(Msg): # This is an odd message, we have one request but one or two # replies. The 0xc7 reply is sometimes missing, unclear though when. if reply.opcode == 0xc7: - self.count = int.from_bytes(reply[0:4], byteorder='little') + self.count = int.from_bytes(reply[0:4], byteorder='big') # Re-execute the message but this time without a new request self.requires_request = False