Loading...
Searching...
No Matches

Interface for the generic BLE advertising data processing module. More...

Detailed Description

Interface for the generic BLE advertising data processing module.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file ad.h.

#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include "net/ble.h"
+ Include dependency graph for ad.h:

Go to the source code of this file.

Data Structures

struct  bluetil_ad_data_t
 Struct used for returning the contents of a selected field. More...
 
struct  bluetil_ad_t
 Descriptor for a buffer containing advertising data. More...
 

Macros

#define BLUETIL_AD_INIT(b, p, s)   { .buf = b, .pos = p, .size = s }
 Static initializer for the advertising data structure.
 
#define BLUETIL_AD_FLAGS_DEFAULT
 Default flags to set when advertising BLE devices.
 

Enumerations

enum  { BLUETIL_AD_OK = 0 , BLUETIL_AD_NOTFOUND = -1 , BLUETIL_AD_NOMEM = -2 }
 Return values used by the bluetil_ad module. More...
 

Functions

void bluetil_ad_init (bluetil_ad_t *ad, void *buf, size_t pos, size_t size)
 Initialize the given advertising data descriptor.
 
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.
 
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.
 
static int bluetil_ad_add_flags (bluetil_ad_t *ad, uint8_t flags)
 Convenience function to add the "flags" field.
 
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 field.