protocol: 0xc7 on the spark seems to be in big-endian

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
pull/164/head
Peter Hutterer 2019-08-14 11:58:37 +10:00
parent 790d8c5e31
commit d73da09e26
2 changed files with 2 additions and 2 deletions

View File

@ -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))

View File

@ -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