/* Returns the bt_data structure that is currently being read. 
If the structure has been fully read, the function iterates to the next */
static const struct bt_data* ad_stream_current_ltv_update(struct ad_stream *stream)
/* Returns the bt_data structure that is currently being read. 
If the structure has been fully read, the function iterates to the next */
static const struct bt_data* ad_stream_current_ltv_update(struct ad_stream *stream)
{
	const struct bt_data *current_ltv = &stream->ad[stream->ad_index].data[stream->data_index];
	const bool done_reading_ltv = (stream->current_ltv_offset == current_ltv->data_len + 2);
	if (done_reading_ltv) {
		stream->current_ltv_offset = 0;
		if (stream->data_index + 1 == stream->ad[stream->ad_index].len) {
			stream->data_index = 0;
			stream->ad_index++;
		} else {
			stream->data_index++;
		}
	}
	if (stream->ad_index == stream->ad_len) {
		return NULL;
	} else {
		return &stream->ad[stream->ad_index].data[stream->data_index];
	}
}