Oct-10-2020, 08:10 PM
Something like this then:
00d0
ff70
0170
0120
0020
ffa0
0020
0190
00f0
00f0
0020
0150
import struct b = b'\x00\xd0\xffp\x01p\x01 \x00 \xff\xa0\x00 \x01\x90\x00\xf0\x00\xf0\x00 \x01P' size, mod = divmod(len(b), 2) if mod: print("Odd number of bytes seen. Ignoring final byte") b = b[:-1] uint16_data = struct.unpack(f'>{size}H', b) for uint in uint16_data: print(f"{uint:04x}")You can change the
>
to <
to reverse the endian order.00d0
ff70
0170
0120
0020
ffa0
0020
0190
00f0
00f0
0020
0150