/* Default decoder get frame count. 
Default reader can only ever service a single frame at a time. */
static int get_frame_count(const uint8_t *buffer, enum sensor_channel channel, size_t channel_idx, uint16_t *frame_count)
/* Default decoder get frame count. 
Default reader can only ever service a single frame at a time. */
static int get_frame_count(const uint8_t *buffer, enum sensor_channel channel, size_t channel_idx, uint16_t *frame_count)
{
	struct sensor_data_generic_header *header = (struct sensor_data_generic_header *)buffer;
	size_t count = 0;
	switch (channel) {
	case SENSOR_CHAN_ACCEL_XYZ:
		channel = SENSOR_CHAN_ACCEL_X;
		break;
	case SENSOR_CHAN_GYRO_XYZ:
		channel = SENSOR_CHAN_GYRO_X;
		break;
	case SENSOR_CHAN_MAGN_XYZ:
		channel = SENSOR_CHAN_MAGN_X;
		break;
	default:
		break;
	}
	for (size_t i = 0; i < header->num_channels; ++i) {
		if (header->channels[i] == channel) {
			if (channel_idx == count) {
				*frame_count = 1;
				return 0;
			}
			++count;
		}
	}
	return -ENOTSUP;
}