diff --git a/include/bluetooth/a2dp.h b/include/bluetooth/a2dp.h index 9f20e229907..59db78428e9 100644 --- a/include/bluetooth/a2dp.h +++ b/include/bluetooth/a2dp.h @@ -10,12 +10,12 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_A2DP_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_A2DP_H_ +#include + #ifdef __cplusplus extern "C" { #endif -#include - /** @brief Stream Structure */ struct bt_a2dp_stream { /* TODO */ diff --git a/include/bluetooth/att.h b/include/bluetooth/att.h index c0c220a9f4f..6e934503b7f 100644 --- a/include/bluetooth/att.h +++ b/include/bluetooth/att.h @@ -10,12 +10,12 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ +#include + #ifdef __cplusplus extern "C" { #endif -#include - /* Error codes for Error response PDU */ #define BT_ATT_ERR_INVALID_HANDLE 0x01 #define BT_ATT_ERR_READ_NOT_PERMITTED 0x02 diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index fe4ce8d6695..56186daac70 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -17,15 +17,15 @@ * @{ */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** Opaque type representing a connection to a remote device */ struct bt_conn; diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index d02c6bd416a..801a8647687 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -17,10 +17,6 @@ * @{ */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -28,6 +24,10 @@ extern "C" { #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* GATT attribute permission bit field values */ enum { /** No operations supported, e.g. for notify-only */ diff --git a/include/bluetooth/l2cap.h b/include/bluetooth/l2cap.h index 8147bdf4d44..2696ddab439 100644 --- a/include/bluetooth/l2cap.h +++ b/include/bluetooth/l2cap.h @@ -17,15 +17,15 @@ * @{ */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* L2CAP header size, used for buffer size calculations */ #define BT_L2CAP_HDR_SIZE 4 diff --git a/include/bluetooth/rfcomm.h b/include/bluetooth/rfcomm.h index 7daf7cd86dc..5efbb8ab95c 100644 --- a/include/bluetooth/rfcomm.h +++ b/include/bluetooth/rfcomm.h @@ -17,13 +17,13 @@ * @{ */ +#include +#include + #ifdef __cplusplus extern "C" { #endif -#include -#include - /* RFCOMM channels (1-30): pre-allocated for profiles to avoid conflicts */ enum { BT_RFCOMM_CHAN_HFP_HF = 1, diff --git a/include/bluetooth/sdp.h b/include/bluetooth/sdp.h index 9f14aad5022..3e1ea6ef83a 100644 --- a/include/bluetooth/sdp.h +++ b/include/bluetooth/sdp.h @@ -17,13 +17,13 @@ * @{ */ +#include +#include + #ifdef __cplusplus extern "C" { #endif -#include -#include - /* * All definitions are based on Bluetooth Assigned Numbers * of the Bluetooth Specification @@ -601,6 +601,7 @@ int bt_sdp_get_profile_version(const struct net_buf *buf, u16_t profile, * @return 0 on success if feature found and valid, negative in case any error */ int bt_sdp_get_features(const struct net_buf *buf, u16_t *features); + #ifdef __cplusplus } #endif diff --git a/include/bluetooth/services/bas.h b/include/bluetooth/services/bas.h index 2f5bc7279eb..c3374e680b1 100644 --- a/include/bluetooth/services/bas.h +++ b/include/bluetooth/services/bas.h @@ -18,12 +18,12 @@ * as a part of ongoing development. */ +#include + #ifdef __cplusplus extern "C" { #endif -#include - /** @brief Read battery level value. * * Read the characteristic value of the battery level diff --git a/subsys/bluetooth/common/log.h b/subsys/bluetooth/common/log.h index e07a1f1c8ac..4c236904fed 100644 --- a/subsys/bluetooth/common/log.h +++ b/subsys/bluetooth/common/log.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -32,8 +33,6 @@ extern "C" { #define LOG_LEVEL CONFIG_BT_LOG_LEVEL #endif -#include - LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define BT_DBG(fmt, ...) LOG_DBG(fmt, ##__VA_ARGS__) @@ -62,4 +61,3 @@ const char *bt_addr_le_str_real(const bt_addr_le_t *addr); #endif #endif /* __BT_LOG_H */ -