Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
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
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
86
88enum {
91
94
97};
98
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
159
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
218
229
249
264
274
284
294
410
415
427struct bt_conn *bt_conn_ref(struct bt_conn *conn);
428
435void bt_conn_unref(struct bt_conn *conn);
436
454 void (*func)(struct bt_conn *conn, void *data),
455 void *data);
456
469struct bt_conn *bt_conn_lookup_addr_le(uint8_t id, const bt_addr_le_t *peer);
470
477const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn);
478
489uint8_t bt_conn_index(const struct bt_conn *conn);
490
507#if defined(CONFIG_BT_USER_PHY_UPDATE)
509#endif /* defined(CONFIG_BT_USER_PHY_UPDATE) */
510
511#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
512 /* Connection maximum single fragment parameters */
514#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
515
516#if defined(CONFIG_BT_SUBRATING)
517 /* Connection subrating parameters */
518 const struct bt_conn_le_subrating_info *subrate;
519#endif /* defined(CONFIG_BT_SUBRATING) */
520};
521
529#define BT_CONN_INTERVAL_TO_MS(interval) ((interval) * 5U / 4U)
530
535#define BT_CONN_INTERVAL_TO_US(interval) ((interval) * 1250U)
536
539 const bt_addr_t *dst;
540};
541
542enum {
545};
546
557
575
583
593
614
617
620};
621
631
658
671
684
685
720
739
743
753
771
784
792int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info);
793
809int bt_conn_get_remote_info(struct bt_conn *conn,
810 struct bt_conn_remote_info *remote_info);
811
820int bt_conn_le_get_tx_power_level(struct bt_conn *conn,
821 struct bt_conn_le_tx_power *tx_power_level);
822
832 struct bt_conn_le_tx_power *tx_power);
833
843 enum bt_conn_le_tx_power_phy phy);
844
855 bool local_enable,
856 bool remote_enable);
857
869int bt_conn_le_set_path_loss_mon_param(struct bt_conn *conn,
870 const struct bt_conn_le_path_loss_reporting_param *param);
871
884int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool enable);
885
901
913int bt_conn_le_subrate_request(struct bt_conn *conn,
914 const struct bt_conn_le_subrate_param *params);
915
927int bt_conn_le_param_update(struct bt_conn *conn,
928 const struct bt_le_conn_param *param);
929
937int bt_conn_le_data_len_update(struct bt_conn *conn,
938 const struct bt_conn_le_data_len_param *param);
939
950int bt_conn_le_phy_update(struct bt_conn *conn,
951 const struct bt_conn_le_phy_param *param);
952
975int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason);
976
977enum {
980
986
994};
995
1042
1049#define BT_CONN_LE_CREATE_PARAM_INIT(_options, _interval, _window) \
1050{ \
1051 .options = (_options), \
1052 .interval = (_interval), \
1053 .window = (_window), \
1054 .interval_coded = 0, \
1055 .window_coded = 0, \
1056 .timeout = 0, \
1057}
1058
1065#define BT_CONN_LE_CREATE_PARAM(_options, _interval, _window) \
1066 ((struct bt_conn_le_create_param[]) { \
1067 BT_CONN_LE_CREATE_PARAM_INIT(_options, _interval, _window) \
1068 })
1069
1073#define BT_CONN_LE_CREATE_CONN \
1074 BT_CONN_LE_CREATE_PARAM(BT_CONN_LE_OPT_NONE, \
1075 BT_GAP_SCAN_FAST_INTERVAL, \
1076 BT_GAP_SCAN_FAST_INTERVAL)
1077
1082#define BT_CONN_LE_CREATE_CONN_AUTO \
1083 BT_CONN_LE_CREATE_PARAM(BT_CONN_LE_OPT_NONE, \
1084 BT_GAP_SCAN_FAST_INTERVAL, \
1085 BT_GAP_SCAN_FAST_WINDOW)
1086
1108 const struct bt_conn_le_create_param *create_param,
1109 const struct bt_le_conn_param *conn_param,
1110 struct bt_conn **conn);
1111
1124
1142int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv,
1143 const struct bt_conn_le_create_synced_param *synced_param,
1144 const struct bt_le_conn_param *conn_param, struct bt_conn **conn);
1145
1162 const struct bt_le_conn_param *conn_param);
1163
1169
1185 const struct bt_le_conn_param *param);
1186
1223int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec);
1224
1229bt_security_t bt_conn_get_security(const struct bt_conn *conn);
1230
1240uint8_t bt_conn_enc_key_size(const struct bt_conn *conn);
1241
1273
1309 void (*connected)(struct bt_conn *conn, uint8_t err);
1310
1328 void (*disconnected)(struct bt_conn *conn, uint8_t reason);
1329
1342 void (*recycled)(void);
1343
1368 bool (*le_param_req)(struct bt_conn *conn,
1369 struct bt_le_conn_param *param);
1370
1381 void (*le_param_updated)(struct bt_conn *conn, uint16_t interval,
1382 uint16_t latency, uint16_t timeout);
1383#if defined(CONFIG_BT_SMP)
1393 void (*identity_resolved)(struct bt_conn *conn,
1394 const bt_addr_le_t *rpa,
1395 const bt_addr_le_t *identity);
1396#endif /* CONFIG_BT_SMP */
1397#if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC)
1414 void (*security_changed)(struct bt_conn *conn, bt_security_t level,
1415 enum bt_security_err err);
1416#endif /* defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC) */
1417
1418#if defined(CONFIG_BT_REMOTE_INFO)
1427 void (*remote_info_available)(struct bt_conn *conn,
1428 struct bt_conn_remote_info *remote_info);
1429#endif /* defined(CONFIG_BT_REMOTE_INFO) */
1430
1431#if defined(CONFIG_BT_USER_PHY_UPDATE)
1440 void (*le_phy_updated)(struct bt_conn *conn,
1441 struct bt_conn_le_phy_info *param);
1442#endif /* defined(CONFIG_BT_USER_PHY_UPDATE) */
1443
1444#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
1453 void (*le_data_len_updated)(struct bt_conn *conn,
1454 struct bt_conn_le_data_len_info *info);
1455#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
1456
1457#if defined(CONFIG_BT_DF_CONNECTION_CTE_RX)
1464 void (*cte_report_cb)(struct bt_conn *conn,
1465 const struct bt_df_conn_iq_samples_report *iq_report);
1466#endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */
1467
1468#if defined(CONFIG_BT_TRANSMIT_POWER_CONTROL)
1480 void (*tx_power_report)(struct bt_conn *conn,
1481 const struct bt_conn_le_tx_power_report *report);
1482#endif /* CONFIG_BT_TRANSMIT_POWER_CONTROL */
1483
1484#if defined(CONFIG_BT_PATH_LOSS_MONITORING)
1494 void (*path_loss_threshold_report)(struct bt_conn *conn,
1495 const struct bt_conn_le_path_loss_threshold_report *report);
1496#endif /* CONFIG_BT_PATH_LOSS_MONITORING */
1497
1498#if defined(CONFIG_BT_SUBRATING)
1509 void (*subrate_changed)(struct bt_conn *conn,
1510 const struct bt_conn_le_subrate_changed *params);
1511#endif /* CONFIG_BT_SUBRATING */
1512
1513#if defined(CONFIG_BT_CHANNEL_SOUNDING)
1522 void (*remote_cs_capabilities_available)(struct bt_conn *conn,
1523 struct bt_conn_le_cs_capabilities *params);
1524
1533 void (*remote_cs_fae_table_available)(struct bt_conn *conn,
1534 struct bt_conn_le_cs_fae_table *params);
1535#endif
1536
1538 sys_snode_t _node;
1539};
1540
1551
1564
1570#define BT_CONN_CB_DEFINE(_name) \
1571 static const STRUCT_SECTION_ITERABLE(bt_conn_cb, \
1572 _CONCAT(bt_conn_cb_, \
1573 _name))
1574
1581#if defined(CONFIG_BT_SECURITY_ERR_TO_STR)
1582const char *bt_security_err_to_str(enum bt_security_err err);
1583#else
1584static inline const char *bt_security_err_to_str(enum bt_security_err err)
1585{
1586 ARG_UNUSED(err);
1587
1588 return "";
1589}
1590#endif
1591
1602void bt_set_bondable(bool enable);
1603
1622int bt_conn_set_bondable(struct bt_conn *conn, bool enable);
1623
1630void bt_le_oob_set_sc_flag(bool enable);
1631
1639
1651int bt_le_oob_set_legacy_tk(struct bt_conn *conn, const uint8_t *tk);
1652
1671int bt_le_oob_set_sc_data(struct bt_conn *conn,
1672 const struct bt_le_oob_sc_data *oobd_local,
1673 const struct bt_le_oob_sc_data *oobd_remote);
1674
1690int bt_le_oob_get_sc_data(struct bt_conn *conn,
1691 const struct bt_le_oob_sc_data **oobd_local,
1692 const struct bt_le_oob_sc_data **oobd_remote);
1693
1698#define BT_PASSKEY_INVALID 0xffffffff
1699
1713int bt_passkey_set(unsigned int passkey);
1714
1746
1747#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
1777#endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */
1778
1781#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
1809 enum bt_security_err (*pairing_accept)(struct bt_conn *conn,
1810 const struct bt_conn_pairing_feat *const feat);
1811#endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */
1812
1831 void (*passkey_display)(struct bt_conn *conn, unsigned int passkey);
1832
1833#if defined(CONFIG_BT_PASSKEY_KEYPRESS)
1855 void (*passkey_display_keypress)(struct bt_conn *conn,
1856 enum bt_conn_auth_keypress type);
1857#endif
1858
1877 void (*passkey_entry)(struct bt_conn *conn);
1878
1900 void (*passkey_confirm)(struct bt_conn *conn, unsigned int passkey);
1901
1918 void (*oob_data_request)(struct bt_conn *conn,
1919 struct bt_conn_oob_info *info);
1920
1933 void (*cancel)(struct bt_conn *conn);
1934
1953 void (*pairing_confirm)(struct bt_conn *conn);
1954
1955#if defined(CONFIG_BT_CLASSIC)
1974 void (*pincode_entry)(struct bt_conn *conn, bool highsec);
1975#endif
1976};
1977
1989 void (*pairing_complete)(struct bt_conn *conn, bool bonded);
1990
1996 void (*pairing_failed)(struct bt_conn *conn,
1997 enum bt_security_err reason);
1998
2007 void (*bond_deleted)(uint8_t id, const bt_addr_le_t *peer);
2008
2011};
2012
2023
2038int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb);
2039
2050
2060
2071int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey);
2072
2088int bt_conn_auth_keypress_notify(struct bt_conn *conn, enum bt_conn_auth_keypress type);
2089
2098int bt_conn_auth_cancel(struct bt_conn *conn);
2099
2109int bt_conn_auth_passkey_confirm(struct bt_conn *conn);
2110
2120int bt_conn_auth_pairing_confirm(struct bt_conn *conn);
2121
2132int bt_conn_auth_pincode_entry(struct bt_conn *conn, const char *pin);
2133
2138
2143#define BT_BR_CONN_PARAM_INIT(role_switch) \
2144{ \
2145 .allow_role_switch = (role_switch), \
2146}
2147
2152#define BT_BR_CONN_PARAM(role_switch) \
2153 ((struct bt_br_conn_param[]) { \
2154 BT_BR_CONN_PARAM_INIT(role_switch) \
2155 })
2156
2160#define BT_BR_CONN_PARAM_DEFAULT BT_BR_CONN_PARAM(true)
2161
2162
2175struct bt_conn *bt_conn_create_br(const bt_addr_t *peer,
2176 const struct bt_br_conn_param *param);
2177
2178#ifdef __cplusplus
2179}
2180#endif
2181
2186#endif /* ZEPHYR_INCLUDE_BLUETOOTH_CONN_H_ */
Bluetooth device address definitions and utilities.
Bluetooth subsystem core APIs.
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_conn_le_get_remote_tx_power_level(struct bt_conn *conn, enum bt_conn_le_tx_power_phy phy)
Get remote (peer) transmit power level.
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.
bt_conn_le_cs_capability_rtt_sounding
Supported Sounding Sequence RTT precision.
Definition conn.h:276
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
Security Info Flags.
Definition conn.h:577
static const char * bt_security_err_to_str(enum bt_security_err err)
Converts a security error to string.
Definition conn.h:1584
int bt_passkey_set(unsigned int passkey)
Set a fixed passkey to be used for pairing.
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.
int bt_conn_set_bondable(struct bt_conn *conn, bool enable)
Set/clear the bonding flag for a given connection.
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_le_cs_capability_rtt_random_payload
Supported Random Payload RTT precision.
Definition conn.h:286
bt_conn_auth_keypress
Passkey Keypress Notification type.
Definition conn.h:777
void bt_conn_foreach(enum bt_conn_type 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_le_set_path_loss_mon_param(struct bt_conn *conn, const struct bt_conn_le_path_loss_reporting_param *param)
Set Path Loss Monitoring Parameters.
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:659
int bt_conn_le_subrate_request(struct bt_conn *conn, const struct bt_conn_le_subrate_param *params)
Request New Subrating Parameters.
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.
int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool enable)
Enable or Disable Path Loss Monitoring.
bt_conn_state
Definition conn.h:547
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_set_tx_power_report_enable(struct bt_conn *conn, bool local_enable, bool remote_enable)
Enable transmit power reporting.
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.
int bt_conn_le_enhanced_get_tx_power_level(struct bt_conn *conn, struct bt_conn_le_tx_power *tx_power)
Get local enhanced connection transmit power level.
bt_security_err
Definition conn.h:1242
int bt_conn_cb_register(struct bt_conn_cb *cb)
Register connection callbacks.
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.
bt_conn_type
Connection Type.
Definition conn.h:251
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.
int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *params)
Set Default Connection Subrating Parameters.
void bt_le_oob_set_sc_flag(bool enable)
Allow/disallow remote LE SC OOB data to be used for pairing.
int bt_conn_cb_unregister(struct bt_conn_cb *cb)
Unregister connection callbacks.
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
Security level.
Definition conn.h:559
bt_conn_le_path_loss_zone
Path Loss zone that has been entered.
Definition conn.h:729
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.
bt_conn_le_cs_capability_rtt_aa_only
Supported AA-Only RTT precision.
Definition conn.h:266
uint8_t bt_conn_enc_key_size(const struct bt_conn *conn)
Get encryption key size.
@ BT_CONN_LE_CS_RTT_SOUNDING_150NS
150ns time-of-flight accuracy.
Definition conn.h:282
@ BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP
Sounding Sequence RTT variant is not supported.
Definition conn.h:278
@ BT_CONN_LE_CS_RTT_SOUNDING_10NS
10ns time-of-flight accuracy.
Definition conn.h:280
@ BT_SECURITY_FLAG_OOB
Paired with Out of Band method.
Definition conn.h:581
@ BT_SECURITY_FLAG_SC
Paired with Secure Connections.
Definition conn.h:579
@ BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS
10ns time-of-flight accuracy.
Definition conn.h:290
@ BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP
Random Payload RTT variant is not supported.
Definition conn.h:288
@ BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_150NS
150ns time-of-flight accuracy.
Definition conn.h:292
@ BT_CONN_AUTH_KEYPRESS_DIGIT_ERASED
Definition conn.h:780
@ BT_CONN_AUTH_KEYPRESS_DIGIT_ENTERED
Definition conn.h:779
@ BT_CONN_AUTH_KEYPRESS_CLEARED
Definition conn.h:781
@ BT_CONN_AUTH_KEYPRESS_ENTRY_STARTED
Definition conn.h:778
@ BT_CONN_AUTH_KEYPRESS_ENTRY_COMPLETED
Definition conn.h:782
@ BT_CONN_ROLE_PERIPHERAL
Definition conn.h:544
@ BT_CONN_ROLE_CENTRAL
Definition conn.h:543
@ BT_CONN_LE_TX_POWER_PHY_NONE
Convenience macro for when no PHY is set.
Definition conn.h:661
@ BT_CONN_LE_TX_POWER_PHY_CODED_S2
LE Coded PHY using S=2 coding.
Definition conn.h:669
@ BT_CONN_LE_TX_POWER_PHY_CODED_S8
LE Coded PHY using S=8 coding.
Definition conn.h:667
@ BT_CONN_LE_TX_POWER_PHY_1M
LE 1M PHY.
Definition conn.h:663
@ BT_CONN_LE_TX_POWER_PHY_2M
LE 2M PHY.
Definition conn.h:665
@ BT_CONN_STATE_CONNECTING
Channel in connecting state.
Definition conn.h:551
@ BT_CONN_STATE_CONNECTED
Channel connected and ready for upper layer traffic on it.
Definition conn.h:553
@ BT_CONN_STATE_DISCONNECTED
Channel disconnected.
Definition conn.h:549
@ BT_CONN_STATE_DISCONNECTING
Channel in disconnecting state.
Definition conn.h:555
@ BT_CONN_LE_PHY_OPT_CODED_S2
LE Coded using S=2 coding preferred when transmitting.
Definition conn.h:93
@ BT_CONN_LE_PHY_OPT_CODED_S8
LE Coded using S=8 coding preferred when transmitting.
Definition conn.h:96
@ BT_CONN_LE_PHY_OPT_NONE
Convenience value when no options are specified.
Definition conn.h:90
@ BT_SECURITY_ERR_OOB_NOT_AVAILABLE
OOB data is not available.
Definition conn.h:1253
@ BT_SECURITY_ERR_AUTH_REQUIREMENT
The requested security level could not be reached.
Definition conn.h:1256
@ BT_SECURITY_ERR_KEY_REJECTED
Distributed Key Rejected.
Definition conn.h:1268
@ BT_SECURITY_ERR_UNSPECIFIED
Pairing failed but the exact reason could not be specified.
Definition conn.h:1271
@ BT_SECURITY_ERR_INVALID_PARAM
Invalid parameters.
Definition conn.h:1265
@ BT_SECURITY_ERR_PAIR_NOT_SUPPORTED
Pairing is not supported.
Definition conn.h:1259
@ BT_SECURITY_ERR_AUTH_FAIL
Authentication failed.
Definition conn.h:1247
@ BT_SECURITY_ERR_PIN_OR_KEY_MISSING
PIN or encryption key is missing.
Definition conn.h:1250
@ BT_SECURITY_ERR_SUCCESS
Security procedure successful.
Definition conn.h:1244
@ BT_SECURITY_ERR_PAIR_NOT_ALLOWED
Pairing is not allowed.
Definition conn.h:1262
@ BT_CONN_LE_OPT_NONE
Convenience value when no options are specified.
Definition conn.h:979
@ BT_CONN_LE_OPT_NO_1M
Disable LE 1M PHY.
Definition conn.h:993
@ BT_CONN_LE_OPT_CODED
Enable LE Coded PHY.
Definition conn.h:985
@ BT_CONN_TYPE_LE
LE Connection Type.
Definition conn.h:253
@ BT_CONN_TYPE_ALL
All Connection Type.
Definition conn.h:261
@ BT_CONN_TYPE_BR
BR/EDR Connection Type.
Definition conn.h:255
@ BT_CONN_TYPE_ISO
ISO Connection Type.
Definition conn.h:259
@ BT_CONN_TYPE_SCO
SCO Connection Type.
Definition conn.h:257
@ BT_SECURITY_L4
Level 4: Authenticated Secure Connections and 128-bit key.
Definition conn.h:569
@ BT_SECURITY_L0
Level 0: Only for BR/EDR special cases, like SDP.
Definition conn.h:561
@ BT_SECURITY_L3
Level 3: Encryption and authentication (MITM).
Definition conn.h:567
@ BT_SECURITY_FORCE_PAIR
Bit to force new pairing procedure, bit-wise OR with requested security level.
Definition conn.h:573
@ BT_SECURITY_L1
Level 1: No encryption and no authentication.
Definition conn.h:563
@ BT_SECURITY_L2
Level 2: Encryption and no authentication (no MITM).
Definition conn.h:565
@ BT_CONN_LE_PATH_LOSS_ZONE_ENTERED_MIDDLE
Middle path loss zone entered.
Definition conn.h:733
@ BT_CONN_LE_PATH_LOSS_ZONE_ENTERED_LOW
Low path loss zone entered.
Definition conn.h:731
@ BT_CONN_LE_PATH_LOSS_ZONE_ENTERED_HIGH
High path loss zone entered.
Definition conn.h:735
@ BT_CONN_LE_PATH_LOSS_ZONE_UNAVAILABLE
Path loss has become unavailable.
Definition conn.h:737
@ BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP
AA-Only RTT variant is not supported.
Definition conn.h:268
@ BT_CONN_LE_CS_RTT_AA_ONLY_150NS
150ns time-of-flight accuracy.
Definition conn.h:272
@ BT_CONN_LE_CS_RTT_AA_ONLY_10NS
10ns time-of-flight accuracy.
Definition conn.h:270
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define BT_HCI_LE_ZONE_ENTERED_MIDDLE
Definition hci_types.h:3261
#define BT_HCI_LE_ZONE_ENTERED_HIGH
Definition hci_types.h:3262
#define BT_HCI_LE_ZONE_ENTERED_LOW
Definition hci_types.h:3260
#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
Bluetooth LE Device Address.
Definition addr.h:49
Bluetooth Device Address.
Definition addr.h:40
Connection parameters for BR/EDR connections.
Definition conn.h:2135
bool allow_role_switch
Definition conn.h:2136
Authenticated pairing callback structure.
Definition conn.h:1780
void(* passkey_entry)(struct bt_conn *conn)
Request the user to enter a passkey.
Definition conn.h:1877
void(* passkey_display)(struct bt_conn *conn, unsigned int passkey)
Display a passkey to the user.
Definition conn.h:1831
void(* passkey_confirm)(struct bt_conn *conn, unsigned int passkey)
Request the user to confirm a passkey.
Definition conn.h:1900
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:1809
void(* pincode_entry)(struct bt_conn *conn, bool highsec)
Request the user to enter a passkey.
Definition conn.h:1974
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:1918
void(* pairing_confirm)(struct bt_conn *conn)
Request confirmation for an incoming pairing.
Definition conn.h:1953
void(* cancel)(struct bt_conn *conn)
Cancel the ongoing user request.
Definition conn.h:1933
Authenticated pairing information callback structure.
Definition conn.h:1979
void(* pairing_failed)(struct bt_conn *conn, enum bt_security_err reason)
notify that pairing process has failed.
Definition conn.h:1996
void(* pairing_complete)(struct bt_conn *conn, bool bonded)
notify that pairing procedure was complete.
Definition conn.h:1989
void(* bond_deleted)(uint8_t id, const bt_addr_le_t *peer)
Notify that bond has been deleted.
Definition conn.h:2007
sys_snode_t node
Internally used field for list handling.
Definition conn.h:2010
BR/EDR Connection Info Structure.
Definition conn.h:538
const bt_addr_t * dst
Destination (Remote) BR/EDR address.
Definition conn.h:539
BR/EDR Connection Remote Info structure.
Definition conn.h:623
uint8_t num_pages
Number of pages in the remote feature set.
Definition conn.h:629
const uint8_t * features
Remote feature set (pages of bitmasks).
Definition conn.h:626
Connection callback structure.
Definition conn.h:1284
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:1381
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:1453
void(* recycled)(void)
A connection object has been returned to the pool.
Definition conn.h:1342
bool(* le_param_req)(struct bt_conn *conn, struct bt_le_conn_param *param)
LE connection parameter update request.
Definition conn.h:1368
void(* disconnected)(struct bt_conn *conn, uint8_t reason)
A connection has been disconnected.
Definition conn.h:1328
void(* connected)(struct bt_conn *conn, uint8_t err)
A new connection has been established.
Definition conn.h:1309
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:1440
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:1414
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:1393
void(* remote_info_available)(struct bt_conn *conn, struct bt_conn_remote_info *remote_info)
Remote information procedures has completed.
Definition conn.h:1427
Connection Info Structure.
Definition conn.h:595
uint8_t id
Which local identity the connection was created with.
Definition conn.h:601
struct bt_conn_le_info le
LE Connection specific Info.
Definition conn.h:605
enum bt_conn_type type
Connection Type.
Definition conn.h:597
struct bt_conn_br_info br
BR/EDR Connection specific Info.
Definition conn.h:607
uint8_t role
Connection Role.
Definition conn.h:599
struct bt_security_info security
Security specific info.
Definition conn.h:612
enum bt_conn_state state
Connection state.
Definition conn.h:610
Definition conn.h:996
uint16_t interval_coded
Scan interval LE Coded PHY (N * 0.625 MS)
Definition conn.h:1025
uint16_t window
Scan window (N * 0.625 ms)
Definition conn.h:1019
uint32_t options
Bit-field of create connection options.
Definition conn.h:999
uint16_t timeout
Connection initiation timeout (N * 10 MS)
Definition conn.h:1040
uint16_t interval
Scan interval (N * 0.625 ms)
Definition conn.h:1009
uint16_t window_coded
Scan window LE Coded PHY (N * 0.625 MS)
Definition conn.h:1031
Definition conn.h:1112
const bt_addr_le_t * peer
Remote address.
Definition conn.h:1119
uint8_t subevent
The subevent where the connection will be initiated.
Definition conn.h:1122
Remote channel sounding capabilities for LE connections supporting CS.
Definition conn.h:296
uint16_t t_ip1_times_supported
Optional T_IP1 time durations during CS steps.
Definition conn.h:367
bool phase_based_nadm_random_supported
Phase-based normalized attack detector metric when a CS_SYNC with random sequence is received.
Definition conn.h:346
uint16_t t_fcs_times_supported
Optional T_FCS time durations during CS steps.
Definition conn.h:391
bool cs_without_fae_supported
Subfeature: CS with no Frequency Actuation Error.
Definition conn.h:352
uint8_t rtt_random_payload_n
Number of CS steps needed to achieve the accuracy requirements for RTT Random Payload.
Definition conn.h:338
bool cs_sync_2m_phy_supported
CS_SYNC LE 2M PHY.
Definition conn.h:348
enum bt_conn_le_cs_capability_rtt_aa_only rtt_aa_only_precision
RTT AA-Only.
Definition conn.h:316
uint8_t num_antennas_supported
Number of antennas.
Definition conn.h:306
uint8_t t_sw_time
Time in microseconds for the antenna switch period of the CS tones.
Definition conn.h:399
bool cs_sync_2m_2bt_phy_supported
CS_SYNC LE 2M 2BT PHY.
Definition conn.h:350
bool initiator_supported
Initiator role.
Definition conn.h:310
bool reflector_supported
Reflector role.
Definition conn.h:312
uint16_t t_pm_times_supported
Optional T_PM time durations during CS steps.
Definition conn.h:397
uint8_t num_config_supported
Number of CS configurations.
Definition conn.h:298
uint8_t rtt_sounding_n
Number of CS steps needed to achieve the accuracy requirements for RTT Sounding.
Definition conn.h:332
bool phase_based_nadm_sounding_supported
Phase-based normalized attack detector metric when a CS_SYNC with sounding sequence is received.
Definition conn.h:342
bool mode_3_supported
Mode-3.
Definition conn.h:314
bool chsel_alg_3c_supported
Subfeature: Channel Selection Algorithm #3c.
Definition conn.h:354
enum bt_conn_le_cs_capability_rtt_random_payload rtt_random_payload_precision
RTT Random Payload.
Definition conn.h:320
uint8_t rtt_aa_only_n
Number of CS steps needed to achieve the accuracy requirements for RTT AA Only.
Definition conn.h:326
uint8_t max_antenna_paths_supported
Maximum number of antenna paths.
Definition conn.h:308
enum bt_conn_le_cs_capability_rtt_sounding rtt_sounding_precision
RTT Sounding.
Definition conn.h:318
bool pbr_from_rtt_sounding_seq_supported
Subfeature: Phase-based Ranging from RTT sounding sequence.
Definition conn.h:356
uint8_t tx_snr_capability
Supported SNR levels used in RTT packets.
Definition conn.h:408
uint16_t max_consecutive_procedures_supported
Maximum number of consecutive CS procedures.
Definition conn.h:304
uint16_t t_ip2_times_supported
Optional T_IP2 time durations during CS steps.
Definition conn.h:378
Remote FAE Table for LE connections supporting CS.
Definition conn.h:412
uint8_t * remote_fae_table
Definition conn.h:413
Connection data length information for LE connections.
Definition conn.h:149
uint16_t tx_max_time
Maximum Link Layer transmission payload time in us.
Definition conn.h:153
uint16_t rx_max_len
Maximum Link Layer reception payload size in bytes.
Definition conn.h:155
uint16_t tx_max_len
Maximum Link Layer transmission payload size in bytes.
Definition conn.h:151
uint16_t rx_max_time
Maximum Link Layer reception payload time in us.
Definition conn.h:157
Connection data length parameters for LE connections.
Definition conn.h:161
uint16_t tx_max_len
Maximum Link Layer transmission payload size in bytes.
Definition conn.h:163
uint16_t tx_max_time
Maximum Link Layer transmission payload time in us.
Definition conn.h:165
LE Connection Info Structure.
Definition conn.h:492
const bt_addr_le_t * dst
Destination (Remote) Identity Address or remote Resolvable Private Address (RPA) before identity has ...
Definition conn.h:498
const struct bt_conn_le_phy_info * phy
Definition conn.h:508
const bt_addr_le_t * remote
Remote device address used during connection setup.
Definition conn.h:502
const bt_addr_le_t * local
Local device address used during connection setup.
Definition conn.h:500
const bt_addr_le_t * src
Source (Local) Identity Address.
Definition conn.h:494
uint16_t interval
Connection interval.
Definition conn.h:503
uint16_t latency
Connection peripheral latency.
Definition conn.h:504
const struct bt_conn_le_data_len_info * data_len
Definition conn.h:513
uint16_t timeout
Connection supervision timeout.
Definition conn.h:505
LE Path Loss Monitoring Parameters Structure as defined in Core Spec.
Definition conn.h:757
uint8_t high_threshold
High threshold for the path loss (dB).
Definition conn.h:759
uint8_t low_threshold
Low threshold for the path loss (dB).
Definition conn.h:763
uint16_t min_time_spent
Minimum time in number of connection events to be observed once the path loss crosses the threshold b...
Definition conn.h:769
uint8_t high_hysteresis
Hysteresis value for the high threshold (dB).
Definition conn.h:761
uint8_t low_hysteresis
Hysteresis value for the low threshold (dB).
Definition conn.h:765
LE Path Loss Monitoring Threshold Change Report Structure.
Definition conn.h:745
enum bt_conn_le_path_loss_zone zone
Path Loss zone as documented in Core Spec.
Definition conn.h:748
uint8_t path_loss
Current path loss (dB).
Definition conn.h:751
Connection PHY information for LE connections.
Definition conn.h:82
uint8_t rx_phy
Connection transmit PHY.
Definition conn.h:84
uint8_t tx_phy
Definition conn.h:83
Preferred PHY parameters for LE connections.
Definition conn.h:100
uint16_t options
Connection PHY options.
Definition conn.h:101
uint8_t pref_rx_phy
Bitmask of preferred receive PHYs.
Definition conn.h:103
uint8_t pref_tx_phy
Bitmask of preferred transmit PHYs.
Definition conn.h:102
LE Connection Remote Info Structure.
Definition conn.h:616
const uint8_t * features
Remote LE feature set (bitmask).
Definition conn.h:619
Updated subrating connection parameters for LE connections.
Definition conn.h:231
uint16_t factor
Connection subrate factor.
Definition conn.h:238
uint16_t continuation_number
Number of underlying connection events to remain active after a packet containing a Link Layer PDU wi...
Definition conn.h:243
uint16_t peripheral_latency
Peripheral latency in units of subrated connection intervals.
Definition conn.h:245
uint16_t supervision_timeout
Connection Supervision timeout (N * 10 ms).
Definition conn.h:247
uint8_t status
HCI Status from LE Subrate Changed event.
Definition conn.h:236
Connection subrating parameters for LE connections.
Definition conn.h:200
uint16_t max_latency
Maximum Peripheral latency in units of subrated connection intervals.
Definition conn.h:206
uint16_t subrate_max
Maximum subrate factor.
Definition conn.h:204
uint16_t continuation_number
Minimum number of underlying connection events to remain active after a packet containing a Link Laye...
Definition conn.h:211
uint16_t supervision_timeout
Connection Supervision timeout (N * 10 ms).
Definition conn.h:216
uint16_t subrate_min
Minimum subrate factor.
Definition conn.h:202
Subrating information for LE connections.
Definition conn.h:220
uint16_t continuation_number
Number of underlying connection events to remain active after a packet containing a Link Layer PDU wi...
Definition conn.h:227
uint16_t factor
Connection subrate factor.
Definition conn.h:222
LE Transmit Power Reporting Structure.
Definition conn.h:687
enum bt_conn_le_tx_power_phy phy
Phy of Transmit power reporting.
Definition conn.h:695
int8_t delta
Change in transmit power level.
Definition conn.h:718
uint8_t reason
Reason for Transmit power reporting, as documented in Core Spec.
Definition conn.h:692
int8_t tx_power_level
Transmit power level.
Definition conn.h:705
uint8_t tx_power_level_flag
Bit 0: Transmit power level is at minimum level.
Definition conn.h:710
LE Transmit Power Level Structure.
Definition conn.h:673
int8_t max_level
Output: maximum transmit power level.
Definition conn.h:682
int8_t current_level
Output: current transmit power level.
Definition conn.h:679
uint8_t phy
Input: 1M, 2M, Coded S2 or Coded S8.
Definition conn.h:676
Info Structure for OOB pairing.
Definition conn.h:1716
@ BT_CONN_OOB_NO_DATA
No OOB data requested.
Definition conn.h:1741
@ BT_CONN_OOB_LOCAL_ONLY
Local OOB data requested.
Definition conn.h:1732
@ BT_CONN_OOB_REMOTE_ONLY
Remote OOB data requested.
Definition conn.h:1735
@ BT_CONN_OOB_LE_LEGACY
LE legacy pairing.
Definition conn.h:1720
@ BT_CONN_OOB_LE_SC
LE SC pairing.
Definition conn.h:1723
@ BT_CONN_OOB_BOTH_PEERS
Both local and remote OOB data requested.
Definition conn.h:1738
enum bt_conn_oob_info::@90 type
Type of OOB pairing method.
struct bt_conn_oob_info::@91::@93 lesc
LE Secure Connections OOB pairing parameters.
enum bt_conn_oob_info::@91::@93::@94 oob_config
OOB data configuration.
Pairing request and pairing response info structure.
Definition conn.h:1754
uint8_t resp_key_dist
Responder Key Distribution/Generation, Core Spec.
Definition conn.h:1775
uint8_t io_capability
IO Capability, Core Spec.
Definition conn.h:1756
uint8_t init_key_dist
Initiator Key Distribution/Generation, Core Spec.
Definition conn.h:1770
uint8_t max_enc_key_size
Maximum Encryption Key Size, Core Spec.
Definition conn.h:1765
uint8_t auth_req
AuthReq, Core Spec.
Definition conn.h:1762
uint8_t oob_data_flag
OOB data flag, Core Spec.
Definition conn.h:1759
Connection Remote Info Structure.
Definition conn.h:637
uint8_t version
Remote Link Layer version.
Definition conn.h:642
uint16_t subversion
Per-manufacturer unique revision.
Definition conn.h:648
uint16_t manufacturer
Remote manufacturer identifier.
Definition conn.h:645
uint8_t type
Connection Type.
Definition conn.h:639
struct bt_conn_br_remote_info br
BR/EDR connection remote info.
Definition conn.h:655
struct bt_conn_le_remote_info le
LE connection remote info.
Definition conn.h:652
Definition direction.h:165
Connection parameters for LE connections.
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
LE Secure Connections pairing Out of Band data.
Definition bluetooth.h:2448
Security Info Structure.
Definition conn.h:585
uint8_t enc_key_size
Encryption Key Size.
Definition conn.h:589
bt_security_t level
Security Level.
Definition conn.h:587
enum bt_security_flag flags
Flags.
Definition conn.h:591