42#define BLUETIL_AD_INIT(b,p,s)          { .buf = b, .pos = p, .size = s } 
   47#define BLUETIL_AD_FLAGS_DEFAULT        (BLE_GAP_DISCOVERABLE | \ 
   48                                         BLE_GAP_FLAG_BREDR_NOTSUP) 
 
  111                            const void *val, 
size_t val_len);
 
  130                        char *str, 
size_t str_len);
 
  144                   const void *data, 
size_t data_len);
 
  194                                             void *buf, 
size_t buf_len,
 
 
int bluetil_ad_find(const bluetil_ad_t *ad, uint8_t type, bluetil_ad_data_t *data)
Find a specific field in the given advertising data.
 
static int bluetil_ad_add_flags(bluetil_ad_t *ad, uint8_t flags)
Convenience function to add the "flags" field.
 
int bluetil_ad_find_and_cmp(const bluetil_ad_t *ad, uint8_t type, const void *val, size_t val_len)
Find a specific field and compare its value against the given data.
 
int bluetil_ad_find_str(const bluetil_ad_t *ad, uint8_t type, char *str, size_t str_len)
Find the given field and copy its payload into a string.
 
int bluetil_ad_add(bluetil_ad_t *ad, uint8_t type, const void *data, size_t data_len)
Add a new field to the given advertising data.
 
void bluetil_ad_init(bluetil_ad_t *ad, void *buf, size_t pos, size_t size)
Initialize the given advertising data descriptor.
 
static int bluetil_ad_add_name(bluetil_ad_t *ad, const char *name)
Convenience function to add the "full name" field.
 
static int bluetil_ad_init_with_flags(bluetil_ad_t *ad, void *buf, size_t buf_len, uint8_t flags)
Convenience function for initializing the advertising data descriptor and directly adding the flags f...
 
@ BLUETIL_AD_NOTFOUND
entry not found
 
@ BLUETIL_AD_NOMEM
insufficient memory to write field
 
@ BLUETIL_AD_OK
everything went as expected
 
Struct used for returning the contents of a selected field.
 
uint8_t * data
pointer a field's payload
 
size_t len
length of the payload
 
Descriptor for a buffer containing advertising data.
 
size_t pos
current write position in the buffer
 
size_t size
overall length of the buffer
 
uint8_t * buf
buffer containing the advertising data
 
General BLE values as defined by the BT standard.