Skip to content

Commit

Permalink
Added necessary changes to comply with SLC/GSDK integration (#23478)
Browse files Browse the repository at this point in the history
  • Loading branch information
CuRahman authored and pull[bot] committed Jun 22, 2023
1 parent 555f684 commit 2258978
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions examples/platform/efr32/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
*/

#include "LEDWidget.h"

extern "C" {
#include "sl_simple_led_instances.h"
}

#include <platform/CHIPDeviceLayer.h>

Expand Down
9 changes: 8 additions & 1 deletion examples/platform/efr32/OTAConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@

#include "OTAConfig.h"

#include "platform/bootloader/api/application_properties.h"
#include "application_properties.h"
#include <app/server/Server.h>

#if defined(SL_COMPONENT_CATALOG_PRESENT)
#include "sl_component_catalog.h"
#endif

// Only include app properties if the Gecko SDK component that does it automatically isn't present
#if !defined(SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT)
// Header used for building the image GBL file
#define APP_PROPERTIES_VERSION 1
#define APP_PROPERTIES_ID \
Expand Down Expand Up @@ -65,6 +71,7 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = {
/// Pointer to Long Token Data Section
.longTokenSectionAddress = NULL,
};
#endif // SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT

// Global OTA objects
chip::DefaultOTARequestor gRequestorCore;
Expand Down
4 changes: 4 additions & 0 deletions examples/platform/efr32/matter_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ CHIP_ERROR EFR32MatterConfig::InitOpenThread(void)
}
#endif // CHIP_ENABLE_OPENTHREAD

#if EFR32_OTA_ENABLED
void EFR32MatterConfig::InitOTARequestorHandler(System::Layer * systemLayer, void * appState)
{
OTAConfig::Init();
}
#endif

void EFR32MatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event, intptr_t arg)
{
Expand All @@ -118,9 +120,11 @@ void EFR32MatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event,
((event->Type == DeviceEventType::kInternetConnectivityChange) &&
(event->InternetConnectivityChange.IPv6 == kConnectivity_Established)))
{
#if EFR32_OTA_ENABLED
EFR32_LOG("Scheduling OTA Requestor initialization")
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec),
InitOTARequestorHandler, nullptr);
#endif
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform/EFR32/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <app/clusters/ota-requestor/OTARequestorInterface.h>

extern "C" {
#include "platform/bootloader/api/btl_interface.h"
#include "platform/emlib/inc/em_bus.h" // For CORE_CRITICAL_SECTION
#include "btl_interface.h"
#include "em_bus.h" // For CORE_CRITICAL_SECTION
}

#include "EFR32Config.h"
Expand Down

0 comments on commit 2258978

Please sign in to comment.