protocol: 0xc7 on the spark seems to be in big-endian
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
790d8c5e31
commit
d73da09e26
|
@ -282,7 +282,7 @@ class TestProtocolAny(unittest.TestCase):
|
||||||
self.assertEqual(request.opcode, 0xc5)
|
self.assertEqual(request.opcode, 0xc5)
|
||||||
self.assertEqual(request.length, 1)
|
self.assertEqual(request.length, 1)
|
||||||
self.assertEqual(request[0], 0x00)
|
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)
|
return NordicData([0xc7, len(data)] + data)
|
||||||
else:
|
else:
|
||||||
t = time.strftime('%y%m%d%H%M%S', time.gmtime(ts))
|
t = time.strftime('%y%m%d%H%M%S', time.gmtime(ts))
|
||||||
|
|
|
@ -878,7 +878,7 @@ class MsgGetStrokesSpark(Msg):
|
||||||
# This is an odd message, we have one request but one or two
|
# This is an odd message, we have one request but one or two
|
||||||
# replies. The 0xc7 reply is sometimes missing, unclear though when.
|
# replies. The 0xc7 reply is sometimes missing, unclear though when.
|
||||||
if reply.opcode == 0xc7:
|
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
|
# Re-execute the message but this time without a new request
|
||||||
self.requires_request = False
|
self.requires_request = False
|
||||||
|
|
Loading…
Reference in New Issue