Skip to content

Commit e0e019a

Browse files
committed
Define new JF server variables for JF Admins only
1 parent a810300 commit e0e019a

File tree

6 files changed

+33
-3
lines changed

6 files changed

+33
-3
lines changed

examples/jf-admin-app/linux/args.gni

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ chip_enable_additional_data_advertising = true
3434
chip_enable_rotating_device_id = true
3535

3636
chip_enable_read_client = false
37+
38+
chip_device_config_enable_joint_fabric = true

src/app/server/BUILD.gn

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import("//build_overrides/chip.gni")
1616
import("${chip_root}/src/access/access.gni")
1717
import("${chip_root}/src/app/common_flags.gni")
1818
import("${chip_root}/src/app/icd/icd.gni")
19+
import("${chip_root}/src/platform/device.gni")
1920

2021
config("server_config") {
2122
defines = []
@@ -57,12 +58,17 @@ static_library("server") {
5758
"Dnssd.h",
5859
"EchoHandler.cpp",
5960
"EchoHandler.h",
60-
"JointFabricDatastore.cpp",
61-
"JointFabricDatastore.h",
6261
"Server.cpp",
6362
"Server.h",
6463
]
6564

65+
if (chip_device_config_enable_joint_fabric) {
66+
sources += [
67+
"JointFabricDatastore.cpp",
68+
"JointFabricDatastore.h",
69+
]
70+
}
71+
6672
public_configs = [ ":server_config" ]
6773

6874
cflags = [ "-Wconversion" ]

src/app/server/Server.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <app/server/AppDelegate.h>
3434
#include <app/server/CommissioningWindowManager.h>
3535
#include <app/server/DefaultAclStorage.h>
36-
#include <app/server/JointFabricDatastore.h>
3736
#include <credentials/CertificateValidityPolicy.h>
3837
#include <credentials/FabricTable.h>
3938
#include <credentials/GroupDataProvider.h>
@@ -82,6 +81,10 @@
8281
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
8382
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
8483

84+
#if CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
85+
#include <app/server/JointFabricDatastore.h>
86+
#endif // CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
87+
8588
namespace chip {
8689

8790
inline constexpr size_t kMaxBlePendingPackets = 1;
@@ -419,7 +422,9 @@ class Server
419422

420423
app::reporting::ReportScheduler * GetReportScheduler() { return mReportScheduler; }
421424

425+
#if CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
422426
app::JointFabricDatastore & GetJointFabricDatastore() { return mJointFabricDatastore; }
427+
#endif // CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
423428

424429
#if CHIP_CONFIG_ENABLE_ICD_SERVER
425430
app::ICDManager & GetICDManager() { return mICDManager; }
@@ -700,7 +705,9 @@ class Server
700705
Access::AccessControl mAccessControl;
701706
app::AclStorage * mAclStorage;
702707

708+
#if CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
703709
app::JointFabricDatastore mJointFabricDatastore;
710+
#endif // CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
704711

705712
TestEventTriggerDelegate * mTestEventTriggerDelegate;
706713
Crypto::OperationalKeystore * mOperationalKeystore;

src/include/platform/CHIPDeviceConfig.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,3 +1655,12 @@ static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE
16551655
#ifndef CHIP_DEVICE_ENABLE_PORT_PARAMS
16561656
#define CHIP_DEVICE_ENABLE_PORT_PARAMS 0
16571657
#endif // CHIP_DEVICE_ENABLE_PORT_PARAMS
1658+
1659+
/**
1660+
* CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
1661+
*
1662+
* Enable support for Joint Fabric in core SDK.
1663+
*/
1664+
#ifndef CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
1665+
#define CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC 0
1666+
#endif

src/platform/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
141141
"CHIP_USE_TRANSITIONAL_DEVICE_INSTANCE_INFO_PROVIDER=${chip_use_transitional_device_instance_info_provider}",
142142
"CHIP_DEVICE_CONFIG_ENABLE_DYNAMIC_MRP_CONFIG=${chip_device_config_enable_dynamic_mrp_config}",
143143
"CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF=${chip_device_config_enable_wifipaf}",
144+
"CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC=${chip_device_config_enable_joint_fabric}",
144145
]
145146

146147
public_deps = [ "${chip_root}/src/app/icd/server:icd-server-config" ]

src/platform/device.gni

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ declare_args() {
120120
}
121121
}
122122

123+
declare_args() {
124+
# Enable Joint Fabric features
125+
chip_device_config_enable_joint_fabric = false
126+
}
127+
123128
declare_args() {
124129
# Include wifi-paf to commission the device or not
125130
# This is a feature of Wi-Fi spec that it can be enabled if wifi is enabled

0 commit comments

Comments
 (0)