/* Checks if the header already contains a given channel.  */
static int check_header_contains_channel(const struct sensor_data_generic_header *header, enum sensor_channel channel, int num_channels)
/* Checks if the header already contains a given channel.  */
static int check_header_contains_channel(const struct sensor_data_generic_header *header, enum sensor_channel channel, int num_channels)
{
	__ASSERT_NO_MSG(!SENSOR_CHANNEL_3_AXIS(channel));
	for (int i = 0; i < num_channels; ++i) {
		if (header->channels[i] == channel) {
			return i;
		}
	}
	return -1;
}