This seems to happen to work because the data is little endian, the range is limited to 0-32767, and the code is simply reinterpret casting the raw data to the struct. It seems like it's probably worth either fixing the descriptor, using a uint32_t in the struct for consistency, or at least adding a comment to the struct, because otherwise it's alarming to stumble upon it when debugging.
The descriptor for
period
is specified as 32 bits:But the corresponding struct uses a uint16_t:
This seems to happen to work because the data is little endian, the range is limited to 0-32767, and the code is simply reinterpret casting the raw data to the struct. It seems like it's probably worth either fixing the descriptor, using a uint32_t in the struct for consistency, or at least adding a comment to the struct, because otherwise it's alarming to stumble upon it when debugging.