This adds eir_get_service_data function which can be used to get a
specific service data.
return eir_total_len;
}
+
+static int match_sd_uuid(const void *data, const void *user_data)
+{
+ const struct eir_sd *sd = data;
+ const char *uuid = user_data;
+
+ return strcmp(sd->uuid, uuid);
+}
+
+struct eir_sd *eir_get_service_data(struct eir_data *eir, const char *uuid)
+{
+ GSList *l;
+
+ if (!eir || !uuid)
+ return NULL;
+
+ l = g_slist_find_custom(eir->sd_list, uuid, match_sd_uuid);
+ if (!l)
+ return NULL;
+
+ return l->data;
+}
#include <glib.h>
#include "lib/sdp.h"
+#include "lib/uuid.h"
#define EIR_FLAGS 0x01 /* flags */
#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
uint16_t did_vendor, uint16_t did_product,
uint16_t did_version, uint16_t did_source,
sdp_list_t *uuids, uint8_t *data);
+struct eir_sd *eir_get_service_data(struct eir_data *eir, const char *uuid);