diff --git a/system/bta/ag/bta_ag_cfg.cc b/system/bta/ag/bta_ag_cfg.cc index c331973949088a07dead535a6558b9c0a15af2db..e0c42e95f38896f9884276bfce44d863a6c55a32 100644 --- a/system/bta/ag/bta_ag_cfg.cc +++ b/system/bta/ag/bta_ag_cfg.cc @@ -29,7 +29,6 @@ #include "device/include/esco_parameters.h" #include "osi/include/allocator.h" #include "osi/include/compat.h" -#include "stack/include/bt_types.h" #ifndef BTA_AG_CIND_INFO #define BTA_AG_CIND_INFO \ diff --git a/system/bta/dm/bta_dm_main.cc b/system/bta/dm/bta_dm_main.cc index 53ee8cb3813053ac807033b5dda9bfd54f863b18..ac4ceddf93018f54e242efdf6be0dc9019eb824d 100644 --- a/system/bta/dm/bta_dm_main.cc +++ b/system/bta/dm/bta_dm_main.cc @@ -26,15 +26,14 @@ #include "bt_trace.h" #include "bta/dm/bta_dm_disc.h" -#include "bta/dm/bta_dm_sec_int.h" #include "bta/dm/bta_dm_gatt_client.h" #include "bta/dm/bta_dm_int.h" +#include "bta/dm/bta_dm_sec_int.h" #include "gd/common/circular_buffer.h" #include "gd/common/strings.h" #include "main/shim/dumpsys.h" #include "stack/btm/btm_int_types.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" tBTA_DM_ACL_CB bta_dm_acl_cb; tBTA_DM_CB bta_dm_cb; diff --git a/system/bta/gatt/bta_gatts_int.h b/system/bta/gatt/bta_gatts_int.h index d7e95a1d1d94c97c7f86e72bdd5aa7b9c15ef65e..f79bccdcc366e3c00894266c67551b9f9f15acf8 100644 --- a/system/bta/gatt/bta_gatts_int.h +++ b/system/bta/gatt/bta_gatts_int.h @@ -30,7 +30,6 @@ #include "bta/include/bta_gatt_api.h" #include "bta/sys/bta_sys.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "stack/include/btm_ble_api_types.h" #include "stack/include/gatt_api.h" #include "types/bluetooth/uuid.h" diff --git a/system/bta/gatt/database.cc b/system/bta/gatt/database.cc index 223ff94b681f25257a6310856028e8493afa1294..8ee75c0ddb686deb415b5dd084aeeea4679352d1 100644 --- a/system/bta/gatt/database.cc +++ b/system/bta/gatt/database.cc @@ -25,6 +25,7 @@ #include <sstream> #include "bt_trace.h" +#include "bt_types.h" #include "stack/crypto_toolbox/crypto_toolbox.h" #include "stack/include/gattdefs.h" #include "types/bluetooth/uuid.h" diff --git a/system/bta/gatt/database.h b/system/bta/gatt/database.h index 3e618d23d11eeacbe4a8bad475ff716adda6eac4..3a87ebc792e32bc71b761e309ea40ade3c08f7c9 100644 --- a/system/bta/gatt/database.h +++ b/system/bta/gatt/database.h @@ -22,7 +22,7 @@ #include <string> #include <vector> -#include "stack/include/bt_types.h" /* for Octet16 */ +#include "stack/include/bt_octets.h" #include "types/bluetooth/uuid.h" namespace gatt { diff --git a/system/bta/has/has_ctp.cc b/system/bta/has/has_ctp.cc index 147a3cfb65fe884f676448dcbdc5fc3b4526f26f..a2beffea84e2292e4df7f1eef6aebba42d1b37dd 100644 --- a/system/bta/has/has_ctp.cc +++ b/system/bta/has/has_ctp.cc @@ -16,7 +16,9 @@ */ #include "has_ctp.h" + #include "os/log.h" +#include "stack/include/bt_types.h" namespace le_audio { namespace has { diff --git a/system/bta/has/has_preset.cc b/system/bta/has/has_preset.cc index b54831150f56670f4a3069f7f28799f507d58b4a..ab8c97b8840f0f5a50cb1f6e33433b1692966828 100644 --- a/system/bta/has/has_preset.cc +++ b/system/bta/has/has_preset.cc @@ -17,6 +17,8 @@ #include "has_preset.h" +#include "stack/include/bt_types.h" + namespace le_audio { namespace has { diff --git a/system/bta/has/has_preset.h b/system/bta/has/has_preset.h index 978077e6b406ce328dec67012512f3a415054d7d..3ba5a72816507c88bc482b9456f75fe7c02a3228 100644 --- a/system/bta/has/has_preset.h +++ b/system/bta/has/has_preset.h @@ -22,7 +22,6 @@ #include <optional> #include <string> -#include "bt_types.h" #include "hardware/bt_has.h" namespace le_audio { diff --git a/system/bta/hd/bta_hd_int.h b/system/bta/hd/bta_hd_int.h index ae0ead6d01427d7ded3be7496f921a60bc8497e1..f3907f65677ce4b6a326235ab6f41b3d48b48276 100644 --- a/system/bta/hd/bta_hd_int.h +++ b/system/bta/hd/bta_hd_int.h @@ -31,7 +31,6 @@ #include "bta/include/bta_hd_api.h" #include "bta/sys/bta_sys.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "stack/include/hiddefs.h" #include "types/raw_address.h" diff --git a/system/bta/hf_client/bta_hf_client_api.cc b/system/bta/hf_client/bta_hf_client_api.cc index 46d942284d7eb436cb0c0a691690cd2db0308c4e..1ed76f072782cc5fd2e4894b0f7cb22c8e7bdc39 100644 --- a/system/bta/hf_client/bta_hf_client_api.cc +++ b/system/bta/hf_client/bta_hf_client_api.cc @@ -38,7 +38,6 @@ #include "osi/include/allocator.h" #include "osi/include/compat.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" /***************************************************************************** diff --git a/system/bta/hf_client/bta_hf_client_int.h b/system/bta/hf_client/bta_hf_client_int.h index 21b8d29da450a0ca91116634fbd5a7623ebd4453..b5e3a37f0adcecdad377ad375dabc3ad1e068d56 100644 --- a/system/bta/hf_client/bta_hf_client_int.h +++ b/system/bta/hf_client/bta_hf_client_int.h @@ -25,7 +25,6 @@ #include "bta/sys/bta_sys.h" #include "osi/include/alarm.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" /***************************************************************************** diff --git a/system/bta/hh/bta_hh_int.h b/system/bta/hh/bta_hh_int.h index 078903ad33f4d018033a571fab19281d429d15e6..de9f3cf2157a77554db952f1e3e64255c6be5b76 100644 --- a/system/bta/hh/bta_hh_int.h +++ b/system/bta/hh/bta_hh_int.h @@ -32,7 +32,6 @@ #include "bta/include/bta_hh_api.h" #include "bta/sys/bta_sys.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" /* state machine events, these events are handled by the state machine */ diff --git a/system/bta/include/bta_api.h b/system/bta/include/bta_api.h index 0c4d243fcbecefc02538e52ddadf0db56f0f69b3..90d5e03b719ecd01539868fc3dfb98e0644206f2 100644 --- a/system/bta/include/bta_api.h +++ b/system/bta/include/bta_api.h @@ -35,8 +35,6 @@ #include "bta_api_data_types.h" #include "osi/include/log.h" #include "stack/include/bt_name.h" -#include "stack/include/bt_octets.h" -#include "stack/include/bt_types.h" #include "stack/include/btm_api_types.h" #include "stack/include/btm_ble_api_types.h" #include "stack/include/hci_error_code.h" diff --git a/system/bta/include/bta_av_api.h b/system/bta/include/bta_av_api.h index 5d59842204bc3547c5045f74b3bbb2c720856be2..df133e6c787a6bce684b16122dd3d305ca44dd9c 100644 --- a/system/bta/include/bta_av_api.h +++ b/system/bta/include/bta_av_api.h @@ -31,7 +31,6 @@ #include "bta/include/bta_api.h" #include "stack/include/avrc_defs.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" /***************************************************************************** diff --git a/system/bta/include/bta_dm_acl.h b/system/bta/include/bta_dm_acl.h index ec724851452bc85f537a57d1053ad688db15b86a..44cf3cf73bac8748851258d4bf48cd6a6fd2f5d0 100644 --- a/system/bta/include/bta_dm_acl.h +++ b/system/bta/include/bta_dm_acl.h @@ -18,7 +18,6 @@ #include <cstdint> -#include "stack/include/bt_types.h" #include "stack/include/hci_error_code.h" #include "types/bt_transport.h" #include "types/hci_role.h" diff --git a/system/bta/include/bta_dm_ci.h b/system/bta/include/bta_dm_ci.h index 2109e414396e72d5cbeeebe41753f00717fd5084..3989eb061ef5b1245e2d98d3d5f1f21c6885f66d 100644 --- a/system/bta/include/bta_dm_ci.h +++ b/system/bta/include/bta_dm_ci.h @@ -26,7 +26,7 @@ #include <cstdint> -#include "stack/include/bt_types.h" +#include "stack/include/bt_octets.h" #include "types/raw_address.h" /***************************************************************************** diff --git a/system/bta/include/bta_jv_co.h b/system/bta/include/bta_jv_co.h index 35562dd0a0f42ccdb699d2a5764e4cbf81d2e40a..e170f2fb9685fee7d2c14b1f7e3f7e07f06fb3cf 100644 --- a/system/bta/include/bta_jv_co.h +++ b/system/bta/include/bta_jv_co.h @@ -27,7 +27,6 @@ #include <cstdint> #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" /***************************************************************************** * Function Declarations diff --git a/system/bta/include/bta_sec_api.h b/system/bta/include/bta_sec_api.h index 3b9625b4c6c148376949a8f225708de1c8862c7b..958ecfd5fbe40fb39af59bf4bf7c3a2e67496cb3 100644 --- a/system/bta/include/bta_sec_api.h +++ b/system/bta/include/bta_sec_api.h @@ -18,25 +18,23 @@ #pragma once -#include <base/strings/stringprintf.h> #include <base/functional/callback.h> +#include <base/strings/stringprintf.h> #include <cstdint> #include <vector> #include "bt_target.h" // Must be first to define build configuration +#include "bta_api_data_types.h" +#include "stack/include/bt_name.h" #include "stack/include/bt_octets.h" -#include "stack/include/bt_types.h" -#include "stack/include/btm_sec_api_types.h" #include "stack/include/btm_ble_sec_api_types.h" -#include "stack/include/bt_name.h" +#include "stack/include/btm_sec_api_types.h" #include "stack/include/hci_error_code.h" #include "types/ble_address_with_type.h" #include "types/bt_transport.h" #include "types/raw_address.h" -#include "bta_api_data_types.h" - /* Security Setting Mask */ #define BTA_SEC_AUTHENTICATE \ (BTM_SEC_IN_AUTHENTICATE | \ diff --git a/system/bta/le_audio/devices.h b/system/bta/le_audio/devices.h index 49bd52805b5874d457be4c7aff743c2e476e7a6a..922204482cdff5aba31137b6b21c4ff9f08c308c 100644 --- a/system/bta/le_audio/devices.h +++ b/system/bta/le_audio/devices.h @@ -31,7 +31,6 @@ #endif #include "audio_hal_client/audio_hal_client.h" -#include "bt_types.h" #include "bta_groups.h" #include "btm_iso_api_types.h" #include "gatt_api.h" diff --git a/system/bta/sys/bta_sys_main.cc b/system/bta/sys/bta_sys_main.cc index 5dcfd45cbc43041eea2493ead876f8f719771405..614deb3a4c5b06f89f7ca3b21d95761a4b94e008 100644 --- a/system/bta/sys/bta_sys_main.cc +++ b/system/bta/sys/bta_sys_main.cc @@ -37,7 +37,6 @@ #include "osi/include/allocator.h" #include "osi/include/log.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "stack/include/main_thread.h" void BTIF_dm_on_hw_error(); diff --git a/system/btif/src/btif_a2dp_sink.cc b/system/btif/src/btif_a2dp_sink.cc index fe2bca06bab4f82a59eb8773ca0d15a8f39d7435..be2098788ec494c616a340661c128972965bb749 100644 --- a/system/btif/src/btif_a2dp_sink.cc +++ b/system/btif/src/btif_a2dp_sink.cc @@ -40,7 +40,6 @@ #include "osi/include/log.h" #include "osi/include/osi.h" // UNUSED_ATTR #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" using bluetooth::common::MessageLoopThread; diff --git a/system/btif/src/btif_sock_l2cap.cc b/system/btif/src/btif_sock_l2cap.cc index afb0ef52fb4e8451ae32a3bf752dd1043f745af3..545345172a8eff545ba00878a9ee4829d755f80c 100644 --- a/system/btif/src/btif_sock_l2cap.cc +++ b/system/btif/src/btif_sock_l2cap.cc @@ -37,7 +37,6 @@ #include "osi/include/osi.h" #include "stack/btm/security_device_record.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" struct packet { diff --git a/system/common/address_obfuscator.h b/system/common/address_obfuscator.h index b8e7dc27f9574581bf22214b02579c507bbca66b..9118b07af86f9c721d96985af472c3fe4885be04 100644 --- a/system/common/address_obfuscator.h +++ b/system/common/address_obfuscator.h @@ -18,10 +18,10 @@ #pragma once -#include <array> #include <mutex> #include <string> +#include "gd/hci/octets.h" #include "raw_address.h" namespace bluetooth { @@ -29,8 +29,8 @@ namespace common { class AddressObfuscator { public: - static constexpr unsigned int kOctet32Length = 32; - using Octet32 = std::array<uint8_t, kOctet32Length>; + static constexpr unsigned int kOctet32Length = hci::kOctet32Length; + using Octet32 = hci::Octet32; static AddressObfuscator* GetInstance() { static auto instance = new AddressObfuscator(); return instance; diff --git a/system/device/include/device_iot_config.h b/system/device/include/device_iot_config.h index df2f94c31a50c701c0ad357571a69e13091d0fc7..060b0bdd0d84442e2152bac1f0dd55cfb5f3753a 100644 --- a/system/device/include/device_iot_config.h +++ b/system/device/include/device_iot_config.h @@ -23,7 +23,6 @@ #include <stddef.h> #include "bt_target.h" -#include "bt_types.h" #include "device_iot_conf_defs.h" #include "raw_address.h" diff --git a/system/device/src/device_iot_config.cc b/system/device/src/device_iot_config.cc index 1f6060460a808f785e7f415d0a42de0836682b7e..ff0a759d30389a7c98bced43306ff686d4e55bb2 100644 --- a/system/device/src/device_iot_config.cc +++ b/system/device/src/device_iot_config.cc @@ -29,7 +29,6 @@ #include <mutex> #include <string> -#include "bt_types.h" #include "btcore/include/module.h" #include "btif/include/btif_api.h" #include "btif/include/btif_util.h" diff --git a/system/device/src/device_iot_config_int.cc b/system/device/src/device_iot_config_int.cc index 9ec0f8d986efeb9a1fa08993fa2c77ac70f8f520..c99b269d5eec274ce0027c2b9764b0a20b00540c 100644 --- a/system/device/src/device_iot_config_int.cc +++ b/system/device/src/device_iot_config_int.cc @@ -30,7 +30,6 @@ #include <mutex> #include <string> -#include "bt_types.h" #include "btcore/include/module.h" #include "btif/include/btif_api.h" #include "btif/include/btif_util.h" diff --git a/system/device/src/interop.cc b/system/device/src/interop.cc index bf1bc15c8943ae9c96e6a516a7d163edf81250e9..ad01073cbe0136a11b53a39f97dc1e51eebc9b5a 100644 --- a/system/device/src/interop.cc +++ b/system/device/src/interop.cc @@ -37,7 +37,6 @@ #include <string> #include <utility> -#include "bt_types.h" #include "btcore/include/module.h" #include "btif/include/btif_storage.h" #include "check.h" diff --git a/system/gd/crypto_toolbox/crypto_toolbox.h b/system/gd/crypto_toolbox/crypto_toolbox.h index aa15d6ead84ed6d950fe50e2dfe63aad5368904a..799183d4e7c35b15e4bd73158188826a6a3f6f1d 100644 --- a/system/gd/crypto_toolbox/crypto_toolbox.h +++ b/system/gd/crypto_toolbox/crypto_toolbox.h @@ -21,11 +21,13 @@ #include <cstdint> #include <cstring> +#include "hci/octets.h" + namespace bluetooth { namespace crypto_toolbox { -constexpr int OCTET16_LEN = 16; -using Octet16 = std::array<uint8_t, OCTET16_LEN>; +constexpr int OCTET16_LEN = hci::kOctet16Length; +using Octet16 = hci::Octet16; Octet16 c1( const Octet16& k, diff --git a/system/gd/hci/octets.h b/system/gd/hci/octets.h new file mode 100644 index 0000000000000000000000000000000000000000..0eba1561c0d1c555147b0c61c077e529e77453b5 --- /dev/null +++ b/system/gd/hci/octets.h @@ -0,0 +1,29 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include <array> +#include <cstdint> + +namespace bluetooth::hci { + +constexpr int kOctet16Length = 16; +using Octet16 = std::array<uint8_t, kOctet16Length>; + +constexpr int kOctet32Length = 32; +using Octet32 = std::array<uint8_t, kOctet32Length>; +} // namespace bluetooth::hci diff --git a/system/main/shim/acl.h b/system/main/shim/acl.h index 5c08312e7af66ca4be856fd1bb753e17b01af560..eadb465bd67a50ae22749e89133efd9f3b533d9f 100644 --- a/system/main/shim/acl.h +++ b/system/main/shim/acl.h @@ -29,7 +29,6 @@ #include "main/shim/acl_legacy_interface.h" #include "main/shim/link_connection_interface.h" #include "main/shim/link_policy_interface.h" -#include "stack/include/bt_types.h" #include "types/raw_address.h" using LeRandCallback = base::OnceCallback<void(uint64_t)>; diff --git a/system/main/shim/acl_legacy_interface.h b/system/main/shim/acl_legacy_interface.h index b4aaae8bb5fca8e49a0c4234555197b2b9b13abf..5a3ac0716e8c07dc320894965659fcbf100bfdff 100644 --- a/system/main/shim/acl_legacy_interface.h +++ b/system/main/shim/acl_legacy_interface.h @@ -19,7 +19,6 @@ #include <cstdint> #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "stack/include/hci_error_code.h" #include "stack/include/hci_mode.h" #include "stack/include/hcidefs.h" diff --git a/system/main/shim/helpers.h b/system/main/shim/helpers.h index 7d023291eb7873220aef1fcd17898b9a2f152e85..bd1dd93204e2bc1b04e9e8b168b17020d4be3ab3 100644 --- a/system/main/shim/helpers.h +++ b/system/main/shim/helpers.h @@ -20,7 +20,6 @@ #include "hci/address_with_type.h" #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "stack/include/hci_error_code.h" #include "stack/include/hci_mode.h" #include "stack/include/hcidefs.h" diff --git a/system/profile/sdp/common/data_element_reader.h b/system/profile/sdp/common/data_element_reader.h index 13346bd8838e88c2e99bcf9051f819ed3e2382a8..5b4d770a2685a6ab437a42b4c3e60b2f39718489 100644 --- a/system/profile/sdp/common/data_element_reader.h +++ b/system/profile/sdp/common/data_element_reader.h @@ -22,7 +22,7 @@ #include "bluetooth/uuid.h" #include "packet.h" #include "sdp_common.h" -#include "stack/include/bt_types.h" +#include "stack/include/bt_octets.h" namespace bluetooth { namespace sdp { diff --git a/system/stack/acl/peer_packet_types.h b/system/stack/acl/peer_packet_types.h index 952cf63dda5b523dcb764c80a6fe53f3b3d1d1f7..78aa94668665134172aabaffafb58a76bf133bad 100644 --- a/system/stack/acl/peer_packet_types.h +++ b/system/stack/acl/peer_packet_types.h @@ -16,7 +16,6 @@ #pragma once -#include "stack/include/bt_types.h" #include "stack/include/hcidefs.h" #define BD_FEATURES_LEN 8 diff --git a/system/stack/btm/ble_advertiser_hci_interface.h b/system/stack/btm/ble_advertiser_hci_interface.h index 0b95cf9a6c82445513917d5b9321fd5c7c77a6af..b946f39cad6ae3d8433e5af42291176c25153340 100644 --- a/system/stack/btm/ble_advertiser_hci_interface.h +++ b/system/stack/btm/ble_advertiser_hci_interface.h @@ -23,7 +23,6 @@ #include <vector> -#include "stack/include/bt_types.h" #include "types/raw_address.h" /* This class is an abstraction of HCI commands used for managing diff --git a/system/stack/btm/ble_scanner_hci_interface.h b/system/stack/btm/ble_scanner_hci_interface.h index 31080016a400928f5ac02663ff80778af87d465a..7a2e19910d1a3d24ce02bdaa7de4ed128d0eb91d 100644 --- a/system/stack/btm/ble_scanner_hci_interface.h +++ b/system/stack/btm/ble_scanner_hci_interface.h @@ -22,7 +22,6 @@ #include <vector> -#include "stack/include/bt_types.h" #include "types/raw_address.h" class BleScannerHciInterface { diff --git a/system/stack/btm/btm_devctl.cc b/system/stack/btm/btm_devctl.cc index 842599d91c28ca7890bc0eed5b38a24d3b7cd6ea..5c293480039364a8fbee3046aa1cdbaa07e8d950 100644 --- a/system/stack/btm/btm_devctl.cc +++ b/system/stack/btm/btm_devctl.cc @@ -23,6 +23,7 @@ * ******************************************************************************/ +#include "acl_api_types.h" #define LOG_TAG "devctl" #include <base/logging.h> diff --git a/system/stack/include/acl_hci_link_interface.h b/system/stack/include/acl_hci_link_interface.h index 8566c96d93b2822fe4456c159bb1a279d65b158e..e6a1ce1386b5c0d913fed7c9c8a88d5860bc95ed 100644 --- a/system/stack/include/acl_hci_link_interface.h +++ b/system/stack/include/acl_hci_link_interface.h @@ -20,7 +20,6 @@ #include <cstdint> #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" #include "stack/include/hci_error_code.h" #include "stack/include/hci_mode.h" #include "stack/include/hcidefs.h" diff --git a/system/stack/include/avrc_defs.h b/system/stack/include/avrc_defs.h index 864eef01d555774375d5845c0c8a2d33947f594d..ca9fd7ea5e9e9e2f6b91d0962ca88d84c433d4a2 100644 --- a/system/stack/include/avrc_defs.h +++ b/system/stack/include/avrc_defs.h @@ -27,7 +27,6 @@ #include <cstdint> #include "stack/include/bt_hdr.h" -#include "stack/include/bt_types.h" /***************************************************************************** * constants diff --git a/system/stack/include/ble_acl_interface.h b/system/stack/include/ble_acl_interface.h index 128dfbffbcc8f1853bea21ac1498eaebbf5b8ddb..244e13b1268072fb03a9b9ea202d77662b2b9476 100644 --- a/system/stack/include/ble_acl_interface.h +++ b/system/stack/include/ble_acl_interface.h @@ -18,8 +18,9 @@ #include <cstdint> -#include "stack/include/bt_types.h" #include "stack/include/hci_error_code.h" +#include "types/ble_address_with_type.h" +#include "types/hci_role.h" #include "types/raw_address.h" void acl_ble_enhanced_connection_complete( diff --git a/system/stack/include/bt_octets.h b/system/stack/include/bt_octets.h index 36c9e07ab8a8d1462f6c03d2156fb19916e6e4a4..3a90164e1d7e5239f243ae4e7717eb5f6f990a0a 100644 --- a/system/stack/include/bt_octets.h +++ b/system/stack/include/bt_octets.h @@ -16,17 +16,13 @@ #pragma once -/* Some C files include this header file */ -#ifdef __cplusplus - -#include <array> #include <cstdint> -constexpr int OCTET16_LEN = 16; -typedef std::array<uint8_t, OCTET16_LEN> Octet16; +#include "gd/hci/octets.h" -constexpr int LINK_KEY_LEN = OCTET16_LEN; -typedef Octet16 LinkKey; /* Link Key */ +using Octet16 = bluetooth::hci::Octet16; +using LinkKey = bluetooth::hci::Octet16; /* Link Key */ +static constexpr int OCTET16_LEN = bluetooth::hci::kOctet16Length; /* Sample LTK from BT Spec 5.1 | Vol 6, Part C 1 * 0x4C68384139F574D836BCF34E9DFB01BF */ @@ -34,8 +30,6 @@ constexpr Octet16 SAMPLE_LTK = {0xbf, 0x01, 0xfb, 0x9d, 0x4e, 0xf3, 0xbc, 0x36, 0xd8, 0x74, 0xf5, 0x39, 0x41, 0x38, 0x68, 0x4c}; inline bool is_sample_ltk(const Octet16& ltk) { return ltk == SAMPLE_LTK; } -#endif - #define BT_OCTET8_LEN 8 typedef uint8_t BT_OCTET8[BT_OCTET8_LEN]; /* octet array: size 16 */ diff --git a/system/stack/include/bt_types.h b/system/stack/include/bt_types.h index e4f0f12ad4263c034bc21eea46d8e5556603015b..1831b83dd808a16d8a7e4171e15365149b2c207c 100644 --- a/system/stack/include/bt_types.h +++ b/system/stack/include/bt_types.h @@ -20,17 +20,13 @@ #define BT_TYPES_H #include <stdbool.h> -#include <stdint.h> -#ifdef __cplusplus -#include <string> -#endif // __cplusplus #include "stack/include/bt_dev_class.h" #include "stack/include/bt_device_type.h" #include "stack/include/bt_hdr.h" -#include "stack/include/bt_octets.h" #ifdef __cplusplus #include "include/hardware/bluetooth.h" +#include "stack/include/bt_octets.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" #endif // __cplusplus diff --git a/system/stack/include/sco_hci_link_interface.h b/system/stack/include/sco_hci_link_interface.h index cd9d8f9e6b4f7af03a0df0923209b1f49bc3744c..34dc174113dfb2e7e5c159464546fdfed80c0857 100644 --- a/system/stack/include/sco_hci_link_interface.h +++ b/system/stack/include/sco_hci_link_interface.h @@ -19,6 +19,7 @@ #include <cstdint> +#include "stack/include/bt_dev_class.h" #include "stack/include/hci_error_code.h" #include "types/class_of_device.h" #include "types/raw_address.h" diff --git a/system/stack/test/btm/peer_packet_types_test.cc b/system/stack/test/btm/peer_packet_types_test.cc index 4b8485398e8777670c4d36e357b48879f46131cc..aeae23770c5d708047f95ba322b42c1ed36c98f7 100644 --- a/system/stack/test/btm/peer_packet_types_test.cc +++ b/system/stack/test/btm/peer_packet_types_test.cc @@ -16,12 +16,10 @@ * */ +#include "stack/acl/peer_packet_types.h" + #include <gmock/gmock.h> #include <gtest/gtest.h> -#include <map> - -#include "stack/acl/peer_packet_types.h" -#include "stack/include/bt_types.h" namespace { diff --git a/system/test/suite/adapter/adapter_unittest.cc b/system/test/suite/adapter/adapter_unittest.cc index fe30df33529b8786e99712d4db5e7d7c68d4f9cd..dc8771da3c054b93adabd0e71b98e4b251982aa0 100644 --- a/system/test/suite/adapter/adapter_unittest.cc +++ b/system/test/suite/adapter/adapter_unittest.cc @@ -18,7 +18,6 @@ #include "adapter/bluetooth_test.h" #include "btcore/include/property.h" -#include "stack/include/bt_types.h" #include "types/bt_transport.h" #include "types/raw_address.h"