3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
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 #define BT_GAP_ADDR_TYPE_BREDR 0x00
28 #define BT_GAP_ADDR_TYPE_LE_PUBLIC 0x01
29 #define BT_GAP_ADDR_TYPE_LE_RANDOM 0x02
33 struct bt_gap *bt_gap_new_default(void);
34 struct bt_gap *bt_gap_new_index(uint16_t index);
36 struct bt_gap *bt_gap_ref(struct bt_gap *gap);
37 void bt_gap_unref(struct bt_gap *gap);
39 typedef void (*bt_gap_destroy_func_t)(void *user_data);
40 typedef void (*bt_gap_ready_func_t)(bool success, void *user_data);
42 bool bt_gap_set_ready_handler(struct bt_gap *gap,
43 bt_gap_ready_func_t handler, void *user_data,
44 bt_gap_destroy_func_t destroy);
46 bool bt_gap_set_static_addr(struct bt_gap *gap, uint8_t addr[6]);
47 bool bt_gap_set_local_irk(struct bt_gap *gap, uint8_t key[16]);
48 bool bt_gap_add_peer_irk(struct bt_gap *gap, uint8_t addr_type,
49 uint8_t addr[6], uint8_t key[16]);