Skip to content

Commit

Permalink
Example changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 committed Aug 6, 2024
1 parent 3580e65 commit d0b5d23
Show file tree
Hide file tree
Showing 27 changed files with 68 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace chip::DeviceLayer;
using chip::Protocols::InteractionModel::Status;

static std::unique_ptr<OccupancySensingAttrAccess>
gAttrAccess[MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT];
gAttrAccess[MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT + 1];

void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/ManualSetupPayloadGenerator.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>
#include <support/CHIPMem.h>
#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER
Expand Down Expand Up @@ -77,6 +78,7 @@ app::Clusters::NetworkCommissioning::Instance
&(NetworkCommissioning::AmebaWiFiDriver::GetInstance()));

app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
} // namespace

void NetWorkCommissioningInstInit()
Expand Down Expand Up @@ -181,6 +183,7 @@ static void InitServer(intptr_t context)
InitManualOperation();
#endif
app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
MatterMicrowaveOvenServerInit();
#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER
static SmokeCOTestEventTriggerHandler sSmokeCOTestEventTriggerHandler;
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/asr/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <protocols/interaction_model/StatusCode.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <setup_payload/SetupPayload.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

using chip::Protocols::InteractionModel::Status;
Expand All @@ -66,6 +67,7 @@ app::Clusters::NetworkCommissioning::Instance
sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointMain /* Endpoint Id */,
&(NetworkCommissioning::ASRWiFiDriver::GetInstance()));
app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
} // namespace

AppTask AppTask::sAppTask;
Expand Down Expand Up @@ -131,6 +133,7 @@ CHIP_ERROR AppTask::Init()
#endif /* CONFIG_NETWORK_LAYER_BLE */

app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);

return CHIP_NO_ERROR;
}
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.h>
#include <src/platform/cc13xx_26xx/DefaultTestEventTriggerDelegate.h>

#include <static-supported-modes-manager.h>
#include <ti/drivers/apps/Button.h>
#include <ti/drivers/apps/LED.h>

Expand All @@ -73,6 +74,7 @@ static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;

constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

Expand Down Expand Up @@ -334,6 +336,7 @@ int AppTask::Init()
// QR code will be used with CHIP Tool
PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE));

app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
return 0;
}

Expand Down
6 changes: 1 addition & 5 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/mode-support"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
Expand Down Expand Up @@ -106,8 +105,6 @@ set(SRC_DIRS_LIST
)


set(EXCLUDE_SRCS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp")

if (CONFIG_ENABLE_PW_RPC)
# Append additional directories for RPC build
set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}"
Expand Down Expand Up @@ -137,8 +134,7 @@ if (CONFIG_ENABLE_ICD_SERVER)
endif()

idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST}
SRC_DIRS ${SRC_DIRS_LIST}
EXCLUDE_SRCS ${EXCLUDE_SRCS})
SRC_DIRS ${SRC_DIRS_LIST})

get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH)

Expand Down
11 changes: 3 additions & 8 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
#include <common/Esp32ThreadInit.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <examples/platform/esp32/mode-support/static-supported-modes-manager.h>
#include <platform/ESP32/ESP32Utils.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

#if CONFIG_HAVE_DISPLAY
Expand Down Expand Up @@ -95,6 +95,7 @@ class AppCallbacks : public AppDelegate
AppCallbacks sCallbacks;

app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;

constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

Expand Down Expand Up @@ -122,15 +123,9 @@ static void InitServer(intptr_t context)
#if CONFIG_DEVICE_TYPE_M5STACK
SetupPretendDevices();
#endif
CHIP_ERROR err =
app::Clusters::ModeSelect::StaticSupportedModesManager::getStaticSupportedModesManagerInstance().InitEndpointArray(
FIXED_ENDPOINT_COUNT);
if (err != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "Failed to initialize endpoint array for supported-modes, err:%" CHIP_ERROR_FORMAT, err.Format());
}

app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
}

// #include <laundry-washer-controls-server/laundry-washer-controls-server.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <DeviceInfoProviderImpl.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <platform/Infineon/PSOC6/NetworkCommissioningDriver.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

/* OTA related includes */
Expand Down Expand Up @@ -98,6 +99,7 @@ OTAImageProcessorImpl gImageProcessor;
#endif

chip::app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
} // namespace

using namespace ::chip;
Expand Down Expand Up @@ -141,6 +143,7 @@ static void InitServer(intptr_t context)
GetAppTask().InitOTARequestor();
#endif
chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
}

CHIP_ERROR AppTask::StartAppTask()
Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ void ApplicationInit()
#endif
Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
;

Clusters::ValveConfigurationAndControl::SetDefaultDelegate(chip::EndpointId(1), &sValveDelegate);
Clusters::TimeSynchronization::SetDefaultDelegate(&sTimeSyncDelegate);
Expand Down
5 changes: 4 additions & 1 deletion examples/all-clusters-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <app/server/Server.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

#include <lib/support/logging/CHIPLogging.h>
Expand All @@ -45,7 +46,8 @@ using namespace ::chip::Credentials;

namespace {
app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
}
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
} // namespace

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -90,6 +92,7 @@ int AppTask::Init()
return EXIT_FAILURE;
}
app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

#ifdef CONFIG_CHIP_WIFI
Expand Down Expand Up @@ -95,6 +96,7 @@ bool sIsNetworkEnabled = false;
bool sHaveBLEConnections = false;

app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;

#ifdef CONFIG_CHIP_CRYPTO_PSA
chip::Crypto::PSAOperationalKeystore sPSAOperationalKeystore{};
Expand Down Expand Up @@ -257,6 +259,7 @@ CHIP_ERROR AppTask::Init()
}

app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
return err;
}

Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <lib/support/logging/CHIPLogging.h>
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

#include <app/InteractionModelEngine.h>
Expand Down Expand Up @@ -121,6 +122,7 @@ static struct wlan_network sta_network;
static struct wlan_network uap_network;

chip::app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
chip::app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;

const int TASK_MAIN_PRIO = OS_PRIO_3;
const int TASK_MAIN_STACK_SIZE = 800;
Expand Down Expand Up @@ -1083,6 +1085,7 @@ static void run_chip_srv(System::Layer * aSystemLayer, void * aAppState)
// binding --

chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
chip::app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);

return;
}
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@

#include "AppTask.h"
#include "binding-handler.h"
#include <static-supported-modes-manager.h>

LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);

AppTask AppTask::sAppTask;
chip::app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;

CHIP_ERROR AppTask::Init(void)
{
Expand All @@ -35,5 +37,6 @@ CHIP_ERROR AppTask::Init(void)
return err;
}

chip::app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
return CHIP_NO_ERROR;
}
3 changes: 3 additions & 0 deletions examples/all-clusters-app/tizen/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/util/endpoint-config-api.h>
#include <platform/Tizen/NetworkCommissioningDriver.h>
#include <static-supported-modes-manager.h>
#include <static-supported-temperature-levels.h>

#include <TizenServiceAppMain.h>
Expand All @@ -40,6 +41,7 @@ NetworkCommissioning::TizenEthernetDriver sEthernetDriver;
Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sEthernetDriver);

app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
} // namespace

void ApplicationInit()
Expand All @@ -49,6 +51,7 @@ void ApplicationInit()

sEthernetNetworkCommissioningInstance.Init();
app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
}

void ApplicationShutdown() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/ManualSetupPayloadGenerator.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <static-supported-modes-manager.h>
#include <support/CHIPMem.h>

#if CONFIG_ENABLE_OTA_REQUESTOR
Expand Down Expand Up @@ -64,6 +65,7 @@ namespace { // Network Commissioning
constexpr EndpointId kNetworkCommissioningEndpointMain = 0;
constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
app::Clusters::NetworkCommissioning::Instance
sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointMain /* Endpoint Id */,
&(NetworkCommissioning::AmebaWiFiDriver::GetInstance()));
Expand Down Expand Up @@ -170,6 +172,7 @@ static void InitServer(intptr_t context)
// QR code will be used with CHIP Tool
PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE));
}
Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
}

extern "C" void ChipTest(void)
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-minimal-app/asr/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <queue.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <setup_payload/SetupPayload.h>
#include <static-supported-modes-manager.h>

#include "init_Matter.h"
#include "lega_rtos_api.h"
Expand All @@ -60,6 +61,7 @@ QueueHandle_t sAppEventQueue;
constexpr EndpointId kNetworkCommissioningEndpointMain = 0;
constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
app::Clusters::NetworkCommissioning::Instance
sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointMain /* Endpoint Id */,
&(NetworkCommissioning::ASRWiFiDriver::GetInstance()));
Expand Down Expand Up @@ -120,6 +122,7 @@ CHIP_ERROR AppTask::Init()

sLightLED.Init(LIGHT_LED);

app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
return CHIP_NO_ERROR;
}

Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-minimal-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <platform/ESP32/ESP32Utils.h>
#include <static-supported-modes-manager.h>

#if CONFIG_HAVE_DISPLAY
#include "DeviceWithDisplay.h"
Expand Down Expand Up @@ -74,6 +75,7 @@ extern const char TAG[] = "all-clusters-minimal-app";

static AppDeviceCallbacks EchoCallbacks;
static AppDeviceCallbacksDelegate sAppDeviceCallbacksDelegate;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
namespace {

class AppCallbacks : public AppDelegate
Expand Down Expand Up @@ -116,6 +118,7 @@ static void InitServer(intptr_t context)
#if CONFIG_DEVICE_TYPE_M5STACK
SetupPretendDevices();
#endif
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
}

extern "C" void app_main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <DeviceInfoProviderImpl.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <platform/Infineon/PSOC6/NetworkCommissioningDriver.h>
#include <static-supported-modes-manager.h>

/* OTA related includes */
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Expand Down Expand Up @@ -87,6 +88,7 @@ StaticQueue_t sAppEventQueueStruct;

StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)];
StaticTask_t appTaskStruct;
app::Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
DefaultOTARequestor gRequestorCore;
Expand Down Expand Up @@ -138,6 +140,7 @@ static void InitServer(intptr_t context)
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
GetAppTask().InitOTARequestor();
#endif
app::Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);
}

CHIP_ERROR AppTask::StartAppTask()
Expand Down
Loading

0 comments on commit d0b5d23

Please sign in to comment.