- You
Struct
format does not match with C structure. (finalH
should be6H
) - struct.unpack(
6h
, ..) does return 6 fields. (not one with 6 elements)
So your code should looks like ..
s = struct.Struct('= B B H H 6h 6h 6h 6H')
fields = s.unpack(packet_data)
seq, _type, flags, upTimestamp = fields[:4]
x = fields[4:10]
y = fields[10:16]
z = fields[16:22]
lowTimestamp = fields[22:]