Zephyr API Documentation 4.0.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 \
78 BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, BT_GAP_INIT_CONN_INT_MAX, 0, \
79 BT_GAP_MS_TO_CONN_TIMEOUT(4000))
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
425
437
445
463
473
481
489
540
547
553
565
577
665
677struct bt_conn *bt_conn_ref(struct bt_conn *conn);
678
685void bt_conn_unref(struct bt_conn *conn);
686
704 void (*func)(struct bt_conn *conn, void *data),
705 void *data);
706
719struct bt_conn *bt_conn_lookup_addr_le(uint8_t id, const bt_addr_le_t *peer);
720
727const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn);
728
739uint8_t bt_conn_index(const struct bt_conn *conn);
740
757#if defined(CONFIG_BT_USER_PHY_UPDATE)
759#endif /* defined(CONFIG_BT_USER_PHY_UPDATE) */
760
761#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
762 /* Connection maximum single fragment parameters */
764#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
765
766#if defined(CONFIG_BT_SUBRATING)
767 /* Connection subrating parameters */
768 const struct bt_conn_le_subrating_info *subrate;
769#endif /* defined(CONFIG_BT_SUBRATING) */
770};
771
779#define BT_CONN_INTERVAL_TO_MS(interval) ((interval) * 5U / 4U)
780
785#define BT_CONN_INTERVAL_TO_US(interval) ((interval) * 1250U)
786
789 const bt_addr_t *dst;
790};
791
792enum {
795};
796
807
825
833
843
864
867
870};
871
881
908
921
934
935
970
989
993
1003
1021
1034
1042int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info);
1043
1059int bt_conn_get_remote_info(struct bt_conn *conn,
1060 struct bt_conn_remote_info *remote_info);
1061
1070int bt_conn_le_get_tx_power_level(struct bt_conn *conn,
1071 struct bt_conn_le_tx_power *tx_power_level);
1072
1082 struct bt_conn_le_tx_power *tx_power);
1083
1093 enum bt_conn_le_tx_power_phy phy);
1094
1105 bool local_enable,
1106 bool remote_enable);
1107
1119int bt_conn_le_set_path_loss_mon_param(struct bt_conn *conn,
1120 const struct bt_conn_le_path_loss_reporting_param *param);
1121
1134int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool enable);
1135
1151
1163int bt_conn_le_subrate_request(struct bt_conn *conn,
1164 const struct bt_conn_le_subrate_param *params);
1165
1177int bt_conn_le_param_update(struct bt_conn *conn,
1178 const struct bt_le_conn_param *param);
1179
1187int bt_conn_le_data_len_update(struct bt_conn *conn,
1188 const struct bt_conn_le_data_len_param *param);
1189
1200int bt_conn_le_phy_update(struct bt_conn *conn,
1201 const struct bt_conn_le_phy_param *param);
1202
1225int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason);
1226
1227enum {
1230
1236
1244};
1245
1292
1299#define BT_CONN_LE_CREATE_PARAM_INIT(_options, _interval, _window) \
1300{ \
1301 .options = (_options), \
1302 .interval = (_interval), \
1303 .window = (_window), \
1304 .interval_coded = 0, \
1305 .window_coded = 0, \
1306 .timeout = 0, \
1307}
1308
1315#define BT_CONN_LE_CREATE_PARAM(_options, _interval, _window) \
1316 ((struct bt_conn_le_create_param[]) { \
1317 BT_CONN_LE_CREATE_PARAM_INIT(_options, _interval, _window) \
1318 })
1319
1323#define BT_CONN_LE_CREATE_CONN \
1324 BT_CONN_LE_CREATE_PARAM(BT_CONN_LE_OPT_NONE, \
1325 BT_GAP_SCAN_FAST_INTERVAL, \
1326 BT_GAP_SCAN_FAST_INTERVAL)
1327
1332#define BT_CONN_LE_CREATE_CONN_AUTO \
1333 BT_CONN_LE_CREATE_PARAM(BT_CONN_LE_OPT_NONE, \
1334 BT_GAP_SCAN_FAST_INTERVAL, \
1335 BT_GAP_SCAN_FAST_WINDOW)
1336
1360 const struct bt_conn_le_create_param *create_param,
1361 const struct bt_le_conn_param *conn_param,
1362 struct bt_conn **conn);
1363
1376
1396int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv,
1397 const struct bt_conn_le_create_synced_param *synced_param,
1398 const struct bt_le_conn_param *conn_param, struct bt_conn **conn);
1399
1416 const struct bt_le_conn_param *conn_param);
1417
1423
1438__deprecated int bt_le_set_auto_conn(const bt_addr_le_t *addr,
1439 const struct bt_le_conn_param *param);
1440
1477int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec);
1478
1483bt_security_t bt_conn_get_security(const struct bt_conn *conn);
1484
1494uint8_t bt_conn_enc_key_size(const struct bt_conn *conn);
1495
1527
1532
1570
1572 /* The ID associated with the desired configuration (0 to 3) */
1574
1575 /* State of the CS procedure */
1577
1578 /* Antenna configuration index */
1580
1581 /* Transmit power level used for CS procedures (-127 to 20 dB; 0x7F if unavailable) */
1583
1584 /* Duration of each CS subevent in microseconds (1250 us to 4 s) */
1586
1587 /* Number of CS subevents anchored off the same ACL connection event (0x01 to 0x20) */
1589
1590 /* Time between consecutive CS subevents anchored off the same ACL connection event in
1591 * units of 0.625 ms
1592 */
1594
1595 /* Number of ACL connection events between consecutive CS event anchor points */
1597
1598 /* Number of ACL connection events between consecutive CS procedure anchor points */
1600
1601 /* Number of CS procedures to be scheduled (0 if procedures to continue until disabled) */
1603
1604 /* Maximum duration for each procedure in units of 0.625 ms (0x0001 to 0xFFFF) */
1606};
1607
1643 void (*connected)(struct bt_conn *conn, uint8_t err);
1644
1662 void (*disconnected)(struct bt_conn *conn, uint8_t reason);
1663
1676 void (*recycled)(void);
1677
1702 bool (*le_param_req)(struct bt_conn *conn,
1703 struct bt_le_conn_param *param);
1704
1715 void (*le_param_updated)(struct bt_conn *conn, uint16_t interval,
1716 uint16_t latency, uint16_t timeout);
1717#if defined(CONFIG_BT_SMP)
1727 void (*identity_resolved)(struct bt_conn *conn,
1728 const bt_addr_le_t *rpa,
1729 const bt_addr_le_t *identity);
1730#endif /* CONFIG_BT_SMP */
1731#if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC)
1748 void (*security_changed)(struct bt_conn *conn, bt_security_t level,
1749 enum bt_security_err err);
1750#endif /* defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC) */
1751
1752#if defined(CONFIG_BT_REMOTE_INFO)
1761 void (*remote_info_available)(struct bt_conn *conn,
1762 struct bt_conn_remote_info *remote_info);
1763#endif /* defined(CONFIG_BT_REMOTE_INFO) */
1764
1765#if defined(CONFIG_BT_USER_PHY_UPDATE)
1774 void (*le_phy_updated)(struct bt_conn *conn,
1775 struct bt_conn_le_phy_info *param);
1776#endif /* defined(CONFIG_BT_USER_PHY_UPDATE) */
1777
1778#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
1787 void (*le_data_len_updated)(struct bt_conn *conn,
1788 struct bt_conn_le_data_len_info *info);
1789#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
1790
1791#if defined(CONFIG_BT_DF_CONNECTION_CTE_RX)
1798 void (*cte_report_cb)(struct bt_conn *conn,
1799 const struct bt_df_conn_iq_samples_report *iq_report);
1800#endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */
1801
1802#if defined(CONFIG_BT_TRANSMIT_POWER_CONTROL)
1814 void (*tx_power_report)(struct bt_conn *conn,
1815 const struct bt_conn_le_tx_power_report *report);
1816#endif /* CONFIG_BT_TRANSMIT_POWER_CONTROL */
1817
1818#if defined(CONFIG_BT_PATH_LOSS_MONITORING)
1828 void (*path_loss_threshold_report)(struct bt_conn *conn,
1829 const struct bt_conn_le_path_loss_threshold_report *report);
1830#endif /* CONFIG_BT_PATH_LOSS_MONITORING */
1831
1832#if defined(CONFIG_BT_SUBRATING)
1843 void (*subrate_changed)(struct bt_conn *conn,
1844 const struct bt_conn_le_subrate_changed *params);
1845#endif /* CONFIG_BT_SUBRATING */
1846
1847#if defined(CONFIG_BT_CHANNEL_SOUNDING)
1856 void (*le_cs_remote_capabilities_available)(struct bt_conn *conn,
1857 struct bt_conn_le_cs_capabilities *params);
1858
1867 void (*le_cs_remote_fae_table_available)(struct bt_conn *conn,
1868 struct bt_conn_le_cs_fae_table *params);
1869
1878 void (*le_cs_config_created)(struct bt_conn *conn, struct bt_conn_le_cs_config *config);
1879
1888 void (*le_cs_config_removed)(struct bt_conn *conn, uint8_t config_id);
1889
1898 void (*le_cs_subevent_data_available)(struct bt_conn *conn,
1899 struct bt_conn_le_cs_subevent_result *result);
1900
1908 void (*le_cs_security_enabled)(struct bt_conn *conn);
1909
1918 void (*le_cs_procedure_enabled)(
1919 struct bt_conn *conn, struct bt_conn_le_cs_procedure_enable_complete *params);
1920
1921#endif
1922
1924 sys_snode_t _node;
1925};
1926
1937
1950
1956#define BT_CONN_CB_DEFINE(_name) \
1957 static const STRUCT_SECTION_ITERABLE(bt_conn_cb, \
1958 _CONCAT(bt_conn_cb_, \
1959 _name))
1960
1967#if defined(CONFIG_BT_SECURITY_ERR_TO_STR)
1968const char *bt_security_err_to_str(enum bt_security_err err);
1969#else
1970static inline const char *bt_security_err_to_str(enum bt_security_err err)
1971{
1972 ARG_UNUSED(err);
1973
1974 return "";
1975}
1976#endif
1977
1988void bt_set_bondable(bool enable);
1989
2000
2019int bt_conn_set_bondable(struct bt_conn *conn, bool enable);
2020
2027void bt_le_oob_set_sc_flag(bool enable);
2028
2036
2048int bt_le_oob_set_legacy_tk(struct bt_conn *conn, const uint8_t *tk);
2049
2068int bt_le_oob_set_sc_data(struct bt_conn *conn,
2069 const struct bt_le_oob_sc_data *oobd_local,
2070 const struct bt_le_oob_sc_data *oobd_remote);
2071
2087int bt_le_oob_get_sc_data(struct bt_conn *conn,
2088 const struct bt_le_oob_sc_data **oobd_local,
2089 const struct bt_le_oob_sc_data **oobd_remote);
2090
2095#define BT_PASSKEY_INVALID 0xffffffff
2096
2110int bt_passkey_set(unsigned int passkey);
2111
2143
2144#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
2174#endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */
2175
2178#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
2207 enum bt_security_err (*pairing_accept)(struct bt_conn *conn,
2208 const struct bt_conn_pairing_feat *const feat);
2209#endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */
2210
2229 void (*passkey_display)(struct bt_conn *conn, unsigned int passkey);
2230
2231#if defined(CONFIG_BT_PASSKEY_KEYPRESS)
2253 void (*passkey_display_keypress)(struct bt_conn *conn,
2254 enum bt_conn_auth_keypress type);
2255#endif
2256
2275 void (*passkey_entry)(struct bt_conn *conn);
2276
2298 void (*passkey_confirm)(struct bt_conn *conn, unsigned int passkey);
2299
2316 void (*oob_data_request)(struct bt_conn *conn,
2317 struct bt_conn_oob_info *info);
2318
2331 void (*cancel)(struct bt_conn *conn);
2332
2351 void (*pairing_confirm)(struct bt_conn *conn);
2352
2353#if defined(CONFIG_BT_CLASSIC)
2372 void (*pincode_entry)(struct bt_conn *conn, bool highsec);
2373#endif
2374};
2375
2387 void (*pairing_complete)(struct bt_conn *conn, bool bonded);
2388
2394 void (*pairing_failed)(struct bt_conn *conn,
2395 enum bt_security_err reason);
2396
2405 void (*bond_deleted)(uint8_t id, const bt_addr_le_t *peer);
2406
2409};
2410
2421
2436int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb);
2437
2448
2458
2469int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey);
2470
2486int bt_conn_auth_keypress_notify(struct bt_conn *conn, enum bt_conn_auth_keypress type);
2487
2496int bt_conn_auth_cancel(struct bt_conn *conn);
2497
2507int bt_conn_auth_passkey_confirm(struct bt_conn *conn);
2508
2518int bt_conn_auth_pairing_confirm(struct bt_conn *conn);
2519
2530int bt_conn_auth_pincode_entry(struct bt_conn *conn, const char *pin);
2531
2536
2541#define BT_BR_CONN_PARAM_INIT(role_switch) \
2542{ \
2543 .allow_role_switch = (role_switch), \
2544}
2545
2550#define BT_BR_CONN_PARAM(role_switch) \
2551 ((struct bt_br_conn_param[]) { \
2552 BT_BR_CONN_PARAM_INIT(role_switch) \
2553 })
2554
2558#define BT_BR_CONN_PARAM_DEFAULT BT_BR_CONN_PARAM(true)
2559
2560
2573struct bt_conn *bt_conn_create_br(const bt_addr_t *peer,
2574 const struct bt_br_conn_param *param);
2575
2576#ifdef __cplusplus
2577}
2578#endif
2579
2584#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.
bt_conn_le_cs_sub_mode
Channel sounding sub mode.
Definition conn.h:427
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.
bool bt_get_bondable(void)
Get bonding flag.
bt_conn_le_cs_role
Channel sounding role.
Definition conn.h:439
int bt_le_oob_set_legacy_tk(struct bt_conn *conn, const uint8_t *tk)
Set OOB Temporary Key to be used for pairing.
bt_conn_le_cs_main_mode
Channel sounding main mode.
Definition conn.h:417
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:827
bt_conn_le_cs_procedure_abort_reason
Procedure abort reason.
Definition conn.h:555
static const char * bt_security_err_to_str(enum bt_security_err err)
Converts a security error to string.
Definition conn.h:1970
int bt_passkey_set(unsigned int passkey)
Set a fixed passkey to be used for pairing.
bt_conn_le_cs_chsel_type
Channel sounding channel selection type.
Definition conn.h:475
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:1027
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.
bt_conn_le_cs_subevent_abort_reason
Subevent abort reason.
Definition conn.h:567
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:909
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.
bt_conn_le_cs_subevent_done_status
Subevent done status.
Definition conn.h:549
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:797
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.
bt_conn_le_cs_procedure_done_status
Procedure done status.
Definition conn.h:542
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:1496
int bt_conn_cb_register(struct bt_conn_cb *cb)
Register connection callbacks.
bt_conn_le_cs_sync_phy
Channel sounding PHY used for CS sync.
Definition conn.h:465
int bt_conn_le_param_update(struct bt_conn *conn, const struct bt_le_conn_param *param)
Update the connection parameters.
bt_conn_le_cs_tone_antenna_config_selection
CS Test Tone Antennna Config Selection.
Definition conn.h:1560
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:809
bt_conn_le_cs_ch3c_shape
Channel sounding channel sequence shape.
Definition conn.h:483
bt_conn_le_cs_procedure_enable_state
Definition conn.h:1528
bt_conn_le_path_loss_zone
Path Loss zone that has been entered.
Definition conn.h:979
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_type
Channel sounding RTT type.
Definition conn.h:447
@ BT_CONN_LE_CS_SUB_MODE_3
Mode-3 (RTT and PBR)
Definition conn.h:435
@ BT_CONN_LE_CS_SUB_MODE_UNUSED
Unused.
Definition conn.h:429
@ BT_CONN_LE_CS_SUB_MODE_1
Mode-1 (RTT)
Definition conn.h:431
@ BT_CONN_LE_CS_SUB_MODE_2
Mode-2 (PBR)
Definition conn.h:433
@ BT_CONN_LE_CS_ROLE_REFLECTOR
CS reflector role.
Definition conn.h:443
@ BT_CONN_LE_CS_ROLE_INITIATOR
CS initiator role.
Definition conn.h:441
@ BT_CONN_LE_CS_MAIN_MODE_1
Mode-1 (RTT)
Definition conn.h:419
@ BT_CONN_LE_CS_MAIN_MODE_2
Mode-2 (PBR)
Definition conn.h:421
@ BT_CONN_LE_CS_MAIN_MODE_3
Mode-3 (RTT and PBR)
Definition conn.h:423
@ 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:831
@ BT_SECURITY_FLAG_SC
Paired with Secure Connections.
Definition conn.h:829
@ BT_CONN_LE_CS_PROCEDURE_ABORT_REQUESTED
Definition conn.h:557
@ BT_CONN_LE_CS_PROCEDURE_ABORT_TOO_FEW_CHANNELS
Definition conn.h:559
@ BT_CONN_LE_CS_PROCEDURE_NOT_ABORTED
Definition conn.h:556
@ BT_CONN_LE_CS_PROCEDURE_ABORT_UNSPECIFIED
Definition conn.h:563
@ BT_CONN_LE_CS_PROCEDURE_ABORT_CHMAP_INSTANT_PASSED
Definition conn.h:561
@ BT_CONN_LE_CS_CHSEL_TYPE_3C
Use Channel Selection Algorithm #3c for non-mode-0 CS steps.
Definition conn.h:479
@ BT_CONN_LE_CS_CHSEL_TYPE_3B
Use Channel Selection Algorithm #3b for non-mode-0 CS steps.
Definition conn.h:477
@ 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:1030
@ BT_CONN_AUTH_KEYPRESS_DIGIT_ENTERED
Definition conn.h:1029
@ BT_CONN_AUTH_KEYPRESS_CLEARED
Definition conn.h:1031
@ BT_CONN_AUTH_KEYPRESS_ENTRY_STARTED
Definition conn.h:1028
@ BT_CONN_AUTH_KEYPRESS_ENTRY_COMPLETED
Definition conn.h:1032
@ BT_CONN_ROLE_PERIPHERAL
Definition conn.h:794
@ BT_CONN_ROLE_CENTRAL
Definition conn.h:793
@ BT_CONN_LE_CS_SUBEVENT_NOT_ABORTED
Definition conn.h:568
@ BT_CONN_LE_CS_SUBEVENT_ABORT_UNSPECIFIED
Definition conn.h:575
@ BT_CONN_LE_CS_SUBEVENT_ABORT_REQUESTED
Definition conn.h:569
@ BT_CONN_LE_CS_SUBEVENT_ABORT_SCHED_CONFLICT
Definition conn.h:573
@ BT_CONN_LE_CS_SUBEVENT_ABORT_NO_CS_SYNC
Definition conn.h:571
@ BT_CONN_LE_TX_POWER_PHY_NONE
Convenience macro for when no PHY is set.
Definition conn.h:911
@ BT_CONN_LE_TX_POWER_PHY_CODED_S2
LE Coded PHY using S=2 coding.
Definition conn.h:919
@ BT_CONN_LE_TX_POWER_PHY_CODED_S8
LE Coded PHY using S=8 coding.
Definition conn.h:917
@ BT_CONN_LE_TX_POWER_PHY_1M
LE 1M PHY.
Definition conn.h:913
@ BT_CONN_LE_TX_POWER_PHY_2M
LE 2M PHY.
Definition conn.h:915
@ BT_CONN_LE_CS_SUBEVENT_ABORTED
Definition conn.h:551
@ BT_CONN_LE_CS_SUBEVENT_COMPLETE
Definition conn.h:550
@ BT_CONN_STATE_CONNECTING
Channel in connecting state.
Definition conn.h:801
@ BT_CONN_STATE_CONNECTED
Channel connected and ready for upper layer traffic on it.
Definition conn.h:803
@ BT_CONN_STATE_DISCONNECTED
Channel disconnected.
Definition conn.h:799
@ BT_CONN_STATE_DISCONNECTING
Channel in disconnecting state.
Definition conn.h:805
@ 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_CONN_LE_CS_PROCEDURE_ABORTED
Definition conn.h:545
@ BT_CONN_LE_CS_PROCEDURE_COMPLETE
Definition conn.h:543
@ BT_CONN_LE_CS_PROCEDURE_INCOMPLETE
Definition conn.h:544
@ BT_SECURITY_ERR_OOB_NOT_AVAILABLE
OOB data is not available.
Definition conn.h:1507
@ BT_SECURITY_ERR_AUTH_REQUIREMENT
The requested security level could not be reached.
Definition conn.h:1510
@ BT_SECURITY_ERR_KEY_REJECTED
Distributed Key Rejected.
Definition conn.h:1522
@ BT_SECURITY_ERR_UNSPECIFIED
Pairing failed but the exact reason could not be specified.
Definition conn.h:1525
@ BT_SECURITY_ERR_INVALID_PARAM
Invalid parameters.
Definition conn.h:1519
@ BT_SECURITY_ERR_PAIR_NOT_SUPPORTED
Pairing is not supported.
Definition conn.h:1513
@ BT_SECURITY_ERR_AUTH_FAIL
Authentication failed.
Definition conn.h:1501
@ BT_SECURITY_ERR_PIN_OR_KEY_MISSING
PIN or encryption key is missing.
Definition conn.h:1504
@ BT_SECURITY_ERR_SUCCESS
Security procedure successful.
Definition conn.h:1498
@ BT_SECURITY_ERR_PAIR_NOT_ALLOWED
Pairing is not allowed.
Definition conn.h:1516
@ BT_CONN_LE_OPT_NONE
Convenience value when no options are specified.
Definition conn.h:1229
@ BT_CONN_LE_OPT_NO_1M
Disable LE 1M PHY.
Definition conn.h:1243
@ BT_CONN_LE_OPT_CODED
Enable LE Coded PHY.
Definition conn.h:1235
@ BT_CONN_LE_CS_SYNC_1M_PHY
LE 1M PHY.
Definition conn.h:467
@ BT_CONN_LE_CS_SYNC_2M_PHY
LE 2M PHY.
Definition conn.h:469
@ BT_CONN_LE_CS_SYNC_2M_2BT_PHY
LE 2M 2BT PHY.
Definition conn.h:471
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_TWO
Definition conn.h:1562
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_FIVE
Definition conn.h:1565
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_SEVEN
Definition conn.h:1567
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_FOUR
Definition conn.h:1564
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_EIGHT
Definition conn.h:1568
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_SIX
Definition conn.h:1566
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_ONE
Definition conn.h:1561
@ BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_THREE
Definition conn.h:1563
@ 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:819
@ BT_SECURITY_L0
Level 0: Only for BR/EDR special cases, like SDP.
Definition conn.h:811
@ BT_SECURITY_L3
Level 3: Encryption and authentication (MITM).
Definition conn.h:817
@ BT_SECURITY_FORCE_PAIR
Bit to force new pairing procedure, bit-wise OR with requested security level.
Definition conn.h:823
@ BT_SECURITY_L1
Level 1: No encryption and no authentication.
Definition conn.h:813
@ BT_SECURITY_L2
Level 2: Encryption and no authentication (no MITM).
Definition conn.h:815
@ BT_CONN_LE_CS_CH3C_SHAPE_HAT
Use Hat shape for user-specified channel sequence.
Definition conn.h:485
@ BT_CONN_LE_CS_CH3C_SHAPE_X
Use X shape for user-specified channel sequence.
Definition conn.h:487
@ BT_CONN_LE_CS_PROCEDURES_ENABLED
Definition conn.h:1530
@ BT_CONN_LE_CS_PROCEDURES_DISABLED
Definition conn.h:1529
@ BT_CONN_LE_PATH_LOSS_ZONE_ENTERED_MIDDLE
Middle path loss zone entered.
Definition conn.h:983
@ BT_CONN_LE_PATH_LOSS_ZONE_ENTERED_LOW
Low path loss zone entered.
Definition conn.h:981
@ BT_CONN_LE_PATH_LOSS_ZONE_ENTERED_HIGH
High path loss zone entered.
Definition conn.h:985
@ BT_CONN_LE_PATH_LOSS_ZONE_UNAVAILABLE
Path loss has become unavailable.
Definition conn.h:987
@ 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
@ BT_CONN_LE_CS_RTT_TYPE_96_BIT_SOUNDING
RTT with 96-bit sounding sequence.
Definition conn.h:453
@ BT_CONN_LE_CS_RTT_TYPE_32_BIT_SOUNDING
RTT with 32-bit sounding sequence.
Definition conn.h:451
@ BT_CONN_LE_CS_RTT_TYPE_128_BIT_RANDOM
RTT with 128-bit random sequence.
Definition conn.h:461
@ BT_CONN_LE_CS_RTT_TYPE_AA_ONLY
RTT AA only.
Definition conn.h:449
@ BT_CONN_LE_CS_RTT_TYPE_96_BIT_RANDOM
RTT with 96-bit random sequence.
Definition conn.h:459
@ BT_CONN_LE_CS_RTT_TYPE_32_BIT_RANDOM
RTT with 32-bit random sequence.
Definition conn.h:455
@ BT_CONN_LE_CS_RTT_TYPE_64_BIT_RANDOM
RTT with 64-bit random sequence.
Definition conn.h:457
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_CS_PROCEDURE_ABORT_REASON_NO_ABORT
Definition hci_types.h:3618
#define BT_HCI_LE_CS_SUBEVENT_ABORT_REASON_NO_ABORT
Definition hci_types.h:3624
#define BT_HCI_LE_CS_PROCEDURE_ABORT_REASON_UNSPECIFIED
Definition hci_types.h:3622
#define BT_HCI_OP_LE_CS_RTT_TYPE_128BIT_RAND
Definition hci_types.h:2563
#define BT_HCI_OP_LE_CS_SUB_MODE_1
Definition hci_types.h:2549
#define BT_HCI_LE_CS_PROCEDURE_ABORT_REASON_LOCAL_HOST_OR_REMOTE_REQUEST
Definition hci_types.h:3619
#define BT_HCI_LE_CS_SUBEVENT_ABORT_REASON_SCHED_CONFLICT
Definition hci_types.h:3627
#define BT_HCI_OP_LE_CS_PROCEDURES_DISABLED
Definition hci_types.h:2534
#define BT_HCI_LE_CS_SUBEVENT_ABORT_REASON_LOCAL_HOST_OR_REMOTE_REQUEST
Definition hci_types.h:3625
#define BT_HCI_OP_LE_CS_PROCEDURES_ENABLED
Definition hci_types.h:2535
#define BT_HCI_OP_LE_CS_SUB_MODE_3
Definition hci_types.h:2551
#define BT_HCI_OP_LE_CS_ACI_6
Definition hci_types.h:2578
#define BT_HCI_OP_LE_CS_ACI_1
Definition hci_types.h:2573
#define BT_HCI_OP_LE_CS_MAIN_MODE_3
Definition hci_types.h:2547
#define BT_HCI_LE_CS_PROCEDURE_ABORT_REASON_TOO_FEW_CHANNELS
Definition hci_types.h:3620
#define BT_HCI_OP_LE_CS_MAIN_MODE_2
Definition hci_types.h:2546
#define BT_HCI_OP_LE_CS_RTT_TYPE_96BIT_SOUND
Definition hci_types.h:2559
#define BT_HCI_OP_LE_CS_RTT_TYPE_AA_ONLY
Definition hci_types.h:2557
#define BT_HCI_OP_LE_CS_ACI_3
Definition hci_types.h:2575
#define BT_HCI_OP_LE_CS_TEST_CHSEL_TYPE_3B
Definition hci_types.h:2598
#define BT_HCI_OP_LE_CS_RTT_TYPE_64BIT_RAND
Definition hci_types.h:2561
#define BT_HCI_OP_LE_CS_CS_SYNC_1M
Definition hci_types.h:2565
#define BT_HCI_LE_CS_PROCEDURE_DONE_STATUS_ABORTED
Definition hci_types.h:3612
#define BT_HCI_OP_LE_CS_ACI_0
Definition hci_types.h:2572
#define BT_HCI_OP_LE_CS_RTT_TYPE_32BIT_SOUND
Definition hci_types.h:2558
#define BT_HCI_OP_LE_CS_RTT_TYPE_96BIT_RAND
Definition hci_types.h:2562
#define BT_HCI_OP_LE_CS_ACI_2
Definition hci_types.h:2574
#define BT_HCI_OP_LE_CS_SUB_MODE_UNUSED
Definition hci_types.h:2552
#define BT_HCI_LE_ZONE_ENTERED_MIDDLE
Definition hci_types.h:3396
#define BT_HCI_OP_LE_CS_RTT_TYPE_32BIT_RAND
Definition hci_types.h:2560
#define BT_HCI_LE_CS_SUBEVENT_ABORT_REASON_UNSPECIFIED
Definition hci_types.h:3628
#define BT_HCI_OP_LE_CS_CS_SYNC_2M_2BT
Definition hci_types.h:2567
#define BT_HCI_LE_CS_SUBEVENT_ABORT_REASON_NO_CS_SYNC_RECEIVED
Definition hci_types.h:3626
#define BT_HCI_OP_LE_CS_ACI_7
Definition hci_types.h:2579
#define BT_HCI_OP_LE_CS_TEST_CH3C_SHAPE_HAT
Definition hci_types.h:2601
#define BT_HCI_LE_CS_PROCEDURE_DONE_STATUS_COMPLETE
Definition hci_types.h:3610
#define BT_HCI_OP_LE_CS_TEST_CH3C_SHAPE_X
Definition hci_types.h:2602
#define BT_HCI_OP_LE_CS_ACI_5
Definition hci_types.h:2577
#define BT_HCI_OP_LE_CS_SUB_MODE_2
Definition hci_types.h:2550
#define BT_HCI_OP_LE_CS_CS_SYNC_2M
Definition hci_types.h:2566
#define BT_HCI_LE_CS_PROCEDURE_ABORT_REASON_CHMAP_INSTANT_PASSED
Definition hci_types.h:3621
#define BT_HCI_LE_CS_SUBEVENT_DONE_STATUS_COMPLETE
Definition hci_types.h:3614
#define BT_HCI_LE_CS_PROCEDURE_DONE_STATUS_PARTIAL
Definition hci_types.h:3611
#define BT_HCI_OP_LE_CS_ACI_4
Definition hci_types.h:2576
#define BT_HCI_OP_LE_CS_TEST_CHSEL_TYPE_3C
Definition hci_types.h:2599
#define BT_HCI_LE_CS_SUBEVENT_DONE_STATUS_ABORTED
Definition hci_types.h:3616
#define BT_HCI_OP_LE_CS_MAIN_MODE_1
Definition hci_types.h:2545
#define BT_HCI_LE_ZONE_ENTERED_HIGH
Definition hci_types.h:3397
#define BT_HCI_LE_ZONE_ENTERED_LOW
Definition hci_types.h:3395
#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:2533
bool allow_role_switch
Definition conn.h:2534
Authenticated pairing callback structure.
Definition conn.h:2177
void(* passkey_entry)(struct bt_conn *conn)
Request the user to enter a passkey.
Definition conn.h:2275
void(* passkey_display)(struct bt_conn *conn, unsigned int passkey)
Display a passkey to the user.
Definition conn.h:2229
void(* passkey_confirm)(struct bt_conn *conn, unsigned int passkey)
Request the user to confirm a passkey.
Definition conn.h:2298
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:2207
void(* pincode_entry)(struct bt_conn *conn, bool highsec)
Request the user to enter a passkey.
Definition conn.h:2372
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:2316
void(* pairing_confirm)(struct bt_conn *conn)
Request confirmation for an incoming pairing.
Definition conn.h:2351
void(* cancel)(struct bt_conn *conn)
Cancel the ongoing user request.
Definition conn.h:2331
Authenticated pairing information callback structure.
Definition conn.h:2377
void(* pairing_failed)(struct bt_conn *conn, enum bt_security_err reason)
notify that pairing process has failed.
Definition conn.h:2394
void(* pairing_complete)(struct bt_conn *conn, bool bonded)
notify that pairing procedure was complete.
Definition conn.h:2387
void(* bond_deleted)(uint8_t id, const bt_addr_le_t *peer)
Notify that bond has been deleted.
Definition conn.h:2405
sys_snode_t node
Internally used field for list handling.
Definition conn.h:2408
BR/EDR Connection Info Structure.
Definition conn.h:788
const bt_addr_t * dst
Destination (Remote) BR/EDR address.
Definition conn.h:789
BR/EDR Connection Remote Info structure.
Definition conn.h:873
uint8_t num_pages
Number of pages in the remote feature set.
Definition conn.h:879
const uint8_t * features
Remote feature set (pages of bitmasks).
Definition conn.h:876
Connection callback structure.
Definition conn.h:1618
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:1715
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:1787
void(* recycled)(void)
A connection object has been returned to the pool.
Definition conn.h:1676
bool(* le_param_req)(struct bt_conn *conn, struct bt_le_conn_param *param)
LE connection parameter update request.
Definition conn.h:1702
void(* disconnected)(struct bt_conn *conn, uint8_t reason)
A connection has been disconnected.
Definition conn.h:1662
void(* connected)(struct bt_conn *conn, uint8_t err)
A new connection has been established.
Definition conn.h:1643
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:1774
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:1748
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:1727
void(* remote_info_available)(struct bt_conn *conn, struct bt_conn_remote_info *remote_info)
Remote information procedures has completed.
Definition conn.h:1761
Connection Info Structure.
Definition conn.h:845
uint8_t id
Which local identity the connection was created with.
Definition conn.h:851
struct bt_conn_le_info le
LE Connection specific Info.
Definition conn.h:855
enum bt_conn_type type
Connection Type.
Definition conn.h:847
struct bt_conn_br_info br
BR/EDR Connection specific Info.
Definition conn.h:857
uint8_t role
Connection Role.
Definition conn.h:849
struct bt_security_info security
Security specific info.
Definition conn.h:862
enum bt_conn_state state
Connection state.
Definition conn.h:860
Definition conn.h:1246
uint16_t interval_coded
Scan interval LE Coded PHY (N * 0.625 MS)
Definition conn.h:1275
uint16_t window
Scan window (N * 0.625 ms)
Definition conn.h:1269
uint32_t options
Bit-field of create connection options.
Definition conn.h:1249
uint16_t timeout
Connection initiation timeout (N * 10 MS)
Definition conn.h:1290
uint16_t interval
Scan interval (N * 0.625 ms)
Definition conn.h:1259
uint16_t window_coded
Scan window LE Coded PHY (N * 0.625 MS)
Definition conn.h:1281
Definition conn.h:1364
const bt_addr_le_t * peer
Remote address.
Definition conn.h:1371
uint8_t subevent
The subevent where the connection will be initiated.
Definition conn.h:1374
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
Channel sounding configuration.
Definition conn.h:491
enum bt_conn_le_cs_main_mode main_mode_type
Main CS mode type.
Definition conn.h:495
enum bt_conn_le_cs_rtt_type rtt_type
RTT type.
Definition conn.h:512
enum bt_conn_le_cs_sync_phy cs_sync_phy
CS Sync PHY.
Definition conn.h:514
uint8_t t_fcs_time_us
Time in microseconds for frequency changes.
Definition conn.h:530
uint8_t min_main_mode_steps
Minimum number of CS main mode steps to be executed before a submode step is executed.
Definition conn.h:499
uint8_t main_mode_repetition
Number of main mode steps taken from the end of the last CS subevent to be repeated at the beginning ...
Definition conn.h:506
enum bt_conn_le_cs_sub_mode sub_mode_type
Sub CS mode type.
Definition conn.h:497
uint8_t channel_map[10]
Channel map used for CS procedure Channels n = 0, 1, 23, 24, 25, 77, and 78 are not allowed and shall...
Definition conn.h:538
enum bt_conn_le_cs_chsel_type channel_selection_type
Channel selection type.
Definition conn.h:520
uint8_t t_ip2_time_us
Interlude time in microseconds between the CS tones.
Definition conn.h:528
uint8_t mode_0_steps
Number of CS mode-0 steps to be included at the beginning of each CS subevent.
Definition conn.h:508
uint8_t channel_map_repetition
The number of times the Channel_Map field will be cycled through for non-mode-0 steps within a CS pro...
Definition conn.h:518
enum bt_conn_le_cs_ch3c_shape ch3c_shape
User-specified channel sequence shape.
Definition conn.h:522
uint8_t t_ip1_time_us
Interlude time in microseconds between the RTT packets.
Definition conn.h:526
uint8_t id
CS configuration ID.
Definition conn.h:493
enum bt_conn_le_cs_role role
CS role.
Definition conn.h:510
uint8_t t_pm_time_us
Time in microseconds for the phase measurement period of the CS tones.
Definition conn.h:532
uint8_t ch3c_jump
Number of channels skipped in each rising and falling sequence
Definition conn.h:524
uint8_t max_main_mode_steps
Maximum number of CS main mode steps to be executed before a submode step is executed.
Definition conn.h:501
Remote FAE Table for LE connections supporting CS.
Definition conn.h:412
int8_t * remote_fae_table
Definition conn.h:413
uint8_t config_id
Definition conn.h:1573
enum bt_conn_le_cs_tone_antenna_config_selection tone_antenna_config_selection
Definition conn.h:1579
uint8_t subevents_per_event
Definition conn.h:1588
uint16_t event_interval
Definition conn.h:1596
uint16_t subevent_interval
Definition conn.h:1593
uint16_t procedure_interval
Definition conn.h:1599
uint16_t procedure_count
Definition conn.h:1602
enum bt_conn_le_cs_procedure_enable_state state
Definition conn.h:1576
uint16_t max_procedure_len
Definition conn.h:1605
uint32_t subevent_len
Definition conn.h:1585
int8_t selected_tx_power
Definition conn.h:1582
Subevent data for LE connections supporting CS.
Definition conn.h:579
struct bt_conn_le_cs_subevent_result::@90 header
uint16_t procedure_counter
CS procedure count associated with these results.
Definition conn.h:600
uint8_t num_antenna_paths
Number of antenna paths used during the phase measurement stage.
Definition conn.h:650
uint8_t num_steps_reported
Number of CS steps in the subevent.
Definition conn.h:653
enum bt_conn_le_cs_subevent_done_status subevent_done_status
Subevent status.
Definition conn.h:633
struct net_buf_simple * step_data_buf
Pointer to buffer containing step data.
Definition conn.h:663
uint16_t start_acl_conn_event
Starting ACL connection event counter.
Definition conn.h:594
enum bt_conn_le_cs_procedure_abort_reason procedure_abort_reason
Abort reason.
Definition conn.h:640
uint16_t frequency_compensation
Frequency compensation value in units of 0.01 ppm.
Definition conn.h:609
uint8_t abort_step
Step number, on which the subevent was aborted if subevent_done_status is BT_CONN_LE_CS_SUBEVENT_COMP...
Definition conn.h:658
uint8_t config_id
CS configuration identifier.
Definition conn.h:588
int8_t reference_power_level
Reference power level in dBm.
Definition conn.h:617
enum bt_conn_le_cs_procedure_done_status procedure_done_status
Procedure status.
Definition conn.h:619
enum bt_conn_le_cs_subevent_abort_reason subevent_abort_reason
Abort reason.
Definition conn.h:647
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:742
const bt_addr_le_t * dst
Destination (Remote) Identity Address or remote Resolvable Private Address (RPA) before identity has ...
Definition conn.h:748
const struct bt_conn_le_phy_info * phy
Definition conn.h:758
const bt_addr_le_t * remote
Remote device address used during connection setup.
Definition conn.h:752
const bt_addr_le_t * local
Local device address used during connection setup.
Definition conn.h:750
const bt_addr_le_t * src
Source (Local) Identity Address.
Definition conn.h:744
uint16_t interval
Connection interval.
Definition conn.h:753
uint16_t latency
Connection peripheral latency.
Definition conn.h:754
const struct bt_conn_le_data_len_info * data_len
Definition conn.h:763
uint16_t timeout
Connection supervision timeout.
Definition conn.h:755
LE Path Loss Monitoring Parameters Structure as defined in Core Spec.
Definition conn.h:1007
uint8_t high_threshold
High threshold for the path loss (dB).
Definition conn.h:1009
uint8_t low_threshold
Low threshold for the path loss (dB).
Definition conn.h:1013
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:1019
uint8_t high_hysteresis
Hysteresis value for the high threshold (dB).
Definition conn.h:1011
uint8_t low_hysteresis
Hysteresis value for the low threshold (dB).
Definition conn.h:1015
LE Path Loss Monitoring Threshold Change Report Structure.
Definition conn.h:995
enum bt_conn_le_path_loss_zone zone
Path Loss zone as documented in Core Spec.
Definition conn.h:998
uint8_t path_loss
Current path loss (dB).
Definition conn.h:1001
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:866
const uint8_t * features
Remote LE feature set (bitmask).
Definition conn.h:869
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:937
enum bt_conn_le_tx_power_phy phy
Phy of Transmit power reporting.
Definition conn.h:945
int8_t delta
Change in transmit power level.
Definition conn.h:968
uint8_t reason
Reason for Transmit power reporting, as documented in Core Spec.
Definition conn.h:942
int8_t tx_power_level
Transmit power level.
Definition conn.h:955
uint8_t tx_power_level_flag
Bit 0: Transmit power level is at minimum level.
Definition conn.h:960
LE Transmit Power Level Structure.
Definition conn.h:923
int8_t max_level
Output: maximum transmit power level.
Definition conn.h:932
int8_t current_level
Output: current transmit power level.
Definition conn.h:929
uint8_t phy
Input: 1M, 2M, Coded S2 or Coded S8.
Definition conn.h:926
Info Structure for OOB pairing.
Definition conn.h:2113
enum bt_conn_oob_info::@95 type
Type of OOB pairing method.
enum bt_conn_oob_info::@96::@98::@99 oob_config
OOB data configuration.
@ BT_CONN_OOB_LE_LEGACY
LE legacy pairing.
Definition conn.h:2117
@ BT_CONN_OOB_LE_SC
LE SC pairing.
Definition conn.h:2120
@ BT_CONN_OOB_NO_DATA
No OOB data requested.
Definition conn.h:2138
@ BT_CONN_OOB_LOCAL_ONLY
Local OOB data requested.
Definition conn.h:2129
@ BT_CONN_OOB_REMOTE_ONLY
Remote OOB data requested.
Definition conn.h:2132
@ BT_CONN_OOB_BOTH_PEERS
Both local and remote OOB data requested.
Definition conn.h:2135
struct bt_conn_oob_info::@96::@98 lesc
LE Secure Connections OOB pairing parameters.
Pairing request and pairing response info structure.
Definition conn.h:2151
uint8_t resp_key_dist
Responder Key Distribution/Generation, Core Spec.
Definition conn.h:2172
uint8_t io_capability
IO Capability, Core Spec.
Definition conn.h:2153
uint8_t init_key_dist
Initiator Key Distribution/Generation, Core Spec.
Definition conn.h:2167
uint8_t max_enc_key_size
Maximum Encryption Key Size, Core Spec.
Definition conn.h:2162
uint8_t auth_req
AuthReq, Core Spec.
Definition conn.h:2159
uint8_t oob_data_flag
OOB data flag, Core Spec.
Definition conn.h:2156
Connection Remote Info Structure.
Definition conn.h:887
uint8_t version
Remote Link Layer version.
Definition conn.h:892
uint16_t subversion
Per-manufacturer unique revision.
Definition conn.h:898
uint16_t manufacturer
Remote manufacturer identifier.
Definition conn.h:895
uint8_t type
Connection Type.
Definition conn.h:889
struct bt_conn_br_remote_info br
BR/EDR connection remote info.
Definition conn.h:905
struct bt_conn_le_remote_info le
LE connection remote info.
Definition conn.h:902
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:2540
Security Info Structure.
Definition conn.h:835
uint8_t enc_key_size
Encryption Key Size.
Definition conn.h:839
bt_security_t level
Security Level.
Definition conn.h:837
enum bt_security_flag flags
Flags.
Definition conn.h:841
Simple network buffer representation.
Definition net_buf.h:89