19#ifndef BLE_GAP_ADVERTISINGDATAPARSER_H
20#define BLE_GAP_ADVERTISINGDATAPARSER_H
23#include "platform/Span.h"
25#include "ble/gap/AdvertisingDataTypes.h"
73 if (position >= (
size_t) data.
size()) {
78 if (current_length() == 0) {
82 if (position + current_length() >= (
size_t) data.
size()) {
99 data.
subspan(position + VALUE_INDEX, current_length() - (TYPE_SIZE))
102 position += (DATA_SIZE_SIZE + current_length());
115 uint8_t current_length()
const {
116 return data[position + DATA_SIZE_INDEX];
Parse and iterate over advertising data.
AdvertisingDataParser(mbed::Span< const uint8_t > data)
Build a parser from an array of bytes.
element_t next()
Return the next advertising data element.
void reset()
Reset the parser.
bool hasNext() const
Return if there is advertising data element left to parse.
Entry namespace for all BLE API definitions.
Representation of an Advertising Data element.
type
struct scoped enum wrapped by the class
Nonowning view to a sequence of contiguous elements.
Span< element_type, Count==SPAN_DYNAMIC_EXTENT ? Extent - Offset :Count > subspan() const
Create a subspan that is a view of other Count elements; the view starts at element Offset.
index_type size() const
Return the size of the sequence viewed.