Use one definition for Octet16

Bug: 301661850
Test: mma -j32
Change-Id: I9e17bf1e6ad940213d611e5d91338c76f30d6f3f
diff --git a/system/bta/ag/bta_ag_cfg.cc b/system/bta/ag/bta_ag_cfg.cc
index c331973..e0c42e9 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 53ee8cb..ac4cedd 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 d7e95a1..f79bccd 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 184ff92..9455caf 100644
--- a/system/bta/gatt/database.cc
+++ b/system/bta/gatt/database.cc
@@ -26,6 +26,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 53c03e5..6534ad6 100644
--- a/system/bta/gatt/database.h
+++ b/system/bta/gatt/database.h
@@ -24,7 +24,7 @@
 #include <utility>
 #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 147a3cf..a2beffe 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 b548311..ab8c97b 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 978077e..3ba5a72 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 ae0ead6..f3907f6 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 46d9422..1ed76f0 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 21b8d29..b5e3a37 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 078903a..de9f3cf 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 f3671a4..bcfcf8a 100644
--- a/system/bta/include/bta_api.h
+++ b/system/bta/include/bta_api.h
@@ -25,16 +25,15 @@
 #ifndef BTA_API_H
 #define BTA_API_H
 
-#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 "osi/include/log.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"
@@ -43,8 +42,6 @@
 #include "types/bluetooth/uuid.h"
 #include "types/bt_transport.h"
 #include "types/raw_address.h"
-#include "bta_api_data_types.h"
-
 
 /*
  * Service ID
diff --git a/system/bta/include/bta_av_api.h b/system/bta/include/bta_av_api.h
index 5d59842..df133e6 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 ec72485..44cf3cf 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 2109e41..3989eb0 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 35562dd..e170f2f 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 3b9625b..958ecfd 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 "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 "bta_api_data_types.h"
 #include "stack/include/bt_name.h"
+#include "stack/include/bt_octets.h"
+#include "stack/include/btm_ble_sec_api_types.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 9abfd2d..db6d235 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/le_audio/state_machine.cc b/system/bta/le_audio/state_machine.cc
index fdcd476..6ae75ef 100644
--- a/system/bta/le_audio/state_machine.cc
+++ b/system/bta/le_audio/state_machine.cc
@@ -26,7 +26,6 @@
 
 #include <map>
 
-#include "bt_types.h"
 #include "bta_gatt_queue.h"
 #include "bta_le_audio_api.h"
 #include "btm_iso_api.h"
diff --git a/system/bta/sys/bta_sys_main.cc b/system/bta/sys/bta_sys_main.cc
index 5dcfd45..614deb3 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 fe2bca0..be20987 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 afb0ef5..5453451 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 b8e7dc2..9118b07 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 @@
 
 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 df2f94c..060b0bd 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 1f60604..ff0a759 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 9ec0f8d..c99b269 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 bf1bc15..ad01073 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 aa15d6e..799183d 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 0000000..0eba156
--- /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 5c08312..eadb465 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 b4aaae8..5a3ac07 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 7d02329..bd1dd93 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 13346bd..5b4d770 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/acl.h b/system/stack/acl/acl.h
index ad44ada..0cdc7e0 100644
--- a/system/stack/acl/acl.h
+++ b/system/stack/acl/acl.h
@@ -23,7 +23,6 @@
 
 #include "stack/acl/peer_packet_types.h"
 #include "stack/include/acl_api_types.h"
-#include "stack/include/bt_types.h"
 #include "stack/include/btm_api_types.h"
 #include "stack/include/hcimsgs.h"
 #include "types/bt_transport.h"
diff --git a/system/stack/acl/peer_packet_types.h b/system/stack/acl/peer_packet_types.h
index 952cf63..78aa946 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 0b95cf9..b946f39 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 3108001..7a2e199 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_ble_bgconn.cc b/system/stack/btm/btm_ble_bgconn.cc
index 0893355..552e3bf 100644
--- a/system/stack/btm/btm_ble_bgconn.cc
+++ b/system/stack/btm/btm_ble_bgconn.cc
@@ -35,7 +35,6 @@
 #include "stack/btm/btm_dev.h"
 #include "stack/btm/btm_int_types.h"
 #include "stack/btm/security_device_record.h"
-#include "stack/include/bt_types.h"
 #include "types/raw_address.h"
 
 extern tBTM_CB btm_cb;
diff --git a/system/stack/include/acl_api.h b/system/stack/include/acl_api.h
index 78302d8..2f72fbf 100644
--- a/system/stack/include/acl_api.h
+++ b/system/stack/include/acl_api.h
@@ -19,7 +19,6 @@
 
 #include "stack/btm/btm_int_types.h"
 #include "stack/include/acl_api_types.h"
-#include "stack/include/bt_types.h"
 #include "stack/include/btm_status.h"
 #include "stack/include/hci_error_code.h"
 #include "types/raw_address.h"
diff --git a/system/stack/include/acl_api_types.h b/system/stack/include/acl_api_types.h
index 860f100..432c839 100644
--- a/system/stack/include/acl_api_types.h
+++ b/system/stack/include/acl_api_types.h
@@ -18,7 +18,6 @@
 
 #include <cstdint>
 
-#include "stack/include/bt_types.h"
 #include "stack/include/btm_status.h"
 #include "types/raw_address.h"
 
diff --git a/system/stack/include/acl_hci_link_interface.h b/system/stack/include/acl_hci_link_interface.h
index 8566c96..e6a1ce1 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 864eef0..ca9fd7e 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 128dfbf..244e13b 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 36c9e07..3a90164 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 @@
                                 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 e4f0f12..2789e71 100644
--- a/system/stack/include/bt_types.h
+++ b/system/stack/include/bt_types.h
@@ -21,19 +21,15 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#ifdef __cplusplus
-#include <string>
-#endif  // __cplusplus
 
+#include <string>
+
+#include "include/hardware/bluetooth.h"
 #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 "types/bluetooth/uuid.h"
 #include "types/raw_address.h"
-#endif  // __cplusplus
 
 /* READ WELL !!
  *
diff --git a/system/stack/include/sco_hci_link_interface.h b/system/stack/include/sco_hci_link_interface.h
index cd9d8f9..34dc174 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/include/sec_hci_link_interface.h b/system/stack/include/sec_hci_link_interface.h
index f1c93a0..687cdfa 100644
--- a/system/stack/include/sec_hci_link_interface.h
+++ b/system/stack/include/sec_hci_link_interface.h
@@ -19,7 +19,6 @@
 
 #include <cstdint>
 
-#include "stack/include/bt_types.h"
 #include "stack/include/btm_sec_api_types.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 4b84853..aeae237 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 fe30df3..dc8771d 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"