diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 6ce32d01bb..805ac8ac05 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -24,6 +24,7 @@ #include #include #include +#include "esp_log.h" using namespace chip::app::Clusters; using namespace chip::System::Clock; @@ -280,13 +281,14 @@ CHIP_ERROR CommissioningWindowManager::OpenBasicCommissioningWindow(Seconds16 co CommissioningWindowAdvertisement advertisementMode) { RestoreDiscriminator(); + SetBLE(false); #if CONFIG_NETWORK_LAYER_BLE // Enable BLE advertisements if commissioning window is to be opened on all supported // transports, and BLE is supported on the current device. - SetBLE(advertisementMode == chip::CommissioningWindowAdvertisement::kAllSupported); +//SetBLE(advertisementMode == chip::CommissioningWindowAdvertisement::kAllSupported); #else - SetBLE(false); + // SetBLE(false); #endif // CONFIG_NETWORK_LAYER_BLE mFailedCommissioningAttempts = 0; diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index 4cee5dab0b..beefce15fb 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -93,12 +93,12 @@ CHIP_ERROR GenericPlatformManagerImpl::_InitChipStack() // Initialize the CHIP BLE manager. #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - err = BLEMgr().Init(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "BLEManager initialization failed: %" CHIP_ERROR_FORMAT, err.Format()); - } - SuccessOrExit(err); +// err = BLEMgr().Init(); +// if (err != CHIP_NO_ERROR) +// { +// ChipLogError(DeviceLayer, "BLEManager initialization failed: %" CHIP_ERROR_FORMAT, err.Format()); +// } +// SuccessOrExit(err); #endif // Initialize the Connectivity Manager object. diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index 074750654c..f7af125ba1 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -44,6 +44,7 @@ #endif #include "esp_system.h" #include "esp_wifi.h" +#include "esp_log.h" namespace chip { namespace DeviceLayer { @@ -70,56 +71,55 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Make sure the LwIP core lock has been initialized ReturnErrorOnFailure(Internal::InitLwIPCoreLock()); - err = esp_netif_init(); - if (err != ESP_OK) - { - goto exit; - } - - // Arrange for the ESP event loop to deliver events into the CHIP Device layer. - err = esp_event_loop_create_default(); - if (err != ESP_OK) - { - goto exit; - } - -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - { - wifi_init_config_t cfg; - uint8_t ap_mac[6]; - wifi_mode_t mode; -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP - esp_netif_create_default_wifi_ap(); -#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP - esp_netif_create_default_wifi_sta(); - - esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); - esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); - mStartTime = System::SystemClock().GetMonotonicTimestamp(); - - // Initialize the ESP WiFi layer. - cfg = WIFI_INIT_CONFIG_DEFAULT(); - err = esp_wifi_init(&cfg); - if (err != ESP_OK) - { - goto exit; - } - - esp_wifi_get_mode(&mode); - if ((mode == WIFI_MODE_AP) || (mode == WIFI_MODE_APSTA)) - { - esp_fill_random(ap_mac, sizeof(ap_mac)); - /* Bit 0 of the first octet of MAC Address should always be 0 */ - ap_mac[0] &= (uint8_t) ~0x01; - err = esp_wifi_set_mac(WIFI_IF_AP, ap_mac); - if (err != ESP_OK) - { - goto exit; - } - } - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI - +// err = esp_netif_init(); +// if (err != ESP_OK) +// { +// goto exit; +// } + +// // Arrange for the ESP event loop to deliver events into the CHIP Device layer. +// err = esp_event_loop_create_default(); +// if (err != ESP_OK) +// { +// goto exit; +// } + +//#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +// { +// wifi_init_config_t cfg; +// uint8_t ap_mac[6]; +// wifi_mode_t mode; +//#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP +// esp_netif_create_default_wifi_ap(); +//#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP +// esp_netif_create_default_wifi_sta(); + +// esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); +// esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); +// mStartTime = System::SystemClock().GetMonotonicTimestamp(); + +// // Initialize the ESP WiFi layer. +// cfg = WIFI_INIT_CONFIG_DEFAULT(); +// err = esp_wifi_init(&cfg); +// if (err != ESP_OK) +// { +// goto exit; +// } + +// esp_wifi_get_mode(&mode); +// if ((mode == WIFI_MODE_AP) || (mode == WIFI_MODE_APSTA)) +// { +// esp_fill_random(ap_mac, sizeof(ap_mac)); +// /* Bit 0 of the first octet of MAC Address should always be 0 */ +// ap_mac[0] &= (uint8_t) ~0x01; +// err = esp_wifi_set_mac(WIFI_IF_AP, ap_mac); +// if (err != ESP_OK) +// { +// goto exit; +// } +// } +// } +//#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16)); // Call _InitChipStack() on the generic implementation base class