mirror of
https://github.com/esphome/esphome.git
synced 2025-11-17 07:15:48 +00:00
Revert "[esp32_ble] Store custom GAP device name in flash"
This reverts commit 70d947fab9.
This commit is contained in:
@@ -261,8 +261,8 @@ bool ESP32BLE::ble_setup_() {
|
||||
#endif
|
||||
|
||||
std::string name;
|
||||
if (this->name_ != nullptr) {
|
||||
name = this->name_;
|
||||
if (this->name_.has_value()) {
|
||||
name = this->name_.value();
|
||||
if (App.is_name_add_mac_suffix_enabled()) {
|
||||
// MAC address suffix length (last 6 characters of 12-char MAC address string)
|
||||
constexpr size_t mac_address_suffix_len = 6;
|
||||
|
||||
@@ -112,7 +112,7 @@ class ESP32BLE : public Component {
|
||||
void loop() override;
|
||||
void dump_config() override;
|
||||
float get_setup_priority() const override;
|
||||
void set_name(const char *name) { this->name_ = name; }
|
||||
void set_name(const std::string &name) { this->name_ = name; }
|
||||
|
||||
#ifdef USE_ESP32_BLE_ADVERTISING
|
||||
void advertising_start();
|
||||
@@ -192,8 +192,8 @@ class ESP32BLE : public Component {
|
||||
esphome::LockFreeQueue<BLEEvent, MAX_BLE_QUEUE_SIZE> ble_events_;
|
||||
esphome::EventPool<BLEEvent, MAX_BLE_QUEUE_SIZE> ble_event_pool_;
|
||||
|
||||
// Pointer to compile-time string literal or nullptr (4 bytes on 32-bit)
|
||||
const char *name_{nullptr};
|
||||
// optional<string> (typically 16+ bytes on 32-bit, aligned to 4 bytes)
|
||||
optional<std::string> name_;
|
||||
|
||||
// 4-byte aligned members
|
||||
#ifdef USE_ESP32_BLE_ADVERTISING
|
||||
|
||||
Reference in New Issue
Block a user