jumping indices of values in buffer

48 Views Asked by At

I am currently testing some things with an accelerometer and its iio buffer and there is something that confuses me. The sensor does have four different scan elements: x, y, z and a timestamp. The indices of those values are:

x = 0, y = 1, z = 2 and time = 3. So far so good. If I enable all available scan elements the order of the entries is set according to the description.

everything enabled:

0000010 f758 011c 3f64 c0b0 be90 0bfe 499f 0004
0000020 f724 0134 3f58 c0b0 3f2f 10ab 499f 0004

But once I have gaps, for example if I disable the scan element for y, the z value jumps onto index 1 and my buffer looks like this:

x, z and time:

0000010 f720 3f70 0000 0000 722a 5c13 4946 0004
0000020 f728 3f74 0000 0000 0958 60c0 4946 0004

z and time:

0000010 3f6c 0000 0000 0000 ca0b 6ef1 48be 0004
0000020 3f44 0000 0000 0000 edf7 739e 48be 0004

only x and z:

0000010 f720 3f48 f748 3f54 f744 3f5c f75c 3f68
0000020 f750 3f78 f738 3f80 f718 3f64 f700 3f50

I could not find further information on this but I am a bit confused and surprised that the scan elements do not respect their given index once the timestamp is activated and there is an index gap. Is this the normal behavior or is this some stuff that the current sensor driver mixes up?

0

There are 0 best solutions below