3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2015 Google Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #include "lib/bluetooth.h"
30 typedef void (*bt_ad_func_t)(void *data, void *user_data);
34 struct bt_ad_manufacturer_data {
35 uint16_t manufacturer_id;
40 struct bt_ad_service_data {
46 struct bt_ad *bt_ad_new(void);
48 struct bt_ad *bt_ad_ref(struct bt_ad *ad);
50 void bt_ad_unref(struct bt_ad *ad);
52 uint8_t *bt_ad_generate(struct bt_ad *ad, size_t *length);
54 bool bt_ad_add_service_uuid(struct bt_ad *ad, const bt_uuid_t *uuid);
56 bool bt_ad_remove_service_uuid(struct bt_ad *ad, bt_uuid_t *uuid);
58 void bt_ad_clear_service_uuid(struct bt_ad *ad);
60 bool bt_ad_add_manufacturer_data(struct bt_ad *ad, uint16_t manufacturer_data,
61 void *data, size_t len);
63 bool bt_ad_has_manufacturer_data(struct bt_ad *ad,
64 const struct bt_ad_manufacturer_data *data);
66 void bt_ad_foreach_manufacturer_data(struct bt_ad *ad, bt_ad_func_t func,
69 bool bt_ad_remove_manufacturer_data(struct bt_ad *ad, uint16_t manufacturer_id);
71 void bt_ad_clear_manufacturer_data(struct bt_ad *ad);
73 bool bt_ad_add_solicit_uuid(struct bt_ad *ad, const bt_uuid_t *uuid);
75 bool bt_ad_remove_solicit_uuid(struct bt_ad *ad, bt_uuid_t *uuid);
77 void bt_ad_clear_solicit_uuid(struct bt_ad *ad);
79 bool bt_ad_add_service_data(struct bt_ad *ad, const bt_uuid_t *uuid, void *data,
82 bool bt_ad_has_service_data(struct bt_ad *ad,
83 const struct bt_ad_service_data *data);
85 void bt_ad_foreach_service_data(struct bt_ad *ad, bt_ad_func_t func,
88 bool bt_ad_remove_service_data(struct bt_ad *ad, bt_uuid_t *uuid);
90 void bt_ad_clear_service_data(struct bt_ad *ad);