Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
classic.h
Go to the documentation of this file.
1
4
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 * Copyright 2024 NXP
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11#ifndef ZEPHYR_INCLUDE_BLUETOOTH_CLASSIC_H_
12#define ZEPHYR_INCLUDE_BLUETOOTH_CLASSIC_H_
13
20
21#include <stdbool.h>
22#include <string.h>
23
24#include <zephyr/sys/util.h>
25#include <zephyr/net_buf.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
41
46struct bt_br_discovery_priv {
48 uint16_t clock_offset;
50 uint8_t pscan_rep_mode;
52 uint8_t resolve_state;
53};
54
56#define BT_BR_EIR_SIZE_MAX 240
57
61 struct bt_br_discovery_priv _priv;
62
65
68
71
74};
75
86
105 struct bt_br_discovery_result *results, size_t count);
106
117
119
125 void (*recv)(const struct bt_br_discovery_result *result);
126
132 void (*timeout)(const struct bt_br_discovery_result *results,
133 size_t count);
134
136};
137
150
159
164
174
192int bt_br_set_discoverable(bool enable, bool limited);
193
212
227typedef enum bt_br_conn_req_rsp (*bt_br_conn_req_func_t)(const bt_addr_t *addr, uint32_t cod);
228
250
257bool bt_br_bond_exists(const bt_addr_t *addr);
258
266int bt_br_unpair(const bt_addr_t *addr);
267
273
280void bt_br_foreach_bond(void (*func)(const struct bt_br_bond_info *info, void *user_data),
281 void *user_data);
282
286
287#ifdef __cplusplus
288}
289#endif
293
294#endif /* ZEPHYR_INCLUDE_BLUETOOTH_CLASSIC_H_ */
Bluetooth device address definitions and utilities.
void bt_br_discovery_cb_unregister(struct bt_br_discovery_cb *cb)
Unregister discovery packet callbacks.
int bt_br_oob_get_local(struct bt_br_oob *oob)
Get BR/EDR local Out Of Band information.
void bt_br_discovery_cb_register(struct bt_br_discovery_cb *cb)
Register discovery packet callbacks.
void bt_br_foreach_bond(void(*func)(const struct bt_br_bond_info *info, void *user_data), void *user_data)
Iterate through all existing bonds of Classic.
int bt_br_discovery_stop(void)
Stop BR/EDR discovery.
int bt_br_set_connectable(bool enable, bt_br_conn_req_func_t func)
Enable/disable set controller in connectable state.
#define BT_BR_EIR_SIZE_MAX
Maximum size of Extended Inquiry Response.
Definition classic.h:56
int bt_br_discovery_start(const struct bt_br_discovery_param *param, struct bt_br_discovery_result *results, size_t count)
Start BR/EDR discovery.
enum bt_br_conn_req_rsp(* bt_br_conn_req_func_t)(const bt_addr_t *addr, uint32_t cod)
Callback type for incoming BR/EDR connection requests.
Definition classic.h:227
bt_br_conn_req_rsp
BR/EDR connection request response codes.
Definition classic.h:200
int bt_br_unpair(const bt_addr_t *addr)
Clear classic pairing information .
bool bt_br_bond_exists(const bt_addr_t *addr)
Check if a Bluetooth classic device address is bonded.
int bt_br_set_discoverable(bool enable, bool limited)
Enable/disable set controller in discoverable state.
@ BT_BR_CONN_REQ_REJECT_SECURITY
Reject connection due to insufficient security.
Definition classic.h:208
@ BT_BR_CONN_REQ_ACCEPT_PERIPHERAL
Accept connection as peripheral role.
Definition classic.h:204
@ BT_BR_CONN_REQ_ACCEPT_CENTRAL
Accept connection as central role.
Definition classic.h:202
@ BT_BR_CONN_REQ_REJECT_ADDR
Reject connection due to unacceptable device address.
Definition classic.h:210
@ BT_BR_CONN_REQ_REJECT_NO_RESOURCES
Reject connection due to insufficient resources.
Definition classic.h:206
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define BT_HCI_ERR_INSUFFICIENT_SECURITY
Definition hci_types.h:4342
#define BT_HCI_ERR_INSUFFICIENT_RESOURCES
Definition hci_types.h:4341
#define BT_HCI_ROLE_CENTRAL
Definition hci_types.h:3340
#define BT_HCI_ERR_BD_ADDR_UNACCEPTABLE
Definition hci_types.h:4343
#define BT_HCI_ROLE_PERIPHERAL
Definition hci_types.h:3341
Buffer management.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
Bluetooth Device Address.
Definition addr.h:40
Information about a bond with a remote device.
Definition classic.h:269
bt_addr_t addr
Address of the remote device.
Definition classic.h:271
Definition classic.h:118
void(* timeout)(const struct bt_br_discovery_result *results, size_t count)
The inquiry has stopped after discovery timeout.
Definition classic.h:132
void(* recv)(const struct bt_br_discovery_result *result)
An inquiry response received callback.
Definition classic.h:125
sys_snode_t node
Definition classic.h:135
BR/EDR discovery parameters.
Definition classic.h:77
uint8_t length
Maximum length of the discovery in units of 1.28 seconds.
Definition classic.h:81
bool limited
True if limited discovery procedure is to be used.
Definition classic.h:84
BR/EDR discovery result structure.
Definition classic.h:59
uint8_t eir[240]
Extended Inquiry Response.
Definition classic.h:73
bt_addr_t addr
Remote device address.
Definition classic.h:64
int8_t rssi
RSSI from inquiry.
Definition classic.h:67
uint8_t cod[3]
Class of Device.
Definition classic.h:70
Definition classic.h:160
bt_addr_t addr
BR/EDR address.
Definition classic.h:162
Misc utilities.