mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 20:32:21 +01:00
[bluetooth_proxy] [esp32_ble_tracker] [esp32_ble] Use C++17 nested namespace syntax (#9825)
This commit is contained in:
@@ -19,8 +19,7 @@
|
||||
#include <esp32-hal-bt.h>
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
static const char *const TAG = "esp32_ble";
|
||||
|
||||
@@ -538,7 +537,6 @@ uint64_t ble_addr_to_uint64(const esp_bd_addr_t address) {
|
||||
|
||||
ESP32BLE *global_ble = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -21,8 +21,7 @@
|
||||
#include <esp_gattc_api.h>
|
||||
#include <esp_gatts_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
// Maximum number of BLE scan results to buffer
|
||||
// Sized to handle bursts of advertisements while allowing for processing delays
|
||||
@@ -191,7 +190,6 @@ template<typename... Ts> class BLEDisableAction : public Action<Ts...> {
|
||||
void play(Ts... x) override { global_ble->disable(); }
|
||||
};
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -8,8 +8,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/application.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
static const char *const TAG = "esp32_ble.advertising";
|
||||
|
||||
@@ -160,7 +159,6 @@ void BLEAdvertising::register_raw_advertisement_callback(std::function<void(bool
|
||||
this->raw_advertisements_callbacks_.push_back(std::move(callback));
|
||||
}
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -10,8 +10,7 @@
|
||||
#include <esp_gap_ble_api.h>
|
||||
#include <esp_gatts_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
using raw_adv_data_t = struct {
|
||||
uint8_t *data;
|
||||
@@ -55,7 +54,6 @@ class BLEAdvertising {
|
||||
int8_t current_adv_index_{-1}; // -1 means standard scan response
|
||||
};
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -11,8 +11,7 @@
|
||||
|
||||
#include "ble_scan_result.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
// Compile-time verification that ESP-IDF scan complete events only contain a status field
|
||||
// This ensures our reinterpret_cast in ble.cpp is safe
|
||||
@@ -395,7 +394,6 @@ static_assert(sizeof(esp_ble_sec_t) <= 73, "esp_ble_sec_t is larger than BLEScan
|
||||
|
||||
// BLEEvent total size: 84 bytes (80 byte union + 1 byte type + 3 bytes padding)
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -4,8 +4,7 @@
|
||||
|
||||
#include <esp_gap_ble_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
// Structure for BLE scan results - only fields we actually use
|
||||
struct __attribute__((packed)) BLEScanResult {
|
||||
@@ -18,7 +17,6 @@ struct __attribute__((packed)) BLEScanResult {
|
||||
uint8_t search_evt;
|
||||
}; // ~73 bytes vs ~400 bytes for full esp_ble_gap_cb_param_t
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -7,8 +7,7 @@
|
||||
#include <cinttypes>
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
static const char *const TAG = "esp32_ble";
|
||||
|
||||
@@ -189,7 +188,6 @@ std::string ESPBTUUID::to_string() const {
|
||||
return "";
|
||||
}
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
@@ -8,8 +8,7 @@
|
||||
#include <string>
|
||||
#include <esp_bt_defs.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
namespace esphome::esp32_ble {
|
||||
|
||||
class ESPBTUUID {
|
||||
public:
|
||||
@@ -41,7 +40,6 @@ class ESPBTUUID {
|
||||
esp_bt_uuid_t uuid_;
|
||||
};
|
||||
|
||||
} // namespace esp32_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::esp32_ble
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user