From 58a15689437bbd5f1a6e8c394d7f1eba15ebe8b7 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 15 Jun 2016 10:54:10 +0300 Subject: [PATCH] Bluetooth: Remove #ifdefs from public header files These prevent the documentation from being included in the generated doxygen output. Change-Id: Iffe38c15055b8283d4b9f16b1c830c9f269ba6e4 Signed-off-by: Johan Hedberg --- include/bluetooth/bluetooth.h | 2 -- include/bluetooth/conn.h | 23 ++--------------------- include/bluetooth/driver.h | 10 ++++------ include/bluetooth/gatt.h | 5 ----- include/bluetooth/l2cap.h | 9 --------- 5 files changed, 6 insertions(+), 43 deletions(-) diff --git a/include/bluetooth/bluetooth.h b/include/bluetooth/bluetooth.h index a8232248772..fe48c46ab6f 100644 --- a/include/bluetooth/bluetooth.h +++ b/include/bluetooth/bluetooth.h @@ -381,7 +381,6 @@ static inline int bt_addr_le_to_str(const bt_addr_le_t *addr, char *str, addr->a.val[2], addr->a.val[1], addr->a.val[0], type); } -#if defined(CONFIG_BLUETOOTH_BREDR) /** @brief Enable/disable set controller in discoverable state. * * Allows make local controller to listen on INQUIRY SCAN channel and responds @@ -407,7 +406,6 @@ int bt_br_set_discoverable(bool enable); * already set. Zero if done successfully. */ int bt_br_set_connectable(bool enable); -#endif #ifdef __cplusplus } diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index c7e6483b08c..f84a1b83766 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -31,7 +31,6 @@ extern "C" { #endif -#if defined(CONFIG_BLUETOOTH_CENTRAL) || defined(CONFIG_BLUETOOTH_PERIPHERAL) #include #include @@ -113,9 +112,7 @@ const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn); /** Connection Type */ enum { BT_CONN_TYPE_LE, /** LE Connection Type */ -#if defined(CONFIG_BLUETOOTH_BREDR) BT_CONN_TYPE_BR, /** BR/EDR Connection Type */ -#endif }; /** LE Connection Info Structure */ @@ -127,12 +124,10 @@ struct bt_conn_le_info { uint16_t timeout; /** Connection supervision timeout */ }; -#if defined(CONFIG_BLUETOOTH_BREDR) /** BR/EDR Connection Info Structure */ struct bt_conn_br_info { const bt_addr_t *dst; /** Destination BR/EDR address */ }; -#endif /** Connection role (master or slave) */ enum { @@ -151,9 +146,9 @@ struct bt_conn_info { union { /** LE Connection specific Info */ struct bt_conn_le_info le; -#if defined(CONFIG_BLUETOOTH_BREDR) + + /** BR/EDR Connection specific Info */ struct bt_conn_br_info br; -#endif }; }; @@ -188,7 +183,6 @@ int bt_conn_le_param_update(struct bt_conn *conn, */ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason); -#if defined(CONFIG_BLUETOOTH_CENTRAL) /** @brief Initiate an LE connection to a remote device. * * Allows initiate new LE link to remote peer using its address. @@ -216,9 +210,7 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer, */ int bt_le_set_auto_conn(bt_addr_le_t *addr, const struct bt_le_conn_param *param); -#endif /* CONFIG_BLUETOOTH_CENTRAL */ -#if defined(CONFIG_BLUETOOTH_PERIPHERAL) /** @brief Initiate directed advertising to a remote device * * Allows initiating a new LE connection to remote peer with the remote @@ -241,7 +233,6 @@ int bt_le_set_auto_conn(bt_addr_le_t *addr, */ struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer, const struct bt_le_adv_param *param); -#endif /* CONFIG_BLUETOOTH_PERIPHERAL */ /** Security level. */ typedef enum __packed { @@ -253,7 +244,6 @@ typedef enum __packed { */ } bt_security_t; -#if defined(CONFIG_BLUETOOTH_SMP) || defined(CONFIG_BLUETOOTH_BREDR) /** @brief Set security level for a connection. * * This function enable security (encryption) for a connection. If device is @@ -286,7 +276,6 @@ int bt_conn_security(struct bt_conn *conn, bt_security_t sec); * @return Encryption key size. */ uint8_t bt_conn_enc_key_size(struct bt_conn *conn); -#endif /* CONFIG_BLUETOOTH_SMP || CONFIG_BLUETOOTH_BREDR */ /** Connection callback structure */ struct bt_conn_cb { @@ -313,9 +302,6 @@ struct bt_conn_cb { */ void bt_conn_cb_register(struct bt_conn_cb *cb); -#endif /* CONFIG_BLUETOOTH_CENTRAL || CONFIG_BLUETOOTH_PERIPHERAL */ - -#if defined(CONFIG_BLUETOOTH_SMP) || defined(CONFIG_BLUETOOTH_BREDR) /** Authenticated pairing callback structure */ struct bt_conn_auth_cb { void (*passkey_display)(struct bt_conn *conn, unsigned int passkey); @@ -383,7 +369,6 @@ int bt_conn_auth_passkey_confirm(struct bt_conn *conn); */ int bt_conn_auth_pairing_confirm(struct bt_conn *conn); -#if defined(CONFIG_BLUETOOTH_BREDR) /** @brief Reply with entered PIN code. * * This function should be called only after PIN code callback from @@ -395,10 +380,7 @@ int bt_conn_auth_pairing_confirm(struct bt_conn *conn); * @return Zero on success or negative error code otherwise */ int bt_conn_auth_pincode_entry(struct bt_conn *conn, const char *pin); -#endif /* CONFIG_BLUETOOTH_BREDR */ -#endif /* CONFIG_BLUETOOTH_SMP || CONFIG_BLUETOOTH_BREDR */ -#if defined(CONFIG_BLUETOOTH_BREDR) /** Connection parameters for BR/EDR connections */ struct bt_br_conn_param { bool allow_role_switch; @@ -431,7 +413,6 @@ struct bt_br_conn_param { */ struct bt_conn *bt_conn_create_br(const bt_addr_t *peer, const struct bt_br_conn_param *param); -#endif /* CONFIG_BLUETOOTH_BREDR */ #ifdef __cplusplus } diff --git a/include/bluetooth/driver.h b/include/bluetooth/driver.h index dca15290069..2bb1aa31925 100644 --- a/include/bluetooth/driver.h +++ b/include/bluetooth/driver.h @@ -34,12 +34,11 @@ extern "C" { #endif -#if defined(CONFIG_BLUETOOTH_HOST_BUFFERS) - /** Allocate a buffer for an HCI event * * This will set the BT_BUF_EVT buffer type so bt_buf_set_type() - * doesn't need to be explicitly called. + * doesn't need to be explicitly called. Only available when + * CONFIG_BLUETOOTH_HOST_BUFFERS has been selected. * * @return A new buffer with the BT_BUF_EVT type. */ @@ -48,14 +47,13 @@ struct net_buf *bt_buf_get_evt(void); /** Allocate a buffer for incoming ACL data * * This will set the BT_BUF_ACL_IN buffer type so bt_buf_set_type() - * doesn't need to be explicitly called. + * doesn't need to be explicitly called. Only available when + * CONFIG_BLUETOOTH_HOST_BUFFERS has been selected. * * @return A new buffer with the BT_BUF_ACL_IN type. */ struct net_buf *bt_buf_get_acl(void); -#endif /* CONFIG_BLUETOOTH_HOST_BUFFERS */ - /* Receive data from the controller/HCI driver */ int bt_recv(struct net_buf *buf); diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index 3f8f6a5ab07..453df87d6b7 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -31,7 +31,6 @@ extern "C" { #endif -#if defined(CONFIG_BLUETOOTH_CENTRAL) || defined(CONFIG_BLUETOOTH_PERIPHERAL) #include #include #include @@ -714,7 +713,6 @@ struct bt_gatt_indicate_params { int bt_gatt_indicate(struct bt_conn *conn, struct bt_gatt_indicate_params *params); -#if defined(CONFIG_BLUETOOTH_GATT_CLIENT) /* Client API */ /** @brief Response callback function @@ -967,9 +965,6 @@ int bt_gatt_unsubscribe(struct bt_conn *conn, */ void bt_gatt_cancel(struct bt_conn *conn); -#endif /* CONFIG_BLUETOOTH_GATT_CLIENT */ -#endif /* CONFIG_BLUETOOTH_CENTRAL || CONFIG_BLUETOOTH_PERIPHERAL */ - #ifdef __cplusplus } #endif diff --git a/include/bluetooth/l2cap.h b/include/bluetooth/l2cap.h index cc651baf2a0..c6fb15bd659 100644 --- a/include/bluetooth/l2cap.h +++ b/include/bluetooth/l2cap.h @@ -45,7 +45,6 @@ extern "C" { #endif -#if defined(CONFIG_BLUETOOTH_CENTRAL) || defined(CONFIG_BLUETOOTH_PERIPHERAL) #include #include @@ -85,7 +84,6 @@ struct bt_l2cap_le_chan { uint16_t _sdu_len; }; -#if defined(CONFIG_BLUETOOTH_BREDR) /** @brief BREDR L2CAP Endpoint structure. */ struct bt_l2cap_br_endpoint { /** Endpoint CID */ @@ -103,7 +101,6 @@ struct bt_l2cap_br_chan { /** Channel Transmission Endpoint */ struct bt_l2cap_br_endpoint tx; }; -#endif /* CONFIG_BLUETOOTH_BREDR */ /** @brief L2CAP Channel operations structure. */ struct bt_l2cap_chan_ops { @@ -154,7 +151,6 @@ struct bt_l2cap_chan_ops { void (*recv)(struct bt_l2cap_chan *chan, struct net_buf *buf); }; -#if defined(CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL) /** @def BT_L2CAP_CHAN_SEND_RESERVE * @brief Headroom needed for outgoing buffers */ @@ -193,7 +189,6 @@ struct bt_l2cap_server { */ int bt_l2cap_server_register(struct bt_l2cap_server *server); -#if defined(CONFIG_BLUETOOTH_BREDR) /** @brief Register L2CAP server on BR/EDR oriented connection. * * Register L2CAP server for a PSM, each new connection is authorized using @@ -205,7 +200,6 @@ int bt_l2cap_server_register(struct bt_l2cap_server *server); * @return 0 in case of success or negative value in case of error. */ int bt_l2cap_br_server_register(struct bt_l2cap_server *server); -#endif /* CONFIG_BLUETOOTH_BREDR */ /** @brief Connect L2CAP channel * @@ -253,9 +247,6 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); */ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf); -#endif /* CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL */ -#endif /* CONFIG_BLUETOOTH_CENTRAL || CONFIG_BLUETOOTH_PERIPHERAL */ - #ifdef __cplusplus } #endif