Zephyr Project API  3.4.0
A Scalable Open Source RTOS
conn.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_CONN_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_CONN_H_
12
20#include <stdbool.h>
21#include <stdint.h>
22
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
35struct bt_conn;
36
43};
44
52#define BT_LE_CONN_PARAM_INIT(int_min, int_max, lat, to) \
53{ \
54 .interval_min = (int_min), \
55 .interval_max = (int_max), \
56 .latency = (lat), \
57 .timeout = (to), \
58}
59
67#define BT_LE_CONN_PARAM(int_min, int_max, lat, to) \
68 ((struct bt_le_conn_param[]) { \
69 BT_LE_CONN_PARAM_INIT(int_min, int_max, lat, to) \
70 })
71
77#define BT_LE_CONN_PARAM_DEFAULT BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, \
78 BT_GAP_INIT_CONN_INT_MAX, \
79 0, 400)
80
85};
86
88enum {
91
94
97};
98
104};
105
111#define BT_CONN_LE_PHY_PARAM_INIT(_pref_tx_phy, _pref_rx_phy) \
112{ \
113 .options = BT_CONN_LE_PHY_OPT_NONE, \
114 .pref_tx_phy = (_pref_tx_phy), \
115 .pref_rx_phy = (_pref_rx_phy), \
116}
117
123#define BT_CONN_LE_PHY_PARAM(_pref_tx_phy, _pref_rx_phy) \
124 ((struct bt_conn_le_phy_param []) { \
125 BT_CONN_LE_PHY_PARAM_INIT(_pref_tx_phy, _pref_rx_phy) \
126 })
127
129#define BT_CONN_LE_PHY_PARAM_1M BT_CONN_LE_PHY_PARAM(BT_GAP_LE_PHY_1M, \
130 BT_GAP_LE_PHY_1M)
131
133#define BT_CONN_LE_PHY_PARAM_2M BT_CONN_LE_PHY_PARAM(BT_GAP_LE_PHY_2M, \
134 BT_GAP_LE_PHY_2M)
135
137#define BT_CONN_LE_PHY_PARAM_CODED BT_CONN_LE_PHY_PARAM(BT_GAP_LE_PHY_CODED, \
138 BT_GAP_LE_PHY_CODED)
139
141#define BT_CONN_LE_PHY_PARAM_ALL BT_CONN_LE_PHY_PARAM(BT_GAP_LE_PHY_1M | \
142 BT_GAP_LE_PHY_2M | \
143 BT_GAP_LE_PHY_CODED, \
144 BT_GAP_LE_PHY_1M | \
145 BT_GAP_LE_PHY_2M | \
146 BT_GAP_LE_PHY_CODED)
147
158};
159
166};
167
173#define BT_CONN_LE_DATA_LEN_PARAM_INIT(_tx_max_len, _tx_max_time) \
174{ \
175 .tx_max_len = (_tx_max_len), \
176 .tx_max_time = (_tx_max_time), \
177}
178
184#define BT_CONN_LE_DATA_LEN_PARAM(_tx_max_len, _tx_max_time) \
185 ((struct bt_conn_le_data_len_param[]) { \
186 BT_CONN_LE_DATA_LEN_PARAM_INIT(_tx_max_len, _tx_max_time) \
187 })
188
190#define BT_LE_DATA_LEN_PARAM_DEFAULT \
191 BT_CONN_LE_DATA_LEN_PARAM(BT_GAP_DATA_LEN_DEFAULT, \
192 BT_GAP_DATA_TIME_DEFAULT)
193
195#define BT_LE_DATA_LEN_PARAM_MAX \
196 BT_CONN_LE_DATA_LEN_PARAM(BT_GAP_DATA_LEN_MAX, \
197 BT_GAP_DATA_TIME_MAX)
198
210struct bt_conn *bt_conn_ref(struct bt_conn *conn);
211
218void bt_conn_unref(struct bt_conn *conn);
219
236void bt_conn_foreach(int type, void (*func)(struct bt_conn *conn, void *data),
237 void *data);
238
251struct bt_conn *bt_conn_lookup_addr_le(uint8_t id, const bt_addr_le_t *peer);
252
259const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn);
260
271uint8_t bt_conn_index(const struct bt_conn *conn);
272
274enum {
286};
287
304#if defined(CONFIG_BT_USER_PHY_UPDATE)
306#endif /* defined(CONFIG_BT_USER_PHY_UPDATE) */
307
308#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
309 /* Connection maximum single fragment parameters */
311#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
312};
313
321#define BT_CONN_INTERVAL_TO_MS(interval) ((interval) * 5U / 4U)
322
327#define BT_CONN_INTERVAL_TO_US(interval) ((interval) * 1250U)
328
331 const bt_addr_t *dst;
332};
333
334enum {
337};
338
348};
349
351typedef enum __packed {
367
374};
375
384};
385
387#define BT_CONN_ROLE_MASTER __DEPRECATED_MACRO BT_CONN_ROLE_CENTRAL
388#define BT_CONN_ROLE_SLAVE __DEPRECATED_MACRO BT_CONN_ROLE_PERIPHERAL
389
399 union {
404 };
409};
410
413
416};
417
420
423
426};
427
436
439
442
445
446 union {
449
452 };
453};
454
466};
467
470
473
476
479};
480
492};
493
501int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info);
502
518int bt_conn_get_remote_info(struct bt_conn *conn,
519 struct bt_conn_remote_info *remote_info);
520
529int bt_conn_le_get_tx_power_level(struct bt_conn *conn,
530 struct bt_conn_le_tx_power *tx_power_level);
531
543int bt_conn_le_param_update(struct bt_conn *conn,
544 const struct bt_le_conn_param *param);
545
553int bt_conn_le_data_len_update(struct bt_conn *conn,
554 const struct bt_conn_le_data_len_param *param);
555
566int bt_conn_le_phy_update(struct bt_conn *conn,
567 const struct bt_conn_le_phy_param *param);
568
591int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason);
592
593enum {
596
602
610};
611
613
616
619
622
628
634
643};
644
651#define BT_CONN_LE_CREATE_PARAM_INIT(_options, _interval, _window) \
652{ \
653 .options = (_options), \
654 .interval = (_interval), \
655 .window = (_window), \
656 .interval_coded = 0, \
657 .window_coded = 0, \
658 .timeout = 0, \
659}
660
667#define BT_CONN_LE_CREATE_PARAM(_options, _interval, _window) \
668 ((struct bt_conn_le_create_param[]) { \
669 BT_CONN_LE_CREATE_PARAM_INIT(_options, _interval, _window) \
670 })
671
675#define BT_CONN_LE_CREATE_CONN \
676 BT_CONN_LE_CREATE_PARAM(BT_CONN_LE_OPT_NONE, \
677 BT_GAP_SCAN_FAST_INTERVAL, \
678 BT_GAP_SCAN_FAST_INTERVAL)
679
684#define BT_CONN_LE_CREATE_CONN_AUTO \
685 BT_CONN_LE_CREATE_PARAM(BT_CONN_LE_OPT_NONE, \
686 BT_GAP_SCAN_FAST_INTERVAL, \
687 BT_GAP_SCAN_FAST_WINDOW)
688
709 const struct bt_conn_le_create_param *create_param,
710 const struct bt_le_conn_param *conn_param,
711 struct bt_conn **conn);
712
714
721
724};
725
743int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv,
744 const struct bt_conn_le_create_synced_param *synced_param,
745 const struct bt_le_conn_param *conn_param, struct bt_conn **conn);
746
762int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param,
763 const struct bt_le_conn_param *conn_param);
764
770
786 const struct bt_le_conn_param *param);
787
820int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec);
821
826bt_security_t bt_conn_get_security(const struct bt_conn *conn);
827
837uint8_t bt_conn_enc_key_size(const struct bt_conn *conn);
838
842
845
848
851
854
857
860
863
866
869};
870
906 void (*connected)(struct bt_conn *conn, uint8_t err);
907
925 void (*disconnected)(struct bt_conn *conn, uint8_t reason);
926
951 bool (*le_param_req)(struct bt_conn *conn,
952 struct bt_le_conn_param *param);
953
964 void (*le_param_updated)(struct bt_conn *conn, uint16_t interval,
965 uint16_t latency, uint16_t timeout);
966#if defined(CONFIG_BT_SMP)
976 void (*identity_resolved)(struct bt_conn *conn,
977 const bt_addr_le_t *rpa,
978 const bt_addr_le_t *identity);
979#endif /* CONFIG_BT_SMP */
980#if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_BREDR)
997 void (*security_changed)(struct bt_conn *conn, bt_security_t level,
998 enum bt_security_err err);
999#endif /* defined(CONFIG_BT_SMP) || defined(CONFIG_BT_BREDR) */
1000
1001#if defined(CONFIG_BT_REMOTE_INFO)
1010 void (*remote_info_available)(struct bt_conn *conn,
1011 struct bt_conn_remote_info *remote_info);
1012#endif /* defined(CONFIG_BT_REMOTE_INFO) */
1013
1014#if defined(CONFIG_BT_USER_PHY_UPDATE)
1023 void (*le_phy_updated)(struct bt_conn *conn,
1024 struct bt_conn_le_phy_info *param);
1025#endif /* defined(CONFIG_BT_USER_PHY_UPDATE) */
1026
1027#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
1036 void (*le_data_len_updated)(struct bt_conn *conn,
1037 struct bt_conn_le_data_len_info *info);
1038#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
1039
1040#if defined(CONFIG_BT_DF_CONNECTION_CTE_RX)
1047 void (*cte_report_cb)(struct bt_conn *conn,
1048 const struct bt_df_conn_iq_samples_report *iq_report);
1049#endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */
1050
1051 struct bt_conn_cb *_next;
1052};
1053
1061
1067#define BT_CONN_CB_DEFINE(_name) \
1068 static const STRUCT_SECTION_ITERABLE(bt_conn_cb, \
1069 _CONCAT(bt_conn_cb_, \
1070 _name))
1071
1082void bt_set_bondable(bool enable);
1083
1090void bt_le_oob_set_sc_flag(bool enable);
1091
1099
1111int bt_le_oob_set_legacy_tk(struct bt_conn *conn, const uint8_t *tk);
1112
1131int bt_le_oob_set_sc_data(struct bt_conn *conn,
1132 const struct bt_le_oob_sc_data *oobd_local,
1133 const struct bt_le_oob_sc_data *oobd_remote);
1134
1150int bt_le_oob_get_sc_data(struct bt_conn *conn,
1151 const struct bt_le_oob_sc_data **oobd_local,
1152 const struct bt_le_oob_sc_data **oobd_remote);
1153
1158#define BT_PASSKEY_INVALID 0xffffffff
1159
1173int bt_passkey_set(unsigned int passkey);
1174
1178 enum {
1181
1185
1186 union {
1188 struct {
1190 enum {
1193
1196
1199
1204 };
1205};
1206
1207#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
1217
1220
1223
1226
1231
1236};
1237#endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */
1238
1241#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
1269 enum bt_security_err (*pairing_accept)(struct bt_conn *conn,
1270 const struct bt_conn_pairing_feat *const feat);
1271#endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */
1272
1291 void (*passkey_display)(struct bt_conn *conn, unsigned int passkey);
1292
1293#if defined(CONFIG_BT_PASSKEY_KEYPRESS)
1315 void (*passkey_display_keypress)(struct bt_conn *conn,
1316 enum bt_conn_auth_keypress type);
1317#endif
1318
1337 void (*passkey_entry)(struct bt_conn *conn);
1338
1360 void (*passkey_confirm)(struct bt_conn *conn, unsigned int passkey);
1361
1378 void (*oob_data_request)(struct bt_conn *conn,
1379 struct bt_conn_oob_info *info);
1380
1393 void (*cancel)(struct bt_conn *conn);
1394
1413 void (*pairing_confirm)(struct bt_conn *conn);
1414
1415#if defined(CONFIG_BT_BREDR)
1434 void (*pincode_entry)(struct bt_conn *conn, bool highsec);
1435#endif
1436};
1437
1449 void (*pairing_complete)(struct bt_conn *conn, bool bonded);
1450
1456 void (*pairing_failed)(struct bt_conn *conn,
1457 enum bt_security_err reason);
1458
1467 void (*bond_deleted)(uint8_t id, const bt_addr_le_t *peer);
1468
1471};
1472
1483
1498int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb);
1499
1510
1520
1531int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey);
1532
1548int bt_conn_auth_keypress_notify(struct bt_conn *conn, enum bt_conn_auth_keypress type);
1549
1558int bt_conn_auth_cancel(struct bt_conn *conn);
1559
1569int bt_conn_auth_passkey_confirm(struct bt_conn *conn);
1570
1580int bt_conn_auth_pairing_confirm(struct bt_conn *conn);
1581
1592int bt_conn_auth_pincode_entry(struct bt_conn *conn, const char *pin);
1593
1597};
1598
1603#define BT_BR_CONN_PARAM_INIT(role_switch) \
1604{ \
1605 .allow_role_switch = (role_switch), \
1606}
1607
1612#define BT_BR_CONN_PARAM(role_switch) \
1613 ((struct bt_br_conn_param[]) { \
1614 BT_BR_CONN_PARAM_INIT(role_switch) \
1615 })
1616
1620#define BT_BR_CONN_PARAM_DEFAULT BT_BR_CONN_PARAM(true)
1621
1622
1635struct bt_conn *bt_conn_create_br(const bt_addr_t *peer,
1636 const struct bt_br_conn_param *param);
1637
1649struct bt_conn *bt_conn_create_sco(const bt_addr_t *peer);
1650
1651#ifdef __cplusplus
1652}
1653#endif
1654
1659#endif /* ZEPHYR_INCLUDE_BLUETOOTH_CONN_H_ */
Bluetooth device address definitions and utilities.
Bluetooth subsystem core APIs.
ZTEST_BMEM int timeout
Definition: main.c:31
Bluetooth Generic Access Profile defines and Assigned Numbers.
void bt_set_bondable(bool enable)
Enable/disable bonding.
struct bt_conn * bt_conn_ref(struct bt_conn *conn)
Increment a connection's reference count.
int bt_le_oob_get_sc_data(struct bt_conn *conn, const struct bt_le_oob_sc_data **oobd_local, const struct bt_le_oob_sc_data **oobd_remote)
Get OOB data used for LE Secure Connections (SC) pairing procedure.
int bt_le_oob_set_legacy_tk(struct bt_conn *conn, const uint8_t *tk)
Set OOB Temporary Key to be used for pairing.
int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason)
Disconnect from a remote device or cancel pending connection.
int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb)
Register authentication callbacks.
struct bt_conn * bt_conn_lookup_addr_le(uint8_t id, const bt_addr_le_t *peer)
Look up an existing connection by address.
int bt_conn_auth_keypress_notify(struct bt_conn *conn, enum bt_conn_auth_keypress type)
Send Passkey Keypress Notification during pairing.
int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info)
Get connection info.
bt_security_flag
Definition: conn.h:369
int bt_passkey_set(unsigned int passkey)
Set a fixed passkey to be used for pairing.
void bt_conn_cb_register(struct bt_conn_cb *cb)
Register connection callbacks.
int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey)
Reply with entered passkey.
int bt_conn_auth_pairing_confirm(struct bt_conn *conn)
Reply if incoming pairing was confirmed by user.
int bt_conn_auth_pincode_entry(struct bt_conn *conn, const char *pin)
Reply with entered PIN code.
void bt_conn_unref(struct bt_conn *conn)
Decrement a connection's reference count.
bt_security_t bt_conn_get_security(const struct bt_conn *conn)
Get security level for a connection.
bt_conn_auth_keypress
Passkey Keypress Notification type.
Definition: conn.h:486
void bt_conn_foreach(int type, void(*func)(struct bt_conn *conn, void *data), void *data)
Iterate through all bt_conn objects.
int bt_conn_create_auto_stop(void)
Stop automatic connect creation.
int bt_conn_get_remote_info(struct bt_conn *conn, struct bt_conn_remote_info *remote_info)
Get connection info for the remote device.
bt_conn_le_tx_power_phy
Definition: conn.h:455
const bt_addr_le_t * bt_conn_get_dst(const struct bt_conn *conn)
Get destination (peer) address of a connection.
int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb)
Overlay authentication callbacks used for a given connection.
int bt_conn_auth_cancel(struct bt_conn *conn)
Cancel ongoing authenticated pairing.
int bt_conn_le_data_len_update(struct bt_conn *conn, const struct bt_conn_le_data_len_param *param)
Update the connection transmit data length parameters.
int bt_conn_le_create(const bt_addr_le_t *peer, const struct bt_conn_le_create_param *create_param, const struct bt_le_conn_param *conn_param, struct bt_conn **conn)
Initiate an LE connection to a remote device.
int bt_le_set_auto_conn(const bt_addr_le_t *addr, const struct bt_le_conn_param *param)
Automatically connect to remote device if it's in range.
bt_conn_state
Definition: conn.h:339
void bt_le_oob_set_legacy_flag(bool enable)
Allow/disallow remote legacy OOB data to be used for pairing.
int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv, const struct bt_conn_le_create_synced_param *synced_param, const struct bt_le_conn_param *conn_param, struct bt_conn **conn)
Create a connection to a synced device.
int bt_conn_le_get_tx_power_level(struct bt_conn *conn, struct bt_conn_le_tx_power *tx_power_level)
Get connection transmit power level.
bt_security_err
Definition: conn.h:839
int bt_conn_le_param_update(struct bt_conn *conn, const struct bt_le_conn_param *param)
Update the connection parameters.
int bt_conn_auth_passkey_confirm(struct bt_conn *conn)
Reply if passkey was confirmed to match by user.
struct bt_conn * bt_conn_create_sco(const bt_addr_t *peer)
Initiate an SCO connection to a remote device.
int bt_le_oob_set_sc_data(struct bt_conn *conn, const struct bt_le_oob_sc_data *oobd_local, const struct bt_le_oob_sc_data *oobd_remote)
Set OOB data during LE Secure Connections (SC) pairing procedure.
int bt_conn_auth_info_cb_register(struct bt_conn_auth_info_cb *cb)
Register authentication information callbacks.
int bt_conn_auth_info_cb_unregister(struct bt_conn_auth_info_cb *cb)
Unregister authentication information callbacks.
void bt_le_oob_set_sc_flag(bool enable)
Allow/disallow remote LE SC OOB data to be used for pairing.
uint8_t bt_conn_index(const struct bt_conn *conn)
Get array index of a connection.
int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec)
Set security level for a connection.
int bt_conn_le_phy_update(struct bt_conn *conn, const struct bt_conn_le_phy_param *param)
Update the connection PHY parameters.
int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param, const struct bt_le_conn_param *conn_param)
Automatically connect to remote devices in the filter accept list..
bt_security_t
Definition: conn.h:351
struct bt_conn * bt_conn_create_br(const bt_addr_t *peer, const struct bt_br_conn_param *param)
Initiate an BR/EDR connection to a remote device.
uint8_t bt_conn_enc_key_size(const struct bt_conn *conn)
Get encryption key size.
@ BT_SECURITY_FLAG_OOB
Definition: conn.h:373
@ BT_SECURITY_FLAG_SC
Definition: conn.h:371
@ BT_CONN_AUTH_KEYPRESS_DIGIT_ERASED
Definition: conn.h:489
@ BT_CONN_AUTH_KEYPRESS_DIGIT_ENTERED
Definition: conn.h:488
@ BT_CONN_AUTH_KEYPRESS_CLEARED
Definition: conn.h:490
@ BT_CONN_AUTH_KEYPRESS_ENTRY_STARTED
Definition: conn.h:487
@ BT_CONN_AUTH_KEYPRESS_ENTRY_COMPLETED
Definition: conn.h:491
@ BT_CONN_LE_TX_POWER_PHY_NONE
Definition: conn.h:457
@ BT_CONN_LE_TX_POWER_PHY_CODED_S2
Definition: conn.h:465
@ BT_CONN_LE_TX_POWER_PHY_CODED_S8
Definition: conn.h:463
@ BT_CONN_LE_TX_POWER_PHY_1M
Definition: conn.h:459
@ BT_CONN_LE_TX_POWER_PHY_2M
Definition: conn.h:461
@ BT_CONN_LE_PHY_OPT_CODED_S2
Definition: conn.h:93
@ BT_CONN_LE_PHY_OPT_CODED_S8
Definition: conn.h:96
@ BT_CONN_LE_PHY_OPT_NONE
Definition: conn.h:90
@ BT_CONN_STATE_CONNECTING
Definition: conn.h:343
@ BT_CONN_STATE_CONNECTED
Definition: conn.h:345
@ BT_CONN_STATE_DISCONNECTED
Definition: conn.h:341
@ BT_CONN_STATE_DISCONNECTING
Definition: conn.h:347
@ BT_SECURITY_ERR_OOB_NOT_AVAILABLE
Definition: conn.h:850
@ BT_SECURITY_ERR_AUTH_REQUIREMENT
Definition: conn.h:853
@ BT_SECURITY_ERR_KEY_REJECTED
Definition: conn.h:865
@ BT_SECURITY_ERR_UNSPECIFIED
Definition: conn.h:868
@ BT_SECURITY_ERR_INVALID_PARAM
Definition: conn.h:862
@ BT_SECURITY_ERR_PAIR_NOT_SUPPORTED
Definition: conn.h:856
@ BT_SECURITY_ERR_AUTH_FAIL
Definition: conn.h:844
@ BT_SECURITY_ERR_PIN_OR_KEY_MISSING
Definition: conn.h:847
@ BT_SECURITY_ERR_SUCCESS
Definition: conn.h:841
@ BT_SECURITY_ERR_PAIR_NOT_ALLOWED
Definition: conn.h:859
@ BT_CONN_ROLE_PERIPHERAL
Definition: conn.h:336
@ BT_CONN_ROLE_CENTRAL
Definition: conn.h:335
@ BT_SECURITY_L4
Definition: conn.h:361
@ BT_SECURITY_L0
Definition: conn.h:353
@ BT_SECURITY_L3
Definition: conn.h:359
@ BT_SECURITY_FORCE_PAIR
Definition: conn.h:365
@ BT_SECURITY_L1
Definition: conn.h:355
@ BT_SECURITY_L2
Definition: conn.h:357
@ BT_CONN_TYPE_LE
Definition: conn.h:276
@ BT_CONN_TYPE_ALL
Definition: conn.h:284
@ BT_CONN_TYPE_BR
Definition: conn.h:278
@ BT_CONN_TYPE_ISO
Definition: conn.h:282
@ BT_CONN_TYPE_SCO
Definition: conn.h:280
@ BT_CONN_LE_OPT_NONE
Definition: conn.h:595
@ BT_CONN_LE_OPT_NO_1M
Disable LE 1M PHY.
Definition: conn.h:609
@ BT_CONN_LE_OPT_CODED
Enable LE Coded PHY.
Definition: conn.h:601
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
struct _snode sys_snode_t
Definition: slist.h:33
#define bool
Definition: stdbool.h:13
__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
Definition: addr.h:49
Definition: addr.h:40
Definition: conn.h:1595
bool allow_role_switch
Definition: conn.h:1596
Definition: conn.h:1240
void(* passkey_entry)(struct bt_conn *conn)
Request the user to enter a passkey.
Definition: conn.h:1337
void(* passkey_display)(struct bt_conn *conn, unsigned int passkey)
Display a passkey to the user.
Definition: conn.h:1291
void(* passkey_confirm)(struct bt_conn *conn, unsigned int passkey)
Request the user to confirm a passkey.
Definition: conn.h:1360
enum bt_security_err(* pairing_accept)(struct bt_conn *conn, const struct bt_conn_pairing_feat *const feat)
Query to proceed incoming pairing or not.
Definition: conn.h:1269
void(* pincode_entry)(struct bt_conn *conn, bool highsec)
Request the user to enter a passkey.
Definition: conn.h:1434
void(* oob_data_request)(struct bt_conn *conn, struct bt_conn_oob_info *info)
Request the user to provide Out of Band (OOB) data.
Definition: conn.h:1378
void(* pairing_confirm)(struct bt_conn *conn)
Request confirmation for an incoming pairing.
Definition: conn.h:1413
void(* cancel)(struct bt_conn *conn)
Cancel the ongoing user request.
Definition: conn.h:1393
Definition: conn.h:1439
void(* pairing_failed)(struct bt_conn *conn, enum bt_security_err reason)
notify that pairing process has failed.
Definition: conn.h:1456
void(* pairing_complete)(struct bt_conn *conn, bool bonded)
notify that pairing procedure was complete.
Definition: conn.h:1449
void(* bond_deleted)(uint8_t id, const bt_addr_le_t *peer)
Notify that bond has been deleted.
Definition: conn.h:1467
sys_snode_t node
Definition: conn.h:1470
Definition: conn.h:330
const bt_addr_t * dst
Definition: conn.h:331
Definition: conn.h:419
uint8_t num_pages
Definition: conn.h:425
const uint8_t * features
Definition: conn.h:422
Connection callback structure.
Definition: conn.h:881
void(* le_param_updated)(struct bt_conn *conn, uint16_t interval, uint16_t latency, uint16_t timeout)
The parameters for an LE connection have been updated.
Definition: conn.h:964
void(* le_data_len_updated)(struct bt_conn *conn, struct bt_conn_le_data_len_info *info)
The data length parameters of the connection has changed.
Definition: conn.h:1036
bool(* le_param_req)(struct bt_conn *conn, struct bt_le_conn_param *param)
LE connection parameter update request.
Definition: conn.h:951
void(* disconnected)(struct bt_conn *conn, uint8_t reason)
A connection has been disconnected.
Definition: conn.h:925
void(* connected)(struct bt_conn *conn, uint8_t err)
A new connection has been established.
Definition: conn.h:906
void(* le_phy_updated)(struct bt_conn *conn, struct bt_conn_le_phy_info *param)
The PHY of the connection has changed.
Definition: conn.h:1023
void(* security_changed)(struct bt_conn *conn, bt_security_t level, enum bt_security_err err)
The security level of a connection has changed.
Definition: conn.h:997
void(* identity_resolved)(struct bt_conn *conn, const bt_addr_le_t *rpa, const bt_addr_le_t *identity)
Remote Identity Address has been resolved.
Definition: conn.h:976
void(* remote_info_available)(struct bt_conn *conn, struct bt_conn_remote_info *remote_info)
Remote information procedures has completed.
Definition: conn.h:1010
Definition: conn.h:391
uint8_t id
Definition: conn.h:397
struct bt_conn_le_info le
Definition: conn.h:401
uint8_t type
Definition: conn.h:393
struct bt_conn_br_info br
Definition: conn.h:403
uint8_t role
Definition: conn.h:395
struct bt_security_info security
Definition: conn.h:408
enum bt_conn_state state
Definition: conn.h:406
Definition: conn.h:612
uint16_t interval_coded
Scan interval LE Coded PHY (N * 0.625 MS)
Definition: conn.h:627
uint16_t window
Definition: conn.h:621
uint32_t options
Definition: conn.h:615
uint16_t timeout
Connection initiation timeout (N * 10 MS)
Definition: conn.h:642
uint16_t interval
Definition: conn.h:618
uint16_t window_coded
Scan window LE Coded PHY (N * 0.625 MS)
Definition: conn.h:633
Definition: conn.h:713
const bt_addr_le_t * peer
Remote address.
Definition: conn.h:720
uint8_t subevent
Definition: conn.h:723
Definition: conn.h:149
uint16_t tx_max_time
Definition: conn.h:153
uint16_t rx_max_len
Definition: conn.h:155
uint16_t tx_max_len
Definition: conn.h:151
uint16_t rx_max_time
Definition: conn.h:157
Definition: conn.h:161
uint16_t tx_max_len
Definition: conn.h:163
uint16_t tx_max_time
Definition: conn.h:165
Definition: conn.h:289
const bt_addr_le_t * dst
Definition: conn.h:295
const struct bt_conn_le_phy_info * phy
Definition: conn.h:305
const bt_addr_le_t * remote
Definition: conn.h:299
const bt_addr_le_t * local
Definition: conn.h:297
const bt_addr_le_t * src
Definition: conn.h:291
uint16_t interval
Definition: conn.h:300
uint16_t latency
Definition: conn.h:301
const struct bt_conn_le_data_len_info * data_len
Definition: conn.h:310
uint16_t timeout
Definition: conn.h:302
Definition: conn.h:82
uint8_t rx_phy
Definition: conn.h:84
uint8_t tx_phy
Definition: conn.h:83
Definition: conn.h:100
uint16_t options
Definition: conn.h:101
uint8_t pref_rx_phy
Definition: conn.h:103
uint8_t pref_tx_phy
Definition: conn.h:102
Definition: conn.h:412
const uint8_t * features
Definition: conn.h:415
Definition: conn.h:469
int8_t max_level
Definition: conn.h:478
int8_t current_level
Definition: conn.h:475
uint8_t phy
Definition: conn.h:472
Definition: conn.h:1176
enum bt_conn_oob_info::@54 type
@ BT_CONN_OOB_LE_LEGACY
Definition: conn.h:1180
@ BT_CONN_OOB_LE_SC
Definition: conn.h:1183
@ BT_CONN_OOB_NO_DATA
Definition: conn.h:1201
@ BT_CONN_OOB_LOCAL_ONLY
Definition: conn.h:1192
@ BT_CONN_OOB_REMOTE_ONLY
Definition: conn.h:1195
@ BT_CONN_OOB_BOTH_PEERS
Definition: conn.h:1198
struct bt_conn_oob_info::@55::@57 lesc
enum bt_conn_oob_info::@55::@57::@58 oob_config
Pairing request and pairing response info structure.
Definition: conn.h:1214
uint8_t resp_key_dist
Definition: conn.h:1235
uint8_t io_capability
Definition: conn.h:1216
uint8_t init_key_dist
Definition: conn.h:1230
uint8_t max_enc_key_size
Definition: conn.h:1225
uint8_t auth_req
Definition: conn.h:1222
uint8_t oob_data_flag
Definition: conn.h:1219
Connection Remote Info Structure.
Definition: conn.h:433
uint8_t version
Definition: conn.h:438
uint16_t subversion
Definition: conn.h:444
uint16_t manufacturer
Definition: conn.h:441
uint8_t type
Definition: conn.h:435
struct bt_conn_br_remote_info br
Definition: conn.h:451
struct bt_conn_le_remote_info le
Definition: conn.h:448
Definition: direction.h:165
Definition: conn.h:38
uint16_t latency
Definition: conn.h:41
uint16_t interval_max
Definition: conn.h:40
uint16_t timeout
Definition: conn.h:42
uint16_t interval_min
Definition: conn.h:39
Definition: bluetooth.h:2302
Definition: conn.h:377
uint8_t enc_key_size
Definition: conn.h:381
bt_security_t level
Definition: conn.h:379
enum bt_security_flag flags
Definition: conn.h:383
static fdata_t data[2]
Definition: test_fifo_contexts.c:15