Make constexpr constants in headers inline constexpr (#29279)
* Make constexpr constants in headers inline constexpr
This makes the linker deduplicate these constants, instead of emitting one
definition per compilation unit. E.g. chip::System::Clock::kZero currently
exists >10 times in the chip-tool binary.
* Restyle
diff --git a/examples/chip-tool/commands/clusters/ComplexArgument.h b/examples/chip-tool/commands/clusters/ComplexArgument.h
index 7705ba5..fa19553 100644
--- a/examples/chip-tool/commands/clusters/ComplexArgument.h
+++ b/examples/chip-tool/commands/clusters/ComplexArgument.h
@@ -45,8 +45,8 @@
#include "JsonParser.h"
-constexpr uint8_t kMaxLabelLength = UINT8_MAX;
-constexpr const char kNullString[] = "null";
+inline constexpr uint8_t kMaxLabelLength = UINT8_MAX;
+inline constexpr const char kNullString[] = "null";
class ComplexArgumentParser
{
diff --git a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h
index 46a0b3d..76dc64e 100644
--- a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h
+++ b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h
@@ -23,9 +23,9 @@
#include "DataModelLogger.h"
#include "ModelCommand.h"
-constexpr const char * kWriteCommandKey = "write";
-constexpr const char * kWriteByIdCommandKey = "write-by-id";
-constexpr const char * kForceWriteCommandKey = "force-write";
+inline constexpr const char * kWriteCommandKey = "write";
+inline constexpr const char * kWriteByIdCommandKey = "write-by-id";
+inline constexpr const char * kForceWriteCommandKey = "force-write";
enum class WriteCommandType
{
diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h
index 9d7c3c1..3673279 100644
--- a/examples/chip-tool/commands/common/CHIPCommand.h
+++ b/examples/chip-tool/commands/common/CHIPCommand.h
@@ -34,9 +34,9 @@
#pragma once
-constexpr const char kIdentityAlpha[] = "alpha";
-constexpr const char kIdentityBeta[] = "beta";
-constexpr const char kIdentityGamma[] = "gamma";
+inline constexpr const char kIdentityAlpha[] = "alpha";
+inline constexpr const char kIdentityBeta[] = "beta";
+inline constexpr const char kIdentityGamma[] = "gamma";
// The null fabric commissioner is a commissioner that isn't on a fabric.
// This is a legal configuration in which the commissioner delegates
// operational communication and invocation of the commssioning complete
@@ -46,7 +46,7 @@
// commissioner portion of such an architecture. The null-fabric-commissioner
// can carry a commissioning flow up until the point of operational channel
// (CASE) communcation.
-constexpr const char kIdentityNull[] = "null-fabric-commissioner";
+inline constexpr const char kIdentityNull[] = "null-fabric-commissioner";
class CHIPCommand : public Command
{
diff --git a/examples/chip-tool/commands/common/CustomStringPrefix.h b/examples/chip-tool/commands/common/CustomStringPrefix.h
index 235e190..63196f7 100644
--- a/examples/chip-tool/commands/common/CustomStringPrefix.h
+++ b/examples/chip-tool/commands/common/CustomStringPrefix.h
@@ -22,17 +22,17 @@
#include <lib/support/CodeUtils.h>
-static constexpr char kJsonStringPrefix[] = "json:";
-constexpr size_t kJsonStringPrefixLen = ArraySize(kJsonStringPrefix) - 1; // Don't count the null
+static constexpr char kJsonStringPrefix[] = "json:";
+inline constexpr size_t kJsonStringPrefixLen = ArraySize(kJsonStringPrefix) - 1; // Don't count the null
-static constexpr char kBase64StringPrefix[] = "base64:";
-constexpr size_t kBase64StringPrefixLen = ArraySize(kBase64StringPrefix) - 1; // Don't count the null
+static constexpr char kBase64StringPrefix[] = "base64:";
+inline constexpr size_t kBase64StringPrefixLen = ArraySize(kBase64StringPrefix) - 1; // Don't count the null
-static constexpr char kHexStringPrefix[] = "hex:";
-constexpr size_t kHexStringPrefixLen = ArraySize(kHexStringPrefix) - 1; // Don't count the null
+static constexpr char kHexStringPrefix[] = "hex:";
+inline constexpr size_t kHexStringPrefixLen = ArraySize(kHexStringPrefix) - 1; // Don't count the null
-static constexpr char kStrStringPrefix[] = "str:";
-constexpr size_t kStrStringPrefixLen = ArraySize(kStrStringPrefix) - 1; // Don't count the null
+static constexpr char kStrStringPrefix[] = "str:";
+inline constexpr size_t kStrStringPrefixLen = ArraySize(kStrStringPrefix) - 1; // Don't count the null
inline bool IsJsonString(const char * str)
{
diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h
index 0f5015e..4537f52 100644
--- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h
@@ -28,9 +28,9 @@
#pragma once
-constexpr const char kIdentityAlpha[] = "alpha";
-constexpr const char kIdentityBeta[] = "beta";
-constexpr const char kIdentityGamma[] = "gamma";
+inline constexpr const char kIdentityAlpha[] = "alpha";
+inline constexpr const char kIdentityBeta[] = "beta";
+inline constexpr const char kIdentityGamma[] = "gamma";
class CHIPCommandBridge : public Command {
public:
diff --git a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h
index b3d08ec..abcc56d 100644
--- a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h
@@ -41,7 +41,7 @@
const char * getScriptsFolder() { return basePath; }
} // namespace
-constexpr const char * kDefaultKey = "default";
+inline constexpr const char * kDefaultKey = "default";
@interface TestDeviceControllerDelegate : NSObject <MTRDeviceControllerDelegate>
@property TestCommandBridge * commandBridge;
@@ -58,7 +58,7 @@
NS_ASSUME_NONNULL_END
-constexpr uint16_t kTimeoutInSeconds = 90;
+inline constexpr uint16_t kTimeoutInSeconds = 90;
class TestCommandBridge : public CHIPCommandBridge,
public ValueChecker,
diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h
index 7bd4d3b..e078345 100644
--- a/examples/placeholder/linux/include/TestCommand.h
+++ b/examples/placeholder/linux/include/TestCommand.h
@@ -35,9 +35,9 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app-common/zap-generated/ids/Commands.h>
-constexpr const char kIdentityAlpha[] = "";
-constexpr const char kIdentityBeta[] = "";
-constexpr const char kIdentityGamma[] = "";
+inline constexpr const char kIdentityAlpha[] = "";
+inline constexpr const char kIdentityBeta[] = "";
+inline constexpr const char kIdentityGamma[] = "";
class TestCommand : public TestRunner,
public PICSChecker,
diff --git a/examples/platform/telink/common/include/AppTaskCommon.h b/examples/platform/telink/common/include/AppTaskCommon.h
index 74f1f87..09a8e89 100644
--- a/examples/platform/telink/common/include/AppTaskCommon.h
+++ b/examples/platform/telink/common/include/AppTaskCommon.h
@@ -53,11 +53,11 @@
using namespace ::chip::DeviceLayer;
namespace {
-constexpr EndpointId kExampleEndpointId = 1;
-constexpr uint8_t kDefaultMinLevel = 0;
-constexpr uint8_t kDefaultMaxLevel = 254;
-constexpr uint8_t kButtonPushEvent = 1;
-constexpr uint8_t kButtonReleaseEvent = 0;
+inline constexpr EndpointId kExampleEndpointId = 1;
+inline constexpr uint8_t kDefaultMinLevel = 0;
+inline constexpr uint8_t kDefaultMaxLevel = 254;
+inline constexpr uint8_t kButtonPushEvent = 1;
+inline constexpr uint8_t kButtonReleaseEvent = 0;
} // namespace
class AppTaskCommon
diff --git a/examples/shell/shell_common/include/Globals.h b/examples/shell/shell_common/include/Globals.h
index fd2726c..d91620c 100644
--- a/examples/shell/shell_common/include/Globals.h
+++ b/examples/shell/shell_common/include/Globals.h
@@ -28,10 +28,10 @@
#include <transport/raw/UDP.h>
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
-constexpr size_t kMaxTcpActiveConnectionCount = 4;
-constexpr size_t kMaxTcpPendingPackets = 4;
+inline constexpr size_t kMaxTcpActiveConnectionCount = 4;
+inline constexpr size_t kMaxTcpPendingPackets = 4;
#endif
-constexpr chip::System::Clock::Timeout kResponseTimeOut = chip::System::Clock::Seconds16(1);
+inline constexpr chip::System::Clock::Timeout kResponseTimeOut = chip::System::Clock::Seconds16(1);
extern chip::FabricTable gFabricTable;
extern chip::secure_channel::MessageCounterManager gMessageCounterManager;
diff --git a/examples/tv-casting-app/linux/CastingUtils.h b/examples/tv-casting-app/linux/CastingUtils.h
index 13d9818..d87a831 100644
--- a/examples/tv-casting-app/linux/CastingUtils.h
+++ b/examples/tv-casting-app/linux/CastingUtils.h
@@ -26,7 +26,7 @@
#include "TargetEndpointInfo.h"
#include "TargetVideoPlayerInfo.h"
-constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000;
+inline constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000;
CHIP_ERROR ProcessClusterCommand(int argc, char ** argv);
diff --git a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h
index fd427af..f6078dd 100644
--- a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h
+++ b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h
@@ -40,7 +40,7 @@
#include <controller/CHIPCommissionableNodeController.h>
#include <functional>
-constexpr chip::System::Clock::Seconds16 kCommissioningWindowTimeout = chip::System::Clock::Seconds16(3 * 60);
+inline constexpr chip::System::Clock::Seconds16 kCommissioningWindowTimeout = chip::System::Clock::Seconds16(3 * 60);
/**
* @brief Represents a TV Casting server that can get the casting app commissioned
diff --git a/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h b/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h
index f0774c3..2e4b7c9 100644
--- a/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h
+++ b/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h
@@ -21,7 +21,7 @@
#include "TargetEndpointInfo.h"
#include "TargetVideoPlayerInfo.h"
-constexpr size_t kMaxCachedVideoPlayers = 32;
+inline constexpr size_t kMaxCachedVideoPlayers = 32;
class PersistenceManager : public chip::FabricTable::Delegate
{
diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h
index 31cfde0..f93251e 100644
--- a/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h
+++ b/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h
@@ -20,7 +20,7 @@
#include <platform/CHIPDeviceLayer.h>
-constexpr size_t kMaxNumberOfClustersPerEndpoint = 10;
+inline constexpr size_t kMaxNumberOfClustersPerEndpoint = 10;
class TargetEndpointInfo
{
diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h
index bbc086a..d027a19 100644
--- a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h
+++ b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h
@@ -25,7 +25,7 @@
#include <app-common/zap-generated/cluster-objects.h>
-constexpr size_t kMaxNumberOfEndpoints = 5;
+inline constexpr size_t kMaxNumberOfEndpoints = 5;
class TargetVideoPlayerInfo;
class VideoPlayerConnectionContext
diff --git a/src/app/EventLoggingTypes.h b/src/app/EventLoggingTypes.h
index 3517742..35fd37a 100644
--- a/src/app/EventLoggingTypes.h
+++ b/src/app/EventLoggingTypes.h
@@ -26,7 +26,7 @@
#include <lib/core/TLV.h>
#include <system/SystemPacketBuffer.h>
-constexpr size_t kNumPriorityLevel = 3;
+inline constexpr size_t kNumPriorityLevel = 3;
namespace chip {
namespace app {
diff --git a/src/app/EventManagement.h b/src/app/EventManagement.h
index 2286328..228c26c 100644
--- a/src/app/EventManagement.h
+++ b/src/app/EventManagement.h
@@ -70,9 +70,9 @@
namespace chip {
namespace app {
-constexpr const uint32_t kEventManagementProfile = 0x1;
-constexpr const uint32_t kFabricIndexTag = 0x1;
-constexpr size_t kMaxEventSizeReserve = 512;
+inline constexpr const uint32_t kEventManagementProfile = 0x1;
+inline constexpr const uint32_t kFabricIndexTag = 0x1;
+inline constexpr size_t kMaxEventSizeReserve = 512;
constexpr uint16_t kRequiredEventField =
(1 << to_underlying(EventDataIB::Tag::kPriority)) | (1 << to_underlying(EventDataIB::Tag::kPath));
diff --git a/src/app/InteractionModelRevision.h b/src/app/InteractionModelRevision.h
index 9cc9fc6..529ac0f 100644
--- a/src/app/InteractionModelRevision.h
+++ b/src/app/InteractionModelRevision.h
@@ -32,4 +32,4 @@
#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 11
#endif
-constexpr uint8_t kInteractionModelRevisionTag = 0xFF;
+inline constexpr uint8_t kInteractionModelRevisionTag = 0xFF;
diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h
index ecdc0c1..4c9ad46 100644
--- a/src/app/ReadHandler.h
+++ b/src/app/ReadHandler.h
@@ -52,7 +52,7 @@
#include <system/SystemPacketBuffer.h>
// https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/61a9d19e6af12fdfb0872bcff26d19de6c680a1a/src/Ch02_Architecture.adoc#1122-subscribe-interaction-limits
-constexpr uint16_t kSubscriptionMaxIntervalPublisherLimit = 3600; // seconds (60 minutes)
+inline constexpr uint16_t kSubscriptionMaxIntervalPublisherLimit = 3600; // seconds (60 minutes)
namespace chip {
namespace app {
diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h
index 8ab9efa..593ec07 100644
--- a/src/app/app-platform/ContentAppPlatform.h
+++ b/src/app/app-platform/ContentAppPlatform.h
@@ -49,9 +49,9 @@
EmberAfStatus AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
-constexpr EndpointId kTargetBindingClusterEndpointId = 0;
-constexpr EndpointId kLocalVideoPlayerEndpointId = 1;
-constexpr EndpointId kLocalSpeakerEndpointId = 2;
+inline constexpr EndpointId kTargetBindingClusterEndpointId = 0;
+inline constexpr EndpointId kLocalVideoPlayerEndpointId = 1;
+inline constexpr EndpointId kLocalSpeakerEndpointId = 2;
class DLL_EXPORT ContentAppFactory
{
diff --git a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h
index 8fdd68c..1910e00 100644
--- a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h
+++ b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h
@@ -27,10 +27,10 @@
namespace Clusters {
namespace OperationalState {
-constexpr size_t kOperationalStateLabelMaxSize = 64u;
-constexpr size_t kOperationalErrorLabelMaxSize = 64u;
-constexpr size_t kOperationalErrorDetailsMaxSize = 64u;
-constexpr size_t kOperationalPhaseNameMaxSize = 64u;
+inline constexpr size_t kOperationalStateLabelMaxSize = 64u;
+inline constexpr size_t kOperationalErrorLabelMaxSize = 64u;
+inline constexpr size_t kOperationalErrorDetailsMaxSize = 64u;
+inline constexpr size_t kOperationalPhaseNameMaxSize = 64u;
/**
* A class which represents the operational state of an Operational State cluster derivation instance.
diff --git a/src/app/clusters/scenes-server/SceneTable.h b/src/app/clusters/scenes-server/SceneTable.h
index b76ade0..e7fb232 100644
--- a/src/app/clusters/scenes-server/SceneTable.h
+++ b/src/app/clusters/scenes-server/SceneTable.h
@@ -33,9 +33,9 @@
typedef uint32_t TransitionTimeMs;
typedef uint32_t SceneTransitionTime;
-constexpr GroupId kGlobalGroupSceneId = 0x0000;
-constexpr SceneIndex kUndefinedSceneIndex = 0xffff;
-constexpr SceneId kUndefinedSceneId = 0xff;
+inline constexpr GroupId kGlobalGroupSceneId = 0x0000;
+inline constexpr SceneIndex kUndefinedSceneIndex = 0xffff;
+inline constexpr SceneId kUndefinedSceneId = 0xff;
static constexpr size_t kIteratorsMax = CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS;
static constexpr size_t kSceneNameMaxLength = CHIP_CONFIG_SCENES_CLUSTER_MAXIMUM_NAME_LENGTH;
diff --git a/src/app/data-model/Encode.h b/src/app/data-model/Encode.h
index 84a32cf..7cb8298 100644
--- a/src/app/data-model/Encode.h
+++ b/src/app/data-model/Encode.h
@@ -37,10 +37,10 @@
using VoidType = void;
template <typename, typename = void>
-constexpr bool HasUnknownValue = false;
+inline constexpr bool HasUnknownValue = false;
template <typename T>
-constexpr bool HasUnknownValue<T, VoidType<T, T::kUnknownEnumValue>> = true;
+inline constexpr bool HasUnknownValue<T, VoidType<T, T::kUnknownEnumValue>> = true;
} // namespace detail
/*
diff --git a/src/app/data-model/Nullable.h b/src/app/data-model/Nullable.h
index ad6bdaf..dec7fc5 100644
--- a/src/app/data-model/Nullable.h
+++ b/src/app/data-model/Nullable.h
@@ -30,7 +30,7 @@
/**
* NullNullable is an alias for NullOptional, for better readability.
*/
-constexpr auto NullNullable = NullOptional;
+inline constexpr auto NullNullable = NullOptional;
/*
* Dedicated type for nullable things, to differentiate them from optional
diff --git a/src/app/icd/IcdMonitoringTable.h b/src/app/icd/IcdMonitoringTable.h
index 0bfb311..86186ae 100644
--- a/src/app/icd/IcdMonitoringTable.h
+++ b/src/app/icd/IcdMonitoringTable.h
@@ -25,7 +25,7 @@
namespace chip {
-constexpr size_t kIcdMonitoringBufferSize = 40;
+inline constexpr size_t kIcdMonitoringBufferSize = 40;
struct IcdMonitoringEntry : public PersistentData<kIcdMonitoringBufferSize>
{
diff --git a/src/app/server/Server.h b/src/app/server/Server.h
index e2bcbe8..2d9a78c 100644
--- a/src/app/server/Server.h
+++ b/src/app/server/Server.h
@@ -74,7 +74,7 @@
namespace chip {
-constexpr size_t kMaxBlePendingPackets = 1;
+inline constexpr size_t kMaxBlePendingPackets = 1;
//
// NOTE: Please do not alter the order of template specialization here as the logic
diff --git a/src/app/tests/integration/common.h b/src/app/tests/integration/common.h
index 4766b9d..5d23247 100644
--- a/src/app/tests/integration/common.h
+++ b/src/app/tests/integration/common.h
@@ -43,18 +43,18 @@
extern chip::TestPersistentStorageDelegate gStorage;
extern chip::Crypto::DefaultSessionKeystore gSessionKeystore;
-constexpr chip::NodeId kTestNodeId = 0x1ULL;
-constexpr chip::NodeId kTestNodeId1 = 0x2ULL;
-constexpr chip::ClusterId kTestClusterId = 6;
-constexpr chip::CommandId kTestCommandId = 40;
-constexpr chip::EndpointId kTestEndpointId = 1;
-constexpr chip::GroupId kTestGroupId = 0;
-constexpr chip::FieldId kTestFieldId1 = 1;
-constexpr chip::FieldId kTestFieldId2 = 2;
-constexpr uint8_t kTestFieldValue1 = 1;
-constexpr uint8_t kTestFieldValue2 = 2;
-constexpr chip::EventId kTestChangeEvent1 = 1;
-constexpr chip::EventId kTestChangeEvent2 = 2;
+inline constexpr chip::NodeId kTestNodeId = 0x1ULL;
+inline constexpr chip::NodeId kTestNodeId1 = 0x2ULL;
+inline constexpr chip::ClusterId kTestClusterId = 6;
+inline constexpr chip::CommandId kTestCommandId = 40;
+inline constexpr chip::EndpointId kTestEndpointId = 1;
+inline constexpr chip::GroupId kTestGroupId = 0;
+inline constexpr chip::FieldId kTestFieldId1 = 1;
+inline constexpr chip::FieldId kTestFieldId2 = 2;
+inline constexpr uint8_t kTestFieldValue1 = 1;
+inline constexpr uint8_t kTestFieldValue2 = 2;
+inline constexpr chip::EventId kTestChangeEvent1 = 1;
+inline constexpr chip::EventId kTestChangeEvent2 = 2;
void InitializeChip(void);
void ShutdownChip(void);
void TLVPrettyPrinter(const char * aFormat, ...);
diff --git a/src/app/tests/suites/commands/interaction_model/InteractionModel.h b/src/app/tests/suites/commands/interaction_model/InteractionModel.h
index c52ff74..da3c337 100644
--- a/src/app/tests/suites/commands/interaction_model/InteractionModel.h
+++ b/src/app/tests/suites/commands/interaction_model/InteractionModel.h
@@ -28,7 +28,7 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/UnitTestUtils.h>
-constexpr uint8_t kMaxAllowedPaths = 64;
+inline constexpr uint8_t kMaxAllowedPaths = 64;
namespace chip {
namespace test_utils {
diff --git a/src/app/util/mock/Constants.h b/src/app/util/mock/Constants.h
index a9017a5..803dff5 100644
--- a/src/app/util/mock/Constants.h
+++ b/src/app/util/mock/Constants.h
@@ -30,10 +30,10 @@
namespace chip {
namespace Test {
-constexpr EndpointId kMockEndpoint1 = 0xFFFE;
-constexpr EndpointId kMockEndpoint2 = 0xFFFD;
-constexpr EndpointId kMockEndpoint3 = 0xFFFC;
-constexpr EndpointId kMockEndpointMin = 0xFFF1;
+inline constexpr EndpointId kMockEndpoint1 = 0xFFFE;
+inline constexpr EndpointId kMockEndpoint2 = 0xFFFD;
+inline constexpr EndpointId kMockEndpoint3 = 0xFFFC;
+inline constexpr EndpointId kMockEndpointMin = 0xFFF1;
constexpr AttributeId MockAttributeId(const uint16_t & id)
{
diff --git a/src/app/util/privilege-storage.h b/src/app/util/privilege-storage.h
index 5253769..02d5548 100644
--- a/src/app/util/privilege-storage.h
+++ b/src/app/util/privilege-storage.h
@@ -18,11 +18,11 @@
#include <lib/core/DataModelTypes.h>
-constexpr int kMatterAccessPrivilegeView = 0;
-constexpr int kMatterAccessPrivilegeOperate = 1;
-constexpr int kMatterAccessPrivilegeManage = 2;
-constexpr int kMatterAccessPrivilegeAdminister = 3;
-constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister;
+inline constexpr int kMatterAccessPrivilegeView = 0;
+inline constexpr int kMatterAccessPrivilegeOperate = 1;
+inline constexpr int kMatterAccessPrivilegeManage = 2;
+inline constexpr int kMatterAccessPrivilegeAdminister = 3;
+inline constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister;
int MatterGetAccessPrivilegeForReadAttribute(chip::ClusterId cluster, chip::AttributeId attribute);
int MatterGetAccessPrivilegeForWriteAttribute(chip::ClusterId cluster, chip::AttributeId attribute);
diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h
index 1f9dec2..5ded6c8 100644
--- a/src/ble/BleLayer.h
+++ b/src/ble/BleLayer.h
@@ -92,17 +92,17 @@
kBleTransportProtocolVersion_V4 = 4 // BTP as defined by CHIP v1.0
} BleTransportProtocolVersion;
-constexpr size_t kCapabilitiesRequestMagicnumLength = 2;
-constexpr size_t kCapabilitiesRequestL2capMtuLength = 2;
-constexpr size_t kCapabilitiesRequestSupportedVersionsLength = 4;
-constexpr size_t kCapabilitiesRequestWindowSizeLength = 1;
+inline constexpr size_t kCapabilitiesRequestMagicnumLength = 2;
+inline constexpr size_t kCapabilitiesRequestL2capMtuLength = 2;
+inline constexpr size_t kCapabilitiesRequestSupportedVersionsLength = 4;
+inline constexpr size_t kCapabilitiesRequestWindowSizeLength = 1;
constexpr size_t kCapabilitiesRequestLength = (kCapabilitiesRequestMagicnumLength + kCapabilitiesRequestL2capMtuLength +
kCapabilitiesRequestSupportedVersionsLength + kCapabilitiesRequestWindowSizeLength);
-constexpr size_t kCapabilitiesResponseMagicnumLength = 2;
-constexpr size_t kCapabilitiesResponseL2capMtuLength = 2;
-constexpr size_t kCapabilitiesResponseSelectedProtocolVersionLength = 1;
-constexpr size_t kCapabilitiesResponseWindowSizeLength = 1;
+inline constexpr size_t kCapabilitiesResponseMagicnumLength = 2;
+inline constexpr size_t kCapabilitiesResponseL2capMtuLength = 2;
+inline constexpr size_t kCapabilitiesResponseSelectedProtocolVersionLength = 1;
+inline constexpr size_t kCapabilitiesResponseWindowSizeLength = 1;
constexpr size_t kCapabilitiesResponseLength(kCapabilitiesResponseMagicnumLength + kCapabilitiesResponseL2capMtuLength +
kCapabilitiesResponseSelectedProtocolVersionLength +
kCapabilitiesResponseWindowSizeLength);
diff --git a/src/ble/BtpEngine.h b/src/ble/BtpEngine.h
index 4d32cf7..7ec59e3 100644
--- a/src/ble/BtpEngine.h
+++ b/src/ble/BtpEngine.h
@@ -43,10 +43,10 @@
namespace chip {
namespace Ble {
-constexpr size_t kTransferProtocolHeaderFlagsSize = 1; // Size in bytes of enocded BTP fragment header flag bits
-constexpr size_t kTransferProtocolSequenceNumSize = 1; // Size in bytes of encoded BTP sequence number
-constexpr size_t kTransferProtocolAckSize = 1; // Size in bytes of encoded BTP fragment acknowledgement number
-constexpr size_t kTransferProtocolMsgLenSize = 2; // Size in byte of encoded BTP total fragmented message length
+inline constexpr size_t kTransferProtocolHeaderFlagsSize = 1; // Size in bytes of enocded BTP fragment header flag bits
+inline constexpr size_t kTransferProtocolSequenceNumSize = 1; // Size in bytes of encoded BTP sequence number
+inline constexpr size_t kTransferProtocolAckSize = 1; // Size in bytes of encoded BTP fragment acknowledgement number
+inline constexpr size_t kTransferProtocolMsgLenSize = 2; // Size in byte of encoded BTP total fragmented message length
constexpr size_t kTransferProtocolMaxHeaderSize =
kTransferProtocolHeaderFlagsSize + kTransferProtocolAckSize + kTransferProtocolSequenceNumSize + kTransferProtocolMsgLenSize;
diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h
index b328ef6..6d61ee8 100644
--- a/src/controller/CHIPDeviceController.h
+++ b/src/controller/CHIPDeviceController.h
@@ -81,7 +81,7 @@
using namespace chip::Protocols::UserDirectedCommissioning;
-constexpr uint16_t kNumMaxActiveDevices = CHIP_CONFIG_CONTROLLER_MAX_ACTIVE_DEVICES;
+inline constexpr uint16_t kNumMaxActiveDevices = CHIP_CONFIG_CONTROLLER_MAX_ACTIVE_DEVICES;
// Raw functions for cluster callbacks
void OnBasicFailure(void * context, CHIP_ERROR err);
diff --git a/src/controller/CHIPDeviceControllerSystemState.h b/src/controller/CHIPDeviceControllerSystemState.h
index 6692fc6..5c17316 100644
--- a/src/controller/CHIPDeviceControllerSystemState.h
+++ b/src/controller/CHIPDeviceControllerSystemState.h
@@ -54,7 +54,7 @@
namespace chip {
-constexpr size_t kMaxDeviceTransportBlePendingPackets = 1;
+inline constexpr size_t kMaxDeviceTransportBlePendingPackets = 1;
using DeviceTransportMgr = TransportMgr<Transport::UDP /* IPv6 */
#if INET_CONFIG_ENABLE_IPV4
diff --git a/src/controller/CommissioneeDeviceProxy.h b/src/controller/CommissioneeDeviceProxy.h
index e5c4ac1..fa9aa17 100644
--- a/src/controller/CommissioneeDeviceProxy.h
+++ b/src/controller/CommissioneeDeviceProxy.h
@@ -46,7 +46,7 @@
namespace chip {
-constexpr size_t kAttestationNonceLength = 32;
+inline constexpr size_t kAttestationNonceLength = 32;
struct ControllerDeviceInitParams
{
diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h
index 85724b1..47ca121 100644
--- a/src/controller/CommissioningDelegate.h
+++ b/src/controller/CommissioningDelegate.h
@@ -96,11 +96,11 @@
Optional<app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum> networkCommissioningStatus;
};
-constexpr uint16_t kDefaultFailsafeTimeout = 60;
+inline constexpr uint16_t kDefaultFailsafeTimeout = 60;
// Per spec, all commands that are sent with the failsafe armed need at least
// a 30s timeout.
-constexpr System::Clock::Timeout kMinimumCommissioningStepTimeout = System::Clock::Seconds16(30);
+inline constexpr System::Clock::Timeout kMinimumCommissioningStepTimeout = System::Clock::Seconds16(30);
class CommissioningParameters
{
diff --git a/src/controller/OperationalCredentialsDelegate.h b/src/controller/OperationalCredentialsDelegate.h
index 5d51f82..1a7a8c4 100644
--- a/src/controller/OperationalCredentialsDelegate.h
+++ b/src/controller/OperationalCredentialsDelegate.h
@@ -33,8 +33,8 @@
const ByteSpan & rcac, Optional<Crypto::IdentityProtectionKeySpan> ipk,
Optional<NodeId> adminSubject);
-constexpr uint32_t kMaxCHIPDERCertLength = 600;
-constexpr size_t kCSRNonceLength = 32;
+inline constexpr uint32_t kMaxCHIPDERCertLength = 600;
+inline constexpr size_t kCSRNonceLength = 32;
/// Callbacks for CHIP operational credentials generation
class DLL_EXPORT OperationalCredentialsDelegate
diff --git a/src/credentials/DeviceAttestationConstructor.h b/src/credentials/DeviceAttestationConstructor.h
index b8404ef..7880199 100644
--- a/src/credentials/DeviceAttestationConstructor.h
+++ b/src/credentials/DeviceAttestationConstructor.h
@@ -24,10 +24,10 @@
namespace Credentials {
// As per specifications section 11.22.5.1. Constant RESP_MAX
-constexpr size_t kMaxRspLen = 900;
+inline constexpr size_t kMaxRspLen = 900;
// CSRNonce and AttestationNonce need to be this size
-constexpr size_t kExpectedAttestationNonceSize = 32;
+inline constexpr size_t kExpectedAttestationNonceSize = 32;
/**
* @brief Take the attestation elements buffer and return each component separately.
diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h
index 9e276b9..5b661f1 100644
--- a/src/crypto/CHIPCryptoPAL.h
+++ b/src/crypto/CHIPCryptoPAL.h
@@ -42,78 +42,78 @@
namespace chip {
namespace Crypto {
-constexpr size_t kMax_x509_Certificate_Length = 600;
+inline constexpr size_t kMax_x509_Certificate_Length = 600;
-constexpr size_t kP256_FE_Length = 32;
-constexpr size_t kP256_ECDSA_Signature_Length_Raw = (2 * kP256_FE_Length);
-constexpr size_t kP256_Point_Length = (2 * kP256_FE_Length + 1);
-constexpr size_t kSHA256_Hash_Length = 32;
-constexpr size_t kSHA1_Hash_Length = 20;
-constexpr size_t kSubjectKeyIdentifierLength = kSHA1_Hash_Length;
-constexpr size_t kAuthorityKeyIdentifierLength = kSHA1_Hash_Length;
-constexpr size_t kMaxCertificateSerialNumberLength = 20;
-constexpr size_t kMaxCertificateDistinguishedNameLength = 200;
-constexpr size_t kMaxCRLDistributionPointURLLength = 100;
+inline constexpr size_t kP256_FE_Length = 32;
+inline constexpr size_t kP256_ECDSA_Signature_Length_Raw = (2 * kP256_FE_Length);
+inline constexpr size_t kP256_Point_Length = (2 * kP256_FE_Length + 1);
+inline constexpr size_t kSHA256_Hash_Length = 32;
+inline constexpr size_t kSHA1_Hash_Length = 20;
+inline constexpr size_t kSubjectKeyIdentifierLength = kSHA1_Hash_Length;
+inline constexpr size_t kAuthorityKeyIdentifierLength = kSHA1_Hash_Length;
+inline constexpr size_t kMaxCertificateSerialNumberLength = 20;
+inline constexpr size_t kMaxCertificateDistinguishedNameLength = 200;
+inline constexpr size_t kMaxCRLDistributionPointURLLength = 100;
-constexpr const char * kValidCDPURIHttpPrefix = "http://";
-constexpr const char * kValidCDPURIHttpsPrefix = "https://";
+inline constexpr const char * kValidCDPURIHttpPrefix = "http://";
+inline constexpr const char * kValidCDPURIHttpsPrefix = "https://";
-constexpr size_t CHIP_CRYPTO_GROUP_SIZE_BYTES = kP256_FE_Length;
-constexpr size_t CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES = kP256_Point_Length;
+inline constexpr size_t CHIP_CRYPTO_GROUP_SIZE_BYTES = kP256_FE_Length;
+inline constexpr size_t CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES = kP256_Point_Length;
-constexpr size_t CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES = 16;
-constexpr size_t CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES = 16;
+inline constexpr size_t CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES = 16;
+inline constexpr size_t CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES = 16;
-constexpr size_t kMax_ECDH_Secret_Length = kP256_FE_Length;
-constexpr size_t kMax_ECDSA_Signature_Length = kP256_ECDSA_Signature_Length_Raw;
-constexpr size_t kMAX_FE_Length = kP256_FE_Length;
-constexpr size_t kMAX_Point_Length = kP256_Point_Length;
-constexpr size_t kMAX_Hash_Length = kSHA256_Hash_Length;
+inline constexpr size_t kMax_ECDH_Secret_Length = kP256_FE_Length;
+inline constexpr size_t kMax_ECDSA_Signature_Length = kP256_ECDSA_Signature_Length_Raw;
+inline constexpr size_t kMAX_FE_Length = kP256_FE_Length;
+inline constexpr size_t kMAX_Point_Length = kP256_Point_Length;
+inline constexpr size_t kMAX_Hash_Length = kSHA256_Hash_Length;
// Minimum required CSR length buffer length is relatively small since it's a single
// P256 key and no metadata/extensions are expected to be honored by the CA.
-constexpr size_t kMIN_CSR_Buffer_Size = 255;
+inline constexpr size_t kMIN_CSR_Buffer_Size = 255;
[[deprecated("This constant is no longer used by common code and should be replaced by kMIN_CSR_Buffer_Size. Checks that a CSR is "
"<= kMAX_CSR_Buffer_size must be updated. This remains to keep valid buffers working from previous public API "
"usage.")]] constexpr size_t kMAX_CSR_Buffer_Size = 255;
-constexpr size_t CHIP_CRYPTO_HASH_LEN_BYTES = kSHA256_Hash_Length;
+inline constexpr size_t CHIP_CRYPTO_HASH_LEN_BYTES = kSHA256_Hash_Length;
-constexpr size_t kSpake2p_Min_PBKDF_Salt_Length = 16;
-constexpr size_t kSpake2p_Max_PBKDF_Salt_Length = 32;
-constexpr uint32_t kSpake2p_Min_PBKDF_Iterations = 1000;
-constexpr uint32_t kSpake2p_Max_PBKDF_Iterations = 100000;
+inline constexpr size_t kSpake2p_Min_PBKDF_Salt_Length = 16;
+inline constexpr size_t kSpake2p_Max_PBKDF_Salt_Length = 32;
+inline constexpr uint32_t kSpake2p_Min_PBKDF_Iterations = 1000;
+inline constexpr uint32_t kSpake2p_Max_PBKDF_Iterations = 100000;
-constexpr size_t kP256_PrivateKey_Length = CHIP_CRYPTO_GROUP_SIZE_BYTES;
-constexpr size_t kP256_PublicKey_Length = CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES;
+inline constexpr size_t kP256_PrivateKey_Length = CHIP_CRYPTO_GROUP_SIZE_BYTES;
+inline constexpr size_t kP256_PublicKey_Length = CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES;
-constexpr size_t kAES_CCM128_Key_Length = 128u / 8u;
-constexpr size_t kAES_CCM128_Block_Length = kAES_CCM128_Key_Length;
-constexpr size_t kAES_CCM128_Nonce_Length = 13;
-constexpr size_t kAES_CCM128_Tag_Length = 16;
+inline constexpr size_t kAES_CCM128_Key_Length = 128u / 8u;
+inline constexpr size_t kAES_CCM128_Block_Length = kAES_CCM128_Key_Length;
+inline constexpr size_t kAES_CCM128_Nonce_Length = 13;
+inline constexpr size_t kAES_CCM128_Tag_Length = 16;
-constexpr size_t CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES = kAES_CCM128_Nonce_Length;
+inline constexpr size_t CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES = kAES_CCM128_Nonce_Length;
/* These sizes are hardcoded here to remove header dependency on underlying crypto library
* in a public interface file. The validity of these sizes is verified by static_assert in
* the implementation files.
*/
-constexpr size_t kMAX_Spake2p_Context_Size = 1024;
-constexpr size_t kMAX_P256Keypair_Context_Size = 512;
+inline constexpr size_t kMAX_Spake2p_Context_Size = 1024;
+inline constexpr size_t kMAX_P256Keypair_Context_Size = 512;
-constexpr size_t kEmitDerIntegerWithoutTagOverhead = 1; // 1 sign stuffer
-constexpr size_t kEmitDerIntegerOverhead = 3; // Tag + Length byte + 1 sign stuffer
+inline constexpr size_t kEmitDerIntegerWithoutTagOverhead = 1; // 1 sign stuffer
+inline constexpr size_t kEmitDerIntegerOverhead = 3; // Tag + Length byte + 1 sign stuffer
-constexpr size_t kMAX_Hash_SHA256_Context_Size = CHIP_CONFIG_SHA256_CONTEXT_SIZE;
+inline constexpr size_t kMAX_Hash_SHA256_Context_Size = CHIP_CONFIG_SHA256_CONTEXT_SIZE;
-constexpr size_t kSpake2p_WS_Length = kP256_FE_Length + 8;
-constexpr size_t kSpake2p_VerifierSerialized_Length = kP256_FE_Length + kP256_Point_Length;
+inline constexpr size_t kSpake2p_WS_Length = kP256_FE_Length + 8;
+inline constexpr size_t kSpake2p_VerifierSerialized_Length = kP256_FE_Length + kP256_Point_Length;
-constexpr char kVIDPrefixForCNEncoding[] = "Mvid:";
-constexpr char kPIDPrefixForCNEncoding[] = "Mpid:";
-constexpr size_t kVIDandPIDHexLength = sizeof(uint16_t) * 2;
-constexpr size_t kMax_CommonNameAttr_Length = 64;
+inline constexpr char kVIDPrefixForCNEncoding[] = "Mvid:";
+inline constexpr char kPIDPrefixForCNEncoding[] = "Mpid:";
+inline constexpr size_t kVIDandPIDHexLength = sizeof(uint16_t) * 2;
+inline constexpr size_t kMax_CommonNameAttr_Length = 64;
/*
* Overhead to encode a raw ECDSA signature in X9.62 format in ASN.1 DER
@@ -131,14 +131,14 @@
*
* There is 1 sequence of 2 integers. Overhead is SEQ_OVERHEAD + (2 * INT_OVERHEAD) = 3 + (2 * 3) = 9.
*/
-constexpr size_t kMax_ECDSA_X9Dot62_Asn1_Overhead = 9;
-constexpr size_t kMax_ECDSA_Signature_Length_Der = kMax_ECDSA_Signature_Length + kMax_ECDSA_X9Dot62_Asn1_Overhead;
+inline constexpr size_t kMax_ECDSA_X9Dot62_Asn1_Overhead = 9;
+inline constexpr size_t kMax_ECDSA_Signature_Length_Der = kMax_ECDSA_Signature_Length + kMax_ECDSA_X9Dot62_Asn1_Overhead;
static_assert(kMax_ECDH_Secret_Length >= kP256_FE_Length, "ECDH shared secret is too short for crypto suite");
static_assert(kMax_ECDSA_Signature_Length >= kP256_ECDSA_Signature_Length_Raw,
"ECDSA signature buffer length is too short for crypto suite");
-constexpr size_t kCompressedFabricIdentifierSize = 8;
+inline constexpr size_t kCompressedFabricIdentifierSize = 8;
/**
* Spake2+ parameters for P256
diff --git a/src/include/platform/CommissionableDataProvider.h b/src/include/platform/CommissionableDataProvider.h
index 6a51023..95fa3fa 100644
--- a/src/include/platform/CommissionableDataProvider.h
+++ b/src/include/platform/CommissionableDataProvider.h
@@ -22,10 +22,10 @@
namespace chip {
// The largest value of the 12-bit Payload discriminator
-constexpr uint16_t kMaxDiscriminatorValue = 0xFFF;
+inline constexpr uint16_t kMaxDiscriminatorValue = 0xFFF;
-constexpr uint32_t kMinSetupPasscode = 1;
-constexpr uint32_t kMaxSetupPasscode = 0x5F5E0FE;
+inline constexpr uint32_t kMinSetupPasscode = 1;
+inline constexpr uint32_t kMaxSetupPasscode = 0x5F5E0FE;
namespace DeviceLayer {
diff --git a/src/include/platform/DiagnosticDataProvider.h b/src/include/platform/DiagnosticDataProvider.h
index 04820d3..12eacf0 100644
--- a/src/include/platform/DiagnosticDataProvider.h
+++ b/src/include/platform/DiagnosticDataProvider.h
@@ -36,12 +36,12 @@
static constexpr size_t kMaxThreadNameLength = 8;
// 48-bit IEEE MAC Address or a 64-bit IEEE MAC Address (e.g. EUI-64).
-constexpr size_t kMaxHardwareAddrSize = 8;
+inline constexpr size_t kMaxHardwareAddrSize = 8;
-constexpr size_t kMaxIPv4AddrSize = 4;
-constexpr size_t kMaxIPv6AddrSize = 16;
-constexpr size_t kMaxIPv4AddrCount = 4;
-constexpr size_t kMaxIPv6AddrCount = 8;
+inline constexpr size_t kMaxIPv4AddrSize = 4;
+inline constexpr size_t kMaxIPv6AddrSize = 16;
+inline constexpr size_t kMaxIPv4AddrCount = 4;
+inline constexpr size_t kMaxIPv6AddrCount = 8;
using BootReasonType = app::Clusters::GeneralDiagnostics::BootReasonEnum;
diff --git a/src/include/platform/NetworkCommissioning.h b/src/include/platform/NetworkCommissioning.h
index 7a9cbc3..8ae56f3 100644
--- a/src/include/platform/NetworkCommissioning.h
+++ b/src/include/platform/NetworkCommissioning.h
@@ -47,7 +47,7 @@
*/
namespace NetworkCommissioning {
-constexpr size_t kMaxNetworkIDLen = 32;
+inline constexpr size_t kMaxNetworkIDLen = 32;
// TODO: This is exactly the same as the one in GroupDataProvider, this could be moved to src/lib/support
template <typename T>
diff --git a/src/include/platform/PersistedStorage.h b/src/include/platform/PersistedStorage.h
index 91a8eae..f6bebd2 100644
--- a/src/include/platform/PersistedStorage.h
+++ b/src/include/platform/PersistedStorage.h
@@ -57,7 +57,7 @@
} // namespace internal
-constexpr Key kEmptyKey = internal::EmptyKey<Key>::value;
+inline constexpr Key kEmptyKey = internal::EmptyKey<Key>::value;
/**
* @brief
diff --git a/src/include/platform/internal/DeviceNetworkInfo.h b/src/include/platform/internal/DeviceNetworkInfo.h
index 7e21891..62c8d72 100644
--- a/src/include/platform/internal/DeviceNetworkInfo.h
+++ b/src/include/platform/internal/DeviceNetworkInfo.h
@@ -30,9 +30,9 @@
* Constants for common network metadata entries
*/
// ---- WiFi-specific Limits ----
-constexpr size_t kMaxWiFiSSIDLength = 32;
-constexpr size_t kMaxWiFiKeyLength = 64;
-constexpr size_t kWiFiBSSIDLength = 6;
+inline constexpr size_t kMaxWiFiSSIDLength = 32;
+inline constexpr size_t kMaxWiFiKeyLength = 64;
+inline constexpr size_t kWiFiBSSIDLength = 6;
/**
* Ids for well-known network provision types.
diff --git a/src/lib/address_resolve/AddressResolve_DefaultImpl.h b/src/lib/address_resolve/AddressResolve_DefaultImpl.h
index ac6d7dd..5445b6d 100644
--- a/src/lib/address_resolve/AddressResolve_DefaultImpl.h
+++ b/src/lib/address_resolve/AddressResolve_DefaultImpl.h
@@ -26,7 +26,7 @@
namespace AddressResolve {
namespace Impl {
-constexpr uint8_t kNodeLookupResultsLen = CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS;
+inline constexpr uint8_t kNodeLookupResultsLen = CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS;
enum class NodeLookupResult
{
diff --git a/src/lib/core/DataModelTypes.h b/src/lib/core/DataModelTypes.h
index 5ae16fa..dfbc5ef 100644
--- a/src/lib/core/DataModelTypes.h
+++ b/src/lib/core/DataModelTypes.h
@@ -49,21 +49,21 @@
typedef uint32_t SubscriptionId;
typedef uint8_t SceneId;
-constexpr CompressedFabricId kUndefinedCompressedFabricId = 0ULL;
-constexpr FabricId kUndefinedFabricId = 0ULL;
+inline constexpr CompressedFabricId kUndefinedCompressedFabricId = 0ULL;
+inline constexpr FabricId kUndefinedFabricId = 0ULL;
-constexpr FabricIndex kUndefinedFabricIndex = 0;
-constexpr FabricIndex kMinValidFabricIndex = 1;
-constexpr FabricIndex kMaxValidFabricIndex = UINT8_MAX - 1;
+inline constexpr FabricIndex kUndefinedFabricIndex = 0;
+inline constexpr FabricIndex kMinValidFabricIndex = 1;
+inline constexpr FabricIndex kMaxValidFabricIndex = UINT8_MAX - 1;
-constexpr EndpointId kInvalidEndpointId = 0xFFFF;
-constexpr EndpointId kRootEndpointId = 0;
-constexpr ListIndex kInvalidListIndex = 0xFFFF; // List index is a uint16 thus 0xFFFF is a invalid list index.
-constexpr KeysetId kInvalidKeysetId = 0xFFFF;
+inline constexpr EndpointId kInvalidEndpointId = 0xFFFF;
+inline constexpr EndpointId kRootEndpointId = 0;
+inline constexpr ListIndex kInvalidListIndex = 0xFFFF; // List index is a uint16 thus 0xFFFF is a invalid list index.
+inline constexpr KeysetId kInvalidKeysetId = 0xFFFF;
// Invalid IC identifier is provisional. Value will most likely change when identifying token is defined
// https://github.com/project-chip/connectedhomeip/issues/24251
-constexpr uint64_t kInvalidIcId = 0;
+inline constexpr uint64_t kInvalidIcId = 0;
// These are MEIs, 0xFFFF is not a valid manufacturer code,
// thus 0xFFFF'FFFF is not a valid MEI.
diff --git a/src/lib/core/GroupId.h b/src/lib/core/GroupId.h
index c1168b1..598a02d 100644
--- a/src/lib/core/GroupId.h
+++ b/src/lib/core/GroupId.h
@@ -23,20 +23,20 @@
using GroupId = uint16_t;
-constexpr GroupId kUndefinedGroupId = 0;
+inline constexpr GroupId kUndefinedGroupId = 0;
-constexpr GroupId kMinUniversalGroupId = 0xFF00;
-constexpr GroupId kMaxUniversalGroupId = 0xFFFF;
+inline constexpr GroupId kMinUniversalGroupId = 0xFF00;
+inline constexpr GroupId kMaxUniversalGroupId = 0xFFFF;
-constexpr GroupId kMinApplicationGroupId = 0x0001;
-constexpr GroupId kMaxApplicationGroupId = 0xFEFF;
+inline constexpr GroupId kMinApplicationGroupId = 0x0001;
+inline constexpr GroupId kMaxApplicationGroupId = 0xFEFF;
-constexpr GroupId kAllNodes = 0xFFFF;
-constexpr GroupId kAllNonSleepy = 0xFFFE;
-constexpr GroupId kAllProxies = 0xFFFD;
+inline constexpr GroupId kAllNodes = 0xFFFF;
+inline constexpr GroupId kAllNonSleepy = 0xFFFE;
+inline constexpr GroupId kAllProxies = 0xFFFD;
-constexpr GroupId kMinUniversalGroupIdReserved = 0xFF00;
-constexpr GroupId kMaxUniversalGroupIdReserved = 0xFFFC;
+inline constexpr GroupId kMinUniversalGroupIdReserved = 0xFF00;
+inline constexpr GroupId kMaxUniversalGroupIdReserved = 0xFFFC;
constexpr bool IsOperationalGroupId(GroupId aGroupId)
{
diff --git a/src/lib/core/InPlace.h b/src/lib/core/InPlace.h
index 6ac2cb0..14ce577 100644
--- a/src/lib/core/InPlace.h
+++ b/src/lib/core/InPlace.h
@@ -31,7 +31,7 @@
{
explicit InPlaceType() = default;
};
-constexpr InPlaceType InPlace{};
+inline constexpr InPlaceType InPlace{};
template <class T>
struct InPlaceTemplateType
@@ -39,6 +39,6 @@
explicit InPlaceTemplateType() = default;
};
template <class T>
-constexpr InPlaceTemplateType<T> InPlaceTemplate{};
+inline constexpr InPlaceTemplateType<T> InPlaceTemplate{};
} // namespace chip
diff --git a/src/lib/core/NodeId.h b/src/lib/core/NodeId.h
index a16868c..7b518f0 100644
--- a/src/lib/core/NodeId.h
+++ b/src/lib/core/NodeId.h
@@ -28,35 +28,35 @@
// methods.
using NodeId = uint64_t;
-constexpr NodeId kUndefinedNodeId = 0ULL;
+inline constexpr NodeId kUndefinedNodeId = 0ULL;
// The range of possible NodeId values has some pieces carved out for special
// uses.
-constexpr NodeId kMinGroupNodeId = 0xFFFF'FFFF'FFFF'0000ULL;
+inline constexpr NodeId kMinGroupNodeId = 0xFFFF'FFFF'FFFF'0000ULL;
// The max group id is complicated, depending on how we want to count the
// various special group ids. Let's not define it for now, until we have use
// cases.
-constexpr NodeId kMaskGroupId = 0x0000'0000'0000'FFFFULL;
+inline constexpr NodeId kMaskGroupId = 0x0000'0000'0000'FFFFULL;
-constexpr NodeId kMinTemporaryLocalId = 0xFFFF'FFFE'0000'0000ULL;
+inline constexpr NodeId kMinTemporaryLocalId = 0xFFFF'FFFE'0000'0000ULL;
// We use the largest available temporary local id to represent
// kPlaceholderNodeId, so the range is narrowed compared to the spec.
-constexpr NodeId kMaxTemporaryLocalId = 0xFFFF'FFFE'FFFF'FFFEULL;
-constexpr NodeId kPlaceholderNodeId = 0xFFFF'FFFE'FFFF'FFFFULL;
+inline constexpr NodeId kMaxTemporaryLocalId = 0xFFFF'FFFE'FFFF'FFFEULL;
+inline constexpr NodeId kPlaceholderNodeId = 0xFFFF'FFFE'FFFF'FFFFULL;
-constexpr NodeId kMinCASEAuthTag = 0xFFFF'FFFD'0000'0000ULL;
-constexpr NodeId kMaxCASEAuthTag = 0xFFFF'FFFD'FFFF'FFFFULL;
-constexpr NodeId kMaskCASEAuthTag = 0x0000'0000'FFFF'FFFFULL;
+inline constexpr NodeId kMinCASEAuthTag = 0xFFFF'FFFD'0000'0000ULL;
+inline constexpr NodeId kMaxCASEAuthTag = 0xFFFF'FFFD'FFFF'FFFFULL;
+inline constexpr NodeId kMaskCASEAuthTag = 0x0000'0000'FFFF'FFFFULL;
-constexpr NodeId kMinPAKEKeyId = 0xFFFF'FFFB'0000'0000ULL;
-constexpr NodeId kMaxPAKEKeyId = 0xFFFF'FFFB'FFFF'FFFFULL;
-constexpr NodeId kMaskPAKEKeyId = 0x0000'0000'0000'FFFFULL;
-constexpr NodeId kMaskUnusedPAKEKeyId = 0x0000'0000'FFFF'0000ULL;
+inline constexpr NodeId kMinPAKEKeyId = 0xFFFF'FFFB'0000'0000ULL;
+inline constexpr NodeId kMaxPAKEKeyId = 0xFFFF'FFFB'FFFF'FFFFULL;
+inline constexpr NodeId kMaskPAKEKeyId = 0x0000'0000'0000'FFFFULL;
+inline constexpr NodeId kMaskUnusedPAKEKeyId = 0x0000'0000'FFFF'0000ULL;
// There are more reserved ranges here, not assigned to anything yet, going down
// all the way to 0xFFFF'FFF0'0000'0000ULL
-constexpr NodeId kMaxOperationalNodeId = 0xFFFF'FFEF'FFFF'FFFFULL;
+inline constexpr NodeId kMaxOperationalNodeId = 0xFFFF'FFEF'FFFF'FFFFULL;
constexpr bool IsOperationalNodeId(NodeId aNodeId)
{
diff --git a/src/lib/core/OTAImageHeader.h b/src/lib/core/OTAImageHeader.h
index 4d3eea4..f9fa886 100644
--- a/src/lib/core/OTAImageHeader.h
+++ b/src/lib/core/OTAImageHeader.h
@@ -26,7 +26,7 @@
namespace chip {
/// File signature (aka magic number) of a valid Matter OTA image
-constexpr uint32_t kOTAImageFileIdentifier = 0x1BEEF11E;
+inline constexpr uint32_t kOTAImageFileIdentifier = 0x1BEEF11E;
enum class OTAImageDigestType : uint8_t
{
diff --git a/src/lib/core/Optional.h b/src/lib/core/Optional.h
index 4edae30..3b673e3 100644
--- a/src/lib/core/Optional.h
+++ b/src/lib/core/Optional.h
@@ -35,7 +35,7 @@
{
explicit NullOptionalType() = default;
};
-constexpr NullOptionalType NullOptional{};
+inline constexpr NullOptionalType NullOptional{};
/**
* Pairs an object with a boolean value to determine if the object value
diff --git a/src/lib/core/PasscodeId.h b/src/lib/core/PasscodeId.h
index f49aa19..e132297 100644
--- a/src/lib/core/PasscodeId.h
+++ b/src/lib/core/PasscodeId.h
@@ -25,6 +25,6 @@
// methods.
using PasscodeId = uint16_t;
-constexpr PasscodeId kDefaultCommissioningPasscodeId = 0;
+inline constexpr PasscodeId kDefaultCommissioningPasscodeId = 0;
} // namespace chip
diff --git a/src/lib/dnssd/Constants.h b/src/lib/dnssd/Constants.h
index d180505..f34bdfa 100644
--- a/src/lib/dnssd/Constants.h
+++ b/src/lib/dnssd/Constants.h
@@ -29,18 +29,18 @@
* Matter DNS host settings
*/
-constexpr size_t kHostNameMaxLength = 16; // MAC or 802.15.4 Extended Address in hex
+inline constexpr size_t kHostNameMaxLength = 16; // MAC or 802.15.4 Extended Address in hex
/*
* Matter DNS service subtypes
*/
-constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S<dd>
-constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L<dddd>
-constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V<ddddd>
-constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T<dddddddddd>
-constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM
-constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits>
+inline constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S<dd>
+inline constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L<dddd>
+inline constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V<ddddd>
+inline constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T<dddddddddd>
+inline constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM
+inline constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits>
/*
* Matter operational node service settings
@@ -50,10 +50,10 @@
#define SUBTYPES (std::initializer_list<size_t>{ kSubTypeCompressedFabricIdMaxLength })
-constexpr size_t kInstanceNameMaxLength = 33; // <NodeId>-<FabricId> in hex (16 + 1 + 16)
-constexpr size_t kSubTypeMaxNumber = SUBTYPES.size();
-constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
-constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES);
+inline constexpr size_t kInstanceNameMaxLength = 33; // <NodeId>-<FabricId> in hex (16 + 1 + 16)
+inline constexpr size_t kSubTypeMaxNumber = SUBTYPES.size();
+inline constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
+inline constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES);
#undef SUBTYPES
@@ -69,10 +69,10 @@
(std::initializer_list<size_t>{ kSubTypeShortDiscriminatorMaxLength, kSubTypeLongDiscriminatorMaxLength, \
kSubTypeVendorIdMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength })
-constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex
-constexpr size_t kSubTypeMaxNumber = SUBTYPES.size();
-constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
-constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES);
+inline constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex
+inline constexpr size_t kSubTypeMaxNumber = SUBTYPES.size();
+inline constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
+inline constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES);
#undef SUBTYPES
@@ -84,10 +84,10 @@
namespace Common {
-constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commission::kInstanceNameMaxLength);
-constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commission::kSubTypeMaxNumber);
-constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commission::kSubTypeMaxLength);
-constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commission::kSubTypeTotalLength);
+inline constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commission::kInstanceNameMaxLength);
+inline constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commission::kSubTypeMaxNumber);
+inline constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commission::kSubTypeMaxLength);
+inline constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commission::kSubTypeTotalLength);
} // namespace Common
diff --git a/src/lib/dnssd/Resolver.h b/src/lib/dnssd/Resolver.h
index a903935..81c8e97 100644
--- a/src/lib/dnssd/Resolver.h
+++ b/src/lib/dnssd/Resolver.h
@@ -139,9 +139,9 @@
void Reset() { peerId = PeerId(); }
};
-constexpr size_t kMaxDeviceNameLen = 32;
-constexpr size_t kMaxRotatingIdLen = 50;
-constexpr size_t kMaxPairingInstructionLen = 128;
+inline constexpr size_t kMaxDeviceNameLen = 32;
+inline constexpr size_t kMaxRotatingIdLen = 50;
+inline constexpr size_t kMaxPairingInstructionLen = 128;
/// Data that is specific to commisionable/commissioning node discovery
struct CommissionNodeData
diff --git a/src/lib/dnssd/ServiceNaming.h b/src/lib/dnssd/ServiceNaming.h
index 10e5abb..5f4c2e6 100644
--- a/src/lib/dnssd/ServiceNaming.h
+++ b/src/lib/dnssd/ServiceNaming.h
@@ -28,13 +28,13 @@
namespace chip {
namespace Dnssd {
-constexpr char kSubtypeServiceNamePart[] = "_sub";
-constexpr char kCommissionableServiceName[] = "_matterc";
-constexpr char kOperationalServiceName[] = "_matter";
-constexpr char kCommissionerServiceName[] = "_matterd";
-constexpr char kOperationalProtocol[] = "_tcp";
-constexpr char kCommissionProtocol[] = "_udp";
-constexpr char kLocalDomain[] = "local";
+inline constexpr char kSubtypeServiceNamePart[] = "_sub";
+inline constexpr char kCommissionableServiceName[] = "_matterc";
+inline constexpr char kOperationalServiceName[] = "_matter";
+inline constexpr char kCommissionerServiceName[] = "_matterd";
+inline constexpr char kOperationalProtocol[] = "_tcp";
+inline constexpr char kCommissionProtocol[] = "_udp";
+inline constexpr char kLocalDomain[] = "local";
// each includes space for a null terminator, which becomes a . when the names are appended.
constexpr size_t kMaxCommissionableServiceNameSize =
diff --git a/src/lib/dnssd/minimal_mdns/core/Constants.h b/src/lib/dnssd/minimal_mdns/core/Constants.h
index 30f2d4b..bf2a309 100644
--- a/src/lib/dnssd/minimal_mdns/core/Constants.h
+++ b/src/lib/dnssd/minimal_mdns/core/Constants.h
@@ -44,10 +44,10 @@
};
/// Flag encoded in QCLASS requesting unicast answers
-constexpr uint16_t kQClassUnicastAnswerFlag = 0x8000;
+inline constexpr uint16_t kQClassUnicastAnswerFlag = 0x8000;
// Flag used to indicate receiver should flush cache rather than appending. Used for Response RR's.
// See https://datatracker.ietf.org/doc/html/rfc6762#section-10.2.
-constexpr uint16_t kQClassResponseFlushBit = 0x8000;
+inline constexpr uint16_t kQClassResponseFlushBit = 0x8000;
enum class QClass : uint16_t
{
diff --git a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h
index e82dc5e..f7b34f1 100644
--- a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h
+++ b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h
@@ -38,7 +38,7 @@
namespace Minimal {
namespace test {
-constexpr QNamePart kIgnoreQNameParts[] = { "IGNORE", "THIS" };
+inline constexpr QNamePart kIgnoreQNameParts[] = { "IGNORE", "THIS" };
namespace {
bool StringMatches(const BytesRange & br, const char * str)
{
diff --git a/src/lib/support/CommonPersistentData.h b/src/lib/support/CommonPersistentData.h
index df0acff..64056a6 100644
--- a/src/lib/support/CommonPersistentData.h
+++ b/src/lib/support/CommonPersistentData.h
@@ -27,7 +27,7 @@
namespace chip {
namespace CommonPersistentData {
-constexpr uint8_t kdefaultUndefinedEntry = 0;
+inline constexpr uint8_t kdefaultUndefinedEntry = 0;
/// @brief Generic class to implement storage of a list persistently
/// @tparam EntryType : Type of entry depends on the stored data
@@ -74,7 +74,7 @@
}
};
-constexpr size_t kPersistentFabricBufferMax = 32;
+inline constexpr size_t kPersistentFabricBufferMax = 32;
struct FabricList : StoredDataList<FabricIndex, kPersistentFabricBufferMax>
{
// Subclasses need to define UpdateKey to be whatever fabric list key they
diff --git a/src/lib/support/PrivateHeap.h b/src/lib/support/PrivateHeap.h
index 864497a..3333426 100644
--- a/src/lib/support/PrivateHeap.h
+++ b/src/lib/support/PrivateHeap.h
@@ -67,6 +67,6 @@
} // namespace internal
-constexpr size_t kPrivateHeapAllocationAlignment = std::alignment_of<max_align_t>::value;
+inline constexpr size_t kPrivateHeapAllocationAlignment = std::alignment_of<max_align_t>::value;
#endif // ifdef __cplusplus
diff --git a/src/lib/support/ThreadOperationalDataset.h b/src/lib/support/ThreadOperationalDataset.h
index 9fbfd1b..e4de3dd 100644
--- a/src/lib/support/ThreadOperationalDataset.h
+++ b/src/lib/support/ThreadOperationalDataset.h
@@ -29,16 +29,16 @@
class ThreadTLV;
-constexpr size_t kChannel_NotSpecified = UINT8_MAX;
-constexpr size_t kPANId_NotSpecified = UINT16_MAX;
+inline constexpr size_t kChannel_NotSpecified = UINT8_MAX;
+inline constexpr size_t kPANId_NotSpecified = UINT16_MAX;
-constexpr size_t kSizeOperationalDataset = 254;
+inline constexpr size_t kSizeOperationalDataset = 254;
-constexpr size_t kSizeNetworkName = 16;
-constexpr size_t kSizeExtendedPanId = 8;
-constexpr size_t kSizeMasterKey = 16;
-constexpr size_t kSizeMeshLocalPrefix = 8;
-constexpr size_t kSizePSKc = 16;
+inline constexpr size_t kSizeNetworkName = 16;
+inline constexpr size_t kSizeExtendedPanId = 8;
+inline constexpr size_t kSizeMasterKey = 16;
+inline constexpr size_t kSizeMeshLocalPrefix = 8;
+inline constexpr size_t kSizePSKc = 16;
/**
* This class provides methods to manipulate Thread operational dataset.
diff --git a/src/messaging/ReliableMessageProtocolConfig.h b/src/messaging/ReliableMessageProtocolConfig.h
index 6a570ba..bd0e421 100644
--- a/src/messaging/ReliableMessageProtocolConfig.h
+++ b/src/messaging/ReliableMessageProtocolConfig.h
@@ -167,7 +167,7 @@
#endif
#endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
-constexpr System::Clock::Milliseconds32 kDefaultActiveTime = System::Clock::Milliseconds16(4000);
+inline constexpr System::Clock::Milliseconds32 kDefaultActiveTime = System::Clock::Milliseconds16(4000);
/**
* @brief
diff --git a/src/messaging/tests/echo/common.h b/src/messaging/tests/echo/common.h
index 03d2431..8158884 100644
--- a/src/messaging/tests/echo/common.h
+++ b/src/messaging/tests/echo/common.h
@@ -31,9 +31,9 @@
#include <protocols/secure_channel/MessageCounterManager.h>
#include <transport/SessionManager.h>
-constexpr size_t kMaxTcpActiveConnectionCount = 4;
-constexpr size_t kMaxTcpPendingPackets = 4;
-constexpr size_t kNetworkSleepTimeMsecs = (100 * 1000);
+inline constexpr size_t kMaxTcpActiveConnectionCount = 4;
+inline constexpr size_t kMaxTcpPendingPackets = 4;
+inline constexpr size_t kNetworkSleepTimeMsecs = (100 * 1000);
extern chip::FabricTable gFabricTable;
extern chip::SessionManager gSessionManager;
diff --git a/src/platform/ASR/NetworkCommissioningDriver.h b/src/platform/ASR/NetworkCommissioningDriver.h
index 954f0c8..7fc9e0c 100644
--- a/src/platform/ASR/NetworkCommissioningDriver.h
+++ b/src/platform/ASR/NetworkCommissioningDriver.h
@@ -33,10 +33,10 @@
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
-constexpr uint8_t kWiFiMaxNetworks = 15;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kWiFiMaxNetworks = 15;
} // namespace
class ASRScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/Ameba/NetworkCommissioningDriver.h b/src/platform/Ameba/NetworkCommissioningDriver.h
index 3942b89..0525ac4 100644
--- a/src/platform/Ameba/NetworkCommissioningDriver.h
+++ b/src/platform/Ameba/NetworkCommissioningDriver.h
@@ -25,9 +25,9 @@
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
} // namespace
class AmebaScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/Beken/NetworkCommissioningDriver.h b/src/platform/Beken/NetworkCommissioningDriver.h
index 5f83d0d..860a165 100644
--- a/src/platform/Beken/NetworkCommissioningDriver.h
+++ b/src/platform/Beken/NetworkCommissioningDriver.h
@@ -26,9 +26,9 @@
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
} // namespace
class BKScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/ESP32/NetworkCommissioningDriver.h b/src/platform/ESP32/NetworkCommissioningDriver.h
index 7a26165..5a2ca8f 100644
--- a/src/platform/ESP32/NetworkCommissioningDriver.h
+++ b/src/platform/ESP32/NetworkCommissioningDriver.h
@@ -26,9 +26,9 @@
namespace DeviceLayer {
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 30;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 30;
} // namespace
BitFlags<WiFiSecurityBitmap> ConvertSecurityType(wifi_auth_mode_t authMode);
diff --git a/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h b/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h
index d7f5683..3bd1a02 100644
--- a/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h
+++ b/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h
@@ -26,10 +26,10 @@
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
-constexpr uint8_t kWiFiMaxNetworks = 15;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kWiFiMaxNetworks = 15;
} // namespace
class P6ScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/android/DiagnosticDataProviderImpl.h b/src/platform/android/DiagnosticDataProviderImpl.h
index 26903d5..7086b6c 100644
--- a/src/platform/android/DiagnosticDataProviderImpl.h
+++ b/src/platform/android/DiagnosticDataProviderImpl.h
@@ -26,9 +26,9 @@
#include <platform/DiagnosticDataProvider.h>
namespace {
-constexpr int offPremiseServicesReachableUnknown = 0;
-constexpr int offPremiseServicesReachableYes = 1;
-constexpr int offPremiseServicesReachableNo = 2;
+inline constexpr int offPremiseServicesReachableUnknown = 0;
+inline constexpr int offPremiseServicesReachableYes = 1;
+inline constexpr int offPremiseServicesReachableNo = 2;
} // namespace
namespace chip {
diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h
index 5ae1c9a..f6ebab8 100644
--- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h
+++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h
@@ -26,9 +26,9 @@
void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg);
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
} // namespace
class BLScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h
index 5c9e563..8e5557b 100644
--- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h
+++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h
@@ -27,9 +27,9 @@
void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg);
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
} // namespace
class BLScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/mbed/NetworkCommissioningDriver.h b/src/platform/mbed/NetworkCommissioningDriver.h
index 017f692..9e61d46 100644
--- a/src/platform/mbed/NetworkCommissioningDriver.h
+++ b/src/platform/mbed/NetworkCommissioningDriver.h
@@ -29,9 +29,9 @@
#include <netsocket/WiFiInterface.h>
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
} // namespace
class MbedScanResponseIterator : public Iterator<WiFiScanResponse>
diff --git a/src/platform/mt793x/NetworkCommissioningWiFiDriver.h b/src/platform/mt793x/NetworkCommissioningWiFiDriver.h
index ac81072..8582280 100644
--- a/src/platform/mt793x/NetworkCommissioningWiFiDriver.h
+++ b/src/platform/mt793x/NetworkCommissioningWiFiDriver.h
@@ -25,10 +25,10 @@
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
-constexpr uint8_t kMaxWiFiScanAPs = 30;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiScanAPs = 30;
} // namespace
template <typename T>
diff --git a/src/platform/nrfconnect/wifi/NrfWiFiDriver.h b/src/platform/nrfconnect/wifi/NrfWiFiDriver.h
index 7b57607..d1fc765 100644
--- a/src/platform/nrfconnect/wifi/NrfWiFiDriver.h
+++ b/src/platform/nrfconnect/wifi/NrfWiFiDriver.h
@@ -25,9 +25,9 @@
namespace DeviceLayer {
namespace NetworkCommissioning {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 35;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 35;
class NrfWiFiScanResponseIterator : public Iterator<WiFiScanResponse>
{
diff --git a/src/platform/nxp/k32w/common/OTATlvProcessor.h b/src/platform/nxp/k32w/common/OTATlvProcessor.h
index 400e23e..534da06 100644
--- a/src/platform/nxp/k32w/common/OTATlvProcessor.h
+++ b/src/platform/nxp/k32w/common/OTATlvProcessor.h
@@ -42,10 +42,10 @@
#define CHIP_OTA_PROCESSOR_START_IMAGE CHIP_ERROR_TLV_PROCESSOR(0x0D)
// Descriptor constants
-constexpr size_t kVersionStringSize = 64;
-constexpr size_t kBuildDateSize = 64;
+inline constexpr size_t kVersionStringSize = 64;
+inline constexpr size_t kBuildDateSize = 64;
-constexpr uint16_t requestedOtaMaxBlockSize = 1024;
+inline constexpr uint16_t requestedOtaMaxBlockSize = 1024;
/**
* Used alongside RegisterDescriptorCallback to register
diff --git a/src/platform/openiotsdk/KVPsaPsStore.h b/src/platform/openiotsdk/KVPsaPsStore.h
index 7e68bdb..acd3f69 100644
--- a/src/platform/openiotsdk/KVPsaPsStore.h
+++ b/src/platform/openiotsdk/KVPsaPsStore.h
@@ -44,7 +44,7 @@
// '01' = Matter region
// '02' = the sub region group base offset (Factory, Config, Counter or KVS)
// '14' = the id offset inside the group.
-constexpr Key kMatterPsaPaKeyRegion = 0x010000U;
+inline constexpr Key kMatterPsaPaKeyRegion = 0x010000U;
constexpr inline Key GetPsaPaKey(Key group, uint8_t id)
{
return kMatterPsaPaKeyRegion | (group) << 8 | id;
diff --git a/src/platform/silabs/NetworkCommissioningWiFiDriver.h b/src/platform/silabs/NetworkCommissioningWiFiDriver.h
index fd73568..55148e3 100644
--- a/src/platform/silabs/NetworkCommissioningWiFiDriver.h
+++ b/src/platform/silabs/NetworkCommissioningWiFiDriver.h
@@ -25,9 +25,9 @@
namespace NetworkCommissioning {
namespace {
-constexpr uint8_t kMaxWiFiNetworks = 1;
-constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
-constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
+inline constexpr uint8_t kMaxWiFiNetworks = 1;
+inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10;
+inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20;
} // namespace
template <typename T>
diff --git a/src/platform/silabs/SilabsConfig.h b/src/platform/silabs/SilabsConfig.h
index 391d6a7..d5742c7 100644
--- a/src/platform/silabs/SilabsConfig.h
+++ b/src/platform/silabs/SilabsConfig.h
@@ -62,11 +62,11 @@
// '08' = Matter nvm3 region
// '72' = the sub region group base offset (Factory, Config, Counter or KVS)
// '01' = the id offset inside the group.
-constexpr uint32_t kUserNvm3KeyDomainLoLimit = 0x000000U; // User Domain NVM3 Key Range lower limit
-constexpr uint32_t kUserNvm3KeyDomainHiLimit = 0x00FFFFU; // User Domain NVM3 Key Range Maximum limit
-constexpr uint32_t kMatterNvm3KeyDomain = 0x080000U;
-constexpr uint32_t kMatterNvm3KeyLoLimit = 0x087200U; // Do not modify without Silabs GSDK team approval
-constexpr uint32_t kMatterNvm3KeyHiLimit = 0x087FFFU; // Do not modify without Silabs GSDK team approval
+inline constexpr uint32_t kUserNvm3KeyDomainLoLimit = 0x000000U; // User Domain NVM3 Key Range lower limit
+inline constexpr uint32_t kUserNvm3KeyDomainHiLimit = 0x00FFFFU; // User Domain NVM3 Key Range Maximum limit
+inline constexpr uint32_t kMatterNvm3KeyDomain = 0x080000U;
+inline constexpr uint32_t kMatterNvm3KeyLoLimit = 0x087200U; // Do not modify without Silabs GSDK team approval
+inline constexpr uint32_t kMatterNvm3KeyHiLimit = 0x087FFFU; // Do not modify without Silabs GSDK team approval
constexpr inline uint32_t SilabsConfigKey(uint8_t keyBaseOffset, uint8_t id)
{
return kMatterNvm3KeyDomain | static_cast<uint32_t>(keyBaseOffset) << 8 | id;
diff --git a/src/platform/silabs/efr32/Efr32OpaqueKeypair.h b/src/platform/silabs/efr32/Efr32OpaqueKeypair.h
index 91dd43d..9b17d42 100644
--- a/src/platform/silabs/efr32/Efr32OpaqueKeypair.h
+++ b/src/platform/silabs/efr32/Efr32OpaqueKeypair.h
@@ -25,10 +25,10 @@
namespace Internal {
typedef uint16_t EFR32OpaqueKeyId;
-constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdUnknown = 0xFFFFU; // Do not modify, will impact existing deployments
-constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdVolatile = 0xFFFEU; // Do not modify, will impact existing deployments
-constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMin = 0x0U; // Do not modify, will impact existing deployments
-constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMax = 0x1FFU; // Do not decrease, will impact existing deployments
+inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdUnknown = 0xFFFFU; // Do not modify, will impact existing deployments
+inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdVolatile = 0xFFFEU; // Do not modify, will impact existing deployments
+inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMin = 0x0U; // Do not modify, will impact existing deployments
+inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMax = 0x1FFU; // Do not decrease, will impact existing deployments
enum class EFR32OpaqueKeyUsages : uint8_t
{
diff --git a/src/protocols/bdx/BdxMessages.h b/src/protocols/bdx/BdxMessages.h
index 72e1ad2..753520e 100644
--- a/src/protocols/bdx/BdxMessages.h
+++ b/src/protocols/bdx/BdxMessages.h
@@ -33,9 +33,9 @@
namespace chip {
namespace bdx {
-constexpr uint16_t kMaxFileDesignatorLen = 0xFF;
+inline constexpr uint16_t kMaxFileDesignatorLen = 0xFF;
-constexpr const char * kProtocolName = "BDX";
+inline constexpr const char * kProtocolName = "BDX";
enum class MessageType : uint8_t
{
diff --git a/src/protocols/bdx/BdxUri.h b/src/protocols/bdx/BdxUri.h
index 776ccff..8e07289 100644
--- a/src/protocols/bdx/BdxUri.h
+++ b/src/protocols/bdx/BdxUri.h
@@ -22,7 +22,7 @@
namespace chip {
namespace bdx {
-constexpr const char kScheme[] = "bdx://";
+inline constexpr const char kScheme[] = "bdx://";
/**
* Parses the URI into NodeId and File Designator
diff --git a/src/protocols/echo/Echo.h b/src/protocols/echo/Echo.h
index 510bad3..08690e2 100644
--- a/src/protocols/echo/Echo.h
+++ b/src/protocols/echo/Echo.h
@@ -38,7 +38,7 @@
namespace Protocols {
namespace Echo {
-constexpr const char * kProtocolName = "Echo";
+inline constexpr const char * kProtocolName = "Echo";
/**
* Echo Protocol Message Types
diff --git a/src/protocols/interaction_model/Constants.h b/src/protocols/interaction_model/Constants.h
index 7783951..d5b33e3 100644
--- a/src/protocols/interaction_model/Constants.h
+++ b/src/protocols/interaction_model/Constants.h
@@ -45,12 +45,12 @@
namespace Protocols {
namespace InteractionModel {
-constexpr const char * kProtocolName = "IM";
+inline constexpr const char * kProtocolName = "IM";
/**
* Version of the Interaction Model used by the node.
*/
-constexpr uint16_t kVersion = 0;
+inline constexpr uint16_t kVersion = 0;
/**
* Interaction Model Protocol Message Types
diff --git a/src/protocols/secure_channel/CASEDestinationId.h b/src/protocols/secure_channel/CASEDestinationId.h
index 1be4a7c..104d44a 100644
--- a/src/protocols/secure_channel/CASEDestinationId.h
+++ b/src/protocols/secure_channel/CASEDestinationId.h
@@ -28,8 +28,8 @@
namespace chip {
-constexpr uint16_t kSigmaParamRandomNumberSize = 32;
-constexpr uint16_t kIPKSize = Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES;
+inline constexpr uint16_t kSigmaParamRandomNumberSize = 32;
+inline constexpr uint16_t kIPKSize = Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES;
CHIP_ERROR GenerateCaseDestinationId(const ByteSpan & ipk, const ByteSpan & initiatorRandom, const ByteSpan & rootPubKey,
FabricId fabricId, NodeId nodeId, MutableByteSpan & outDestinationId);
diff --git a/src/protocols/secure_channel/Constants.h b/src/protocols/secure_channel/Constants.h
index 2e0b104..57465a4 100644
--- a/src/protocols/secure_channel/Constants.h
+++ b/src/protocols/secure_channel/Constants.h
@@ -43,7 +43,7 @@
namespace Protocols {
namespace SecureChannel {
-constexpr const char * kProtocolName = "SecureChannel";
+inline constexpr const char * kProtocolName = "SecureChannel";
/**
* SecureChannel Protocol Message Types
@@ -74,15 +74,15 @@
};
// Placeholder value for the ProtocolCode field when the GeneralCode is Success or Continue.
-constexpr uint16_t kProtocolCodeSuccess = 0x0000;
-constexpr uint16_t kProtocolCodeNoSharedRoot = 0x0001;
-constexpr uint16_t kProtocolCodeInvalidParam = 0x0002;
-constexpr uint16_t kProtocolCodeCloseSession = 0x0003;
-constexpr uint16_t kProtocolCodeBusy = 0x0004;
-constexpr uint16_t kProtocolCodeSessionNotFound = 0x0005;
+inline constexpr uint16_t kProtocolCodeSuccess = 0x0000;
+inline constexpr uint16_t kProtocolCodeNoSharedRoot = 0x0001;
+inline constexpr uint16_t kProtocolCodeInvalidParam = 0x0002;
+inline constexpr uint16_t kProtocolCodeCloseSession = 0x0003;
+inline constexpr uint16_t kProtocolCodeBusy = 0x0004;
+inline constexpr uint16_t kProtocolCodeSessionNotFound = 0x0005;
// Placeholder value for the ProtocolCode field when there is no additional protocol-specific code to provide more information.
-constexpr uint16_t kProtocolCodeGeneralFailure = 0xFFFF;
+inline constexpr uint16_t kProtocolCodeGeneralFailure = 0xFFFF;
/**
* Status Report - General Status Codes used to convey protocol-agnostic status info.
diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h
index 39508d8..02d8fa7 100644
--- a/src/protocols/secure_channel/PASESession.h
+++ b/src/protocols/secure_channel/PASESession.h
@@ -44,7 +44,7 @@
extern const char * kSpake2pI2RSessionInfo;
extern const char * kSpake2pR2ISessionInfo;
-constexpr uint16_t kPBKDFParamRandomNumberSize = 32;
+inline constexpr uint16_t kPBKDFParamRandomNumberSize = 32;
using namespace Crypto;
@@ -239,7 +239,7 @@
};
// The following constants are node IDs that test devices and test controllers use.
-constexpr chip::NodeId kTestControllerNodeId = 112233;
-constexpr chip::NodeId kTestDeviceNodeId = 12344321;
+inline constexpr chip::NodeId kTestControllerNodeId = 112233;
+inline constexpr chip::NodeId kTestDeviceNodeId = 12344321;
} // namespace chip
diff --git a/src/protocols/secure_channel/RendezvousParameters.h b/src/protocols/secure_channel/RendezvousParameters.h
index e563166..a82628a 100644
--- a/src/protocols/secure_channel/RendezvousParameters.h
+++ b/src/protocols/secure_channel/RendezvousParameters.h
@@ -33,7 +33,7 @@
const uint16_t kMaxRendezvousDiscriminatorValue = 0xFFF;
// The largest supported value for sleepy idle interval and sleepy active interval
-constexpr uint32_t kMaxSleepyInterval = 3600000;
+inline constexpr uint32_t kMaxSleepyInterval = 3600000;
class RendezvousParameters
{
diff --git a/src/protocols/user_directed_commissioning/UDCClients.h b/src/protocols/user_directed_commissioning/UDCClients.h
index 47833bc..2edcdf3 100644
--- a/src/protocols/user_directed_commissioning/UDCClients.h
+++ b/src/protocols/user_directed_commissioning/UDCClients.h
@@ -26,7 +26,7 @@
namespace UserDirectedCommissioning {
// UDC client state times out after 1 hour. This may need to be tweaked.
-constexpr const System::Clock::Timestamp kUDCClientTimeout = System::Clock::Milliseconds64(60 * 60 * 1000);
+inline constexpr const System::Clock::Timestamp kUDCClientTimeout = System::Clock::Milliseconds64(60 * 60 * 1000);
/**
* Handles a set of UDC Client Processing States.
diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h
index e21c933..8e22014 100644
--- a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h
+++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h
@@ -41,10 +41,10 @@
namespace Protocols {
namespace UserDirectedCommissioning {
-constexpr const char * kProtocolName = "UserDirectedCommissioning";
+inline constexpr const char * kProtocolName = "UserDirectedCommissioning";
// Cache contains 16 clients. This may need to be tweaked.
-constexpr uint8_t kMaxUDCClients = 16;
+inline constexpr uint8_t kMaxUDCClients = 16;
/**
* User Directed Commissioning Protocol Message Types
diff --git a/src/setup_payload/AdditionalDataPayload.h b/src/setup_payload/AdditionalDataPayload.h
index ede6235..78ba013 100644
--- a/src/setup_payload/AdditionalDataPayload.h
+++ b/src/setup_payload/AdditionalDataPayload.h
@@ -40,8 +40,8 @@
namespace chip {
namespace SetupPayloadData {
-constexpr uint8_t kRotatingDeviceIdLength = 18;
-constexpr uint8_t kRotatingDeviceIdTag = 0x00;
+inline constexpr uint8_t kRotatingDeviceIdLength = 18;
+inline constexpr uint8_t kRotatingDeviceIdTag = 0x00;
struct AdditionalDataPayload
{
diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h
index 4892e9e..0bb2169 100644
--- a/src/setup_payload/SetupPayload.h
+++ b/src/setup_payload/SetupPayload.h
@@ -68,14 +68,14 @@
const int kManualSetupProductIdCharLength = 5;
// Spec 5.1.4.2 CHIP-Common Reserved Tags
-constexpr uint8_t kSerialNumberTag = 0x00;
-constexpr uint8_t kPBKDFIterationsTag = 0x01;
-constexpr uint8_t kBPKFSaltTag = 0x02;
-constexpr uint8_t kNumberOFDevicesTag = 0x03;
-constexpr uint8_t kCommissioningTimeoutTag = 0x04;
+inline constexpr uint8_t kSerialNumberTag = 0x00;
+inline constexpr uint8_t kPBKDFIterationsTag = 0x01;
+inline constexpr uint8_t kBPKFSaltTag = 0x02;
+inline constexpr uint8_t kNumberOFDevicesTag = 0x03;
+inline constexpr uint8_t kCommissioningTimeoutTag = 0x04;
-constexpr uint32_t kSetupPINCodeMaximumValue = 99999998;
-constexpr uint32_t kSetupPINCodeUndefinedValue = 0;
+inline constexpr uint32_t kSetupPINCodeMaximumValue = 99999998;
+inline constexpr uint32_t kSetupPINCodeUndefinedValue = 0;
// clang-format off
const int kTotalPayloadDataSizeInBits =
diff --git a/src/setup_payload/tests/TestHelpers.h b/src/setup_payload/tests/TestHelpers.h
index dedd904..8e83b51 100644
--- a/src/setup_payload/tests/TestHelpers.h
+++ b/src/setup_payload/tests/TestHelpers.h
@@ -30,16 +30,16 @@
const uint16_t kSmallBufferSizeInBytes = 1;
const uint16_t kDefaultBufferSizeInBytes = 512;
-const uint8_t kOptionalDefaultStringTag = 0x82; // Vendor "test" tag
-constexpr char kOptionalDefaultStringValue[] = "myData";
+const uint8_t kOptionalDefaultStringTag = 0x82; // Vendor "test" tag
+inline constexpr char kOptionalDefaultStringValue[] = "myData";
const uint8_t kOptionalDefaultIntTag = 0x83; // Vendor "test" tag
const uint32_t kOptionalDefaultIntValue = 12;
-constexpr char kSerialNumberDefaultStringValue[] = "123456789";
-const uint32_t kSerialNumberDefaultUInt32Value = 123456789;
+inline constexpr char kSerialNumberDefaultStringValue[] = "123456789";
+const uint32_t kSerialNumberDefaultUInt32Value = 123456789;
-constexpr const char * kDefaultPayloadQRCode = "MT:M5L90MP500K64J00000";
+inline constexpr const char * kDefaultPayloadQRCode = "MT:M5L90MP500K64J00000";
inline SetupPayload GetDefaultPayload()
{
diff --git a/src/system/SocketEvents.h b/src/system/SocketEvents.h
index 508bbdc..390fe78 100644
--- a/src/system/SocketEvents.h
+++ b/src/system/SocketEvents.h
@@ -34,7 +34,7 @@
using SocketWatchToken = intptr_t;
using SocketWatchCallback = void (*)(SocketEvents events, intptr_t data);
-constexpr int kInvalidFd = -1;
+inline constexpr int kInvalidFd = -1;
} // namespace System
} // namespace chip
diff --git a/src/system/SystemClock.h b/src/system/SystemClock.h
index 566e23d..77196f9 100644
--- a/src/system/SystemClock.h
+++ b/src/system/SystemClock.h
@@ -68,7 +68,7 @@
using Seconds32 = std::chrono::duration<uint32_t>;
using Seconds16 = std::chrono::duration<uint16_t>;
-constexpr Seconds16 kZero{ 0 };
+inline constexpr Seconds16 kZero{ 0 };
namespace Literals {
diff --git a/src/transport/SecureSessionTable.h b/src/transport/SecureSessionTable.h
index c84fc94..aff58c4 100644
--- a/src/transport/SecureSessionTable.h
+++ b/src/transport/SecureSessionTable.h
@@ -26,8 +26,8 @@
namespace chip {
namespace Transport {
-constexpr uint16_t kMaxSessionID = UINT16_MAX;
-constexpr uint16_t kUnsecuredSessionId = 0;
+inline constexpr uint16_t kMaxSessionID = UINT16_MAX;
+inline constexpr uint16_t kUnsecuredSessionId = 0;
/**
* Handles a set of sessions.
diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h
index e383c39..5f2e6f7 100644
--- a/src/transport/SessionManager.h
+++ b/src/transport/SessionManager.h
@@ -528,7 +528,7 @@
/**
* Maximum size of a message footer, in bytes.
*/
-constexpr uint16_t kMaxFooterSize = kMaxTagLen;
+inline constexpr uint16_t kMaxFooterSize = kMaxTagLen;
/**
* Allocates a packet buffer with space for message headers and footers.
diff --git a/src/transport/TraceMessage.h b/src/transport/TraceMessage.h
index bf6cbae..d2be947 100644
--- a/src/transport/TraceMessage.h
+++ b/src/transport/TraceMessage.h
@@ -75,9 +75,9 @@
namespace chip {
namespace trace {
-constexpr const char * kTraceMessageEvent = "SecureMsg";
-constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent";
-constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived";
+inline constexpr const char * kTraceMessageEvent = "SecureMsg";
+inline constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent";
+inline constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived";
struct TraceSecureMessageSentData
{