Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move declare_args sections from data_model into AppConfig.h #32270

Merged
merged 5 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ declare_args() {

enable_eventlist_attribute = false

# Allow building ota-requestor-app with a non-spec-compliant floor
# (i.e. smaller than 2 minutes) for action delays.
non_spec_compliant_ota_action_delay_floor = -1

# enable type sync client for use in `time-synchronization-server` (if linked)
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
# TODO: this should probably be migrated to be time-synchronization-server specific
# if the cluster build targets are decoupled as stand-alone units.
time_sync_enable_tsc_feature = 1

# Systems that can spare a bit of RAM for InteractionModelEngine/delegate
# pointers should do so (allows InteractionModelEngine decoupling and less usage
# of global pointers)
Expand All @@ -65,6 +74,8 @@ buildconfig_header("app_buildconfig") {
"CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE=${enable_eventlist_attribute}",
"CHIP_CONFIG_ENABLE_READ_CLIENT=${chip_enable_read_client}",
"CHIP_CONFIG_STATIC_GLOBAL_INTERACTION_MODEL_ENGINE=${chip_im_static_global_interaction_model_engine}",
"TIME_SYNC_ENABLE_TSC_FEATURE=${time_sync_enable_tsc_feature}",
"NON_SPEC_COMPLIANT_OTA_ACTION_DELAY_FLOOR=${non_spec_compliant_ota_action_delay_floor}",
]

visibility = [ ":app_config" ]
Expand Down
13 changes: 0 additions & 13 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ _app_root = get_path_info(".", "abspath")
template("chip_data_model") {
_data_model_name = target_name

declare_args() {
# Allow building ota-requestor-app with a non-spec-compliant floor
# (i.e. smaller than 2 minutes) for action delays.
non_spec_compliant_ota_action_delay_floor = -1
time_sync_enable_tsc_feature = 1
}

if (defined(invoker.idl)) {
_idl = invoker.idl
} else {
Expand Down Expand Up @@ -271,8 +264,6 @@ template("chip_data_model") {
"${_app_root}/clusters/${cluster}/DefaultTimeSyncDelegate.cpp",
"${_app_root}/clusters/${cluster}/TimeSyncDataProvider.cpp",
]
defines +=
[ "TIME_SYNC_ENABLE_TSC_FEATURE=${time_sync_enable_tsc_feature}" ]
} else if (cluster == "scenes-server") {
sources += [
"${_app_root}/clusters/${cluster}/${cluster}.cpp",
Expand Down Expand Up @@ -387,10 +378,6 @@ template("chip_data_model") {

cflags += [ "-Wconversion" ]

if (non_spec_compliant_ota_action_delay_floor >= 0) {
cflags += [ "-DNON_SPEC_COMPLIANT_OTA_ACTION_DELAY_FLOOR=${non_spec_compliant_ota_action_delay_floor}" ]
}

if (!defined(public_configs)) {
public_configs = []
}
Expand Down
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ constexpr uint8_t kMaxInvalidSessionRetries = 1; // Max # of query image
constexpr uint32_t kDelayQueryUponCommissioningSec = 30; // Delay before sending the initial image query after commissioning
constexpr uint32_t kImmediateStartDelaySec = 1; // Delay before sending a query in response to UrgentUpdateAvailable

#ifdef NON_SPEC_COMPLIANT_OTA_ACTION_DELAY_FLOOR
#if NON_SPEC_COMPLIANT_OTA_ACTION_DELAY_FLOOR >= 0
constexpr System::Clock::Seconds32 kDefaultDelayedActionTime = System::Clock::Seconds32(NON_SPEC_COMPLIANT_OTA_ACTION_DELAY_FLOOR);
#else
constexpr System::Clock::Seconds32 kDefaultDelayedActionTime = System::Clock::Seconds32(120);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
#include "DefaultTimeSyncDelegate.h"
#include "time-synchronization-delegate.h"

#if TIME_SYNC_ENABLE_TSC_FEATURE
#include <app/InteractionModelEngine.h>
#endif

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-enums.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
Expand All @@ -37,10 +34,12 @@
#include <platform/CHIPDeviceLayer.h>
#include <platform/RuntimeOptionsProvider.h>

#include <app-common/zap-generated/cluster-enums.h>

#include <system/SystemClock.h>

#if TIME_SYNC_ENABLE_TSC_FEATURE
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
#include <app/InteractionModelEngine.h>
#endif

using namespace chip;
using namespace chip::app;
using namespace chip::DeviceLayer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@

#pragma once

#ifndef TIME_SYNC_ENABLE_TSC_FEATURE
#define TIME_SYNC_ENABLE_TSC_FEATURE 1
#endif

#include "TimeSyncDataProvider.h"
#include "time-synchronization-delegate.h"

#if TIME_SYNC_ENABLE_TSC_FEATURE
#include <app/ReadClient.h>
#endif
#include <app/AppConfig.h>
#include <app/server/Server.h>
#include <app/util/af-types.h>
#include <app/util/config.h>
Expand All @@ -40,6 +34,12 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <lib/support/Span.h>

// NOTE: this is part of AppConfig, so this has to be checked for AFTER the inclusion
// of that header
#if TIME_SYNC_ENABLE_TSC_FEATURE
#include <app/ReadClient.h>
#endif

namespace chip {
namespace app {
namespace Clusters {
Expand Down
Loading