diff --git a/examples/light-switch-app/silabs/src/ZclCallbacks.cpp b/examples/light-switch-app/silabs/src/ZclCallbacks.cpp index 52542ca88fb390..13375537556067 100644 --- a/examples/light-switch-app/silabs/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/silabs/src/ZclCallbacks.cpp @@ -33,8 +33,8 @@ using namespace ::chip::app::Clusters; void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) { - ClusterId clusterId = attributePath.mClusterId; - AttributeId attributeId = attributePath.mAttributeId; + ClusterId clusterId = attributePath.mClusterId; + [[maybe_unused]] AttributeId attributeId = attributePath.mAttributeId; ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); if (clusterId == OnOffSwitchConfiguration::Id) diff --git a/examples/lock-app/silabs/src/ZclCallbacks.cpp b/examples/lock-app/silabs/src/ZclCallbacks.cpp index 1c0c1efab19dde..2aa0e9d0f6cef2 100644 --- a/examples/lock-app/silabs/src/ZclCallbacks.cpp +++ b/examples/lock-app/silabs/src/ZclCallbacks.cpp @@ -48,7 +48,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & if (clusterId == DoorLock::Id && attributeId == DoorLock::Attributes::LockState::Id) { - DoorLock::DlLockState lockState = *(reinterpret_cast(value)); + [[maybe_unused]] DoorLock::DlLockState lockState = *(reinterpret_cast(value)); ChipLogProgress(Zcl, "Door lock cluster: " ChipLogFormatMEI " state %d", ChipLogValueMEI(clusterId), to_underlying(lockState)); #ifdef DIC_ENABLE diff --git a/src/app/icd/server/tests/TestICDManager.cpp b/src/app/icd/server/tests/TestICDManager.cpp index 366bcb5c9280ad..6cba8c308b4e06 100644 --- a/src/app/icd/server/tests/TestICDManager.cpp +++ b/src/app/icd/server/tests/TestICDManager.cpp @@ -163,7 +163,7 @@ class TestICDManager : public ::testing::Test ASSERT_NE(pMessagingContext, nullptr); } - ASSERT_EQ(pMessagingContext->SetUpTestSuite(), CHIP_NO_ERROR); + pMessagingContext->SetUpTestSuite(); ASSERT_EQ(chip::DeviceLayer::PlatformMgr().InitChipStack(), CHIP_NO_ERROR); DeviceLayer::SetSystemLayerForTesting(&(pMessagingContext->GetSystemLayer())); @@ -198,7 +198,7 @@ class TestICDManager : public ::testing::Test // Performs setup for each individual test in the test suite void SetUp() override { - EXPECT_EQ(pMessagingContext->SetUp(), CHIP_NO_ERROR); + pMessagingContext->SetUp(); mICDStateObserver.ResetAll(); mICDManager.RegisterObserver(&mICDStateObserver); diff --git a/src/app/tests/AppTestContext.cpp b/src/app/tests/AppTestContext.cpp index 6f22097d7d11e8..eca7a2db76c83b 100644 --- a/src/app/tests/AppTestContext.cpp +++ b/src/app/tests/AppTestContext.cpp @@ -38,15 +38,13 @@ chip::Access::AccessControl gPermissiveAccessControl; namespace chip { namespace Test { -CHIP_ERROR AppContext::SetUpTestSuite() +void AppContext::SetUpTestSuite() { CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = LoopbackMessagingContext::SetUpTestSuite()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "SetUpTestSuite lo messaging context failed: %" CHIP_ERROR_FORMAT, err.Format())); - VerifyOrExit((err = chip::DeviceLayer::PlatformMgr().InitChipStack()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init CHIP stack failed: %" CHIP_ERROR_FORMAT, err.Format())); -exit: - return err; + LoopbackMessagingContext::SetUpTestSuite(); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = chip::DeviceLayer::PlatformMgr().InitChipStack()) == CHIP_NO_ERROR, AppServer, + "Init CHIP stack failed: %" CHIP_ERROR_FORMAT, err.Format()); } void AppContext::TearDownTestSuite() @@ -55,20 +53,19 @@ void AppContext::TearDownTestSuite() LoopbackMessagingContext::TearDownTestSuite(); } -CHIP_ERROR AppContext::SetUp() +void AppContext::SetUp() { CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = LoopbackMessagingContext::SetUp()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "SetUp lo messaging context failed: %" CHIP_ERROR_FORMAT, err.Format())); - VerifyOrExit((err = app::InteractionModelEngine::GetInstance()->Init( - &GetExchangeManager(), &GetFabricTable(), app::reporting::GetDefaultReportScheduler())) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init InteractionModelEngine failed: %" CHIP_ERROR_FORMAT, err.Format())); + LoopbackMessagingContext::SetUp(); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = app::InteractionModelEngine::GetInstance()->Init(&GetExchangeManager(), &GetFabricTable(), + app::reporting::GetDefaultReportScheduler())) == + CHIP_NO_ERROR, + AppServer, "Init InteractionModelEngine failed: %" CHIP_ERROR_FORMAT, err.Format()); Access::SetAccessControl(gPermissiveAccessControl); - VerifyOrExit((err = Access::GetAccessControl().Init(chip::Access::Examples::GetPermissiveAccessControlDelegate(), - gDeviceTypeResolver)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init AccessControl failed: %" CHIP_ERROR_FORMAT, err.Format())); -exit: - return err; + VerifyOrDieWithMsg((err = Access::GetAccessControl().Init(chip::Access::Examples::GetPermissiveAccessControlDelegate(), + gDeviceTypeResolver)) == CHIP_NO_ERROR, + AppServer, "Init AccessControl failed: %" CHIP_ERROR_FORMAT, err.Format()); } void AppContext::TearDown() diff --git a/src/app/tests/AppTestContext.h b/src/app/tests/AppTestContext.h index 40605f237db7ab..b9945fecd3a90a 100644 --- a/src/app/tests/AppTestContext.h +++ b/src/app/tests/AppTestContext.h @@ -28,11 +28,11 @@ class AppContext : public LoopbackMessagingContext { public: // Performs shared setup for all tests in the test suite - CHIP_ERROR SetUpTestSuite() override; + void SetUpTestSuite() override; // Performs shared teardown for all tests in the test suite void TearDownTestSuite() override; // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override; + void SetUp() override; // Performs teardown for each individual test in the test suite void TearDown() override; }; diff --git a/src/app/tests/TestAclAttribute.cpp b/src/app/tests/TestAclAttribute.cpp index da11c40a28dedf..c1bfd8acf68a73 100644 --- a/src/app/tests/TestAclAttribute.cpp +++ b/src/app/tests/TestAclAttribute.cpp @@ -81,12 +81,11 @@ class TestAccessContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); Access::GetAccessControl().Finish(); Access::GetAccessControl().Init(GetTestAccessControlDelegate(), gDeviceTypeResolver); - return CHIP_NO_ERROR; } }; diff --git a/src/app/tests/TestAclEvent.cpp b/src/app/tests/TestAclEvent.cpp index fda4a69217ccd6..f7c85e0bccaed8 100644 --- a/src/app/tests/TestAclEvent.cpp +++ b/src/app/tests/TestAclEvent.cpp @@ -86,7 +86,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -94,19 +94,17 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); Access::GetAccessControl().Finish(); Access::GetAccessControl().Init(GetTestAccessControlDelegate(), gDeviceTypeResolver); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/app/tests/TestEventLogging.cpp b/src/app/tests/TestEventLogging.cpp index baf43d6b398707..41ae31bd4295ff 100644 --- a/src/app/tests/TestEventLogging.cpp +++ b/src/app/tests/TestEventLogging.cpp @@ -64,7 +64,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -72,16 +72,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/app/tests/TestEventLoggingNoUTCTime.cpp b/src/app/tests/TestEventLoggingNoUTCTime.cpp index 8360f9a0813e98..77a8463a5f9718 100644 --- a/src/app/tests/TestEventLoggingNoUTCTime.cpp +++ b/src/app/tests/TestEventLoggingNoUTCTime.cpp @@ -84,11 +84,10 @@ class TestContext : public chip::Test::AppContext { public: // Performs shared setup for all tests in the test suite - CHIP_ERROR SetUpTestSuite() override + void SetUpTestSuite() override { - ReturnErrorOnFailure(chip::Test::AppContext::SetUpTestSuite()); + chip::Test::AppContext::SetUpTestSuite(); mClock.Emplace(chip::System::SystemClock()); - return CHIP_NO_ERROR; } // Performs shared teardown for all tests in the test suite @@ -99,7 +98,7 @@ class TestContext : public chip::Test::AppContext } // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -107,16 +106,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/app/tests/TestEventOverflow.cpp b/src/app/tests/TestEventOverflow.cpp index 3edc62a0445ca1..a328bec9783ef2 100644 --- a/src/app/tests/TestEventOverflow.cpp +++ b/src/app/tests/TestEventOverflow.cpp @@ -56,7 +56,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -64,16 +64,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/app/tests/TestFabricScopedEventLogging.cpp b/src/app/tests/TestFabricScopedEventLogging.cpp index d016ad5183e1c0..082aca0a2ecb7d 100644 --- a/src/app/tests/TestFabricScopedEventLogging.cpp +++ b/src/app/tests/TestFabricScopedEventLogging.cpp @@ -64,7 +64,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -72,16 +72,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 8173761b6ca83a..7e18cca7883c8f 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -79,9 +79,9 @@ class TestContext : public chip::Test::AppContext { public: // Performs shared setup for all tests in the test suite - CHIP_ERROR SetUpTestSuite() override + void SetUpTestSuite() override { - ReturnErrorOnFailure(chip::Test::AppContext::SetUpTestSuite()); + chip::Test::AppContext::SetUpTestSuite(); gRealClock = &chip::System::SystemClock(); chip::System::Clock::Internal::SetSystemClockForTesting(&gMockClock); @@ -94,8 +94,6 @@ class TestContext : public chip::Test::AppContext { gReportScheduler = chip::app::reporting::GetDefaultReportScheduler(); } - - return CHIP_NO_ERROR; } static int nlTestSetUpTestSuite_Sync(void * context) @@ -112,7 +110,7 @@ class TestContext : public chip::Test::AppContext } // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -120,16 +118,12 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: change to ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDie(mEventCounter.Init(0) == CHIP_NO_ERROR); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index ce8c49176fabdf..16647ca523829e 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -55,22 +55,21 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); gTestStorage.ClearStorage(); gGroupsProvider.SetStorageDelegate(&gTestStorage); gGroupsProvider.SetSessionKeystore(&gSessionKeystore); - ReturnErrorOnFailure(gGroupsProvider.Init()); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDie(gGroupsProvider.Init() == CHIP_NO_ERROR); chip::Credentials::SetGroupDataProvider(&gGroupsProvider); uint8_t buf[sizeof(chip::CompressedFabricId)]; chip::MutableByteSpan span(buf); - ReturnErrorOnFailure(GetBobFabric()->GetCompressedFabricIdBytes(span)); - ReturnErrorOnFailure(chip::GroupTesting::InitData(&gGroupsProvider, GetBobFabricIndex(), span)); - - return CHIP_NO_ERROR; + VerifyOrDie(GetBobFabric()->GetCompressedFabricIdBytes(span) == CHIP_NO_ERROR); + VerifyOrDie(chip::GroupTesting::InitData(&gGroupsProvider, GetBobFabricIndex(), span) == CHIP_NO_ERROR); } // Performs teardown for each individual test in the test suite diff --git a/src/controller/tests/TestEventCaching.cpp b/src/controller/tests/TestEventCaching.cpp index dab191cd69ae65..f69f5614592db7 100644 --- a/src/controller/tests/TestEventCaching.cpp +++ b/src/controller/tests/TestEventCaching.cpp @@ -56,7 +56,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -64,16 +64,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/controller/tests/TestEventChunking.cpp b/src/controller/tests/TestEventChunking.cpp index 0555e3ef94560b..fb2b068fcbc0a0 100644 --- a/src/controller/tests/TestEventChunking.cpp +++ b/src/controller/tests/TestEventChunking.cpp @@ -60,7 +60,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -68,16 +68,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/controller/tests/TestEventNumberCaching.cpp b/src/controller/tests/TestEventNumberCaching.cpp index a0d93290253117..01526388f4e459 100644 --- a/src/controller/tests/TestEventNumberCaching.cpp +++ b/src/controller/tests/TestEventNumberCaching.cpp @@ -53,7 +53,7 @@ class TestContext : public chip::Test::AppContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { const chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, @@ -61,16 +61,14 @@ class TestContext : public chip::Test::AppContext { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; - ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); + chip::Test::AppContext::SetUp(); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format())); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = mEventCounter.Init(0)) == CHIP_NO_ERROR, AppServer, + "Init EventCounter failed: %" CHIP_ERROR_FORMAT, err.Format()); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - - exit: - return err; } // Performs teardown for each individual test in the test suite diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h index b584e30738740c..598bbf00f5e690 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h @@ -192,6 +192,17 @@ MTR_TESTABLE /// is lost. - (instancetype)initWithContext:(ContextType)context; +/// Creates a work queue with the given context object and a queue width. +/// +/// The queue will call readyHandler on up to "width" number of work items +/// concurrently. Once "width" number of work items have started, no other +/// work items will get a readyHandler call until one of the running work items +/// has called its completion block with MTRAsyncWorkComplete. +/// +/// This allows the a MTRAsyncWorkQueue object to manage a pool of +/// resources that can be use concurrently at any given time. +- (instancetype)initWithContext:(ContextType)context width:(NSUInteger)width; + /// Enqueues the specified work item, making it eligible for execution. /// /// Once a work item is enqueued, ownership of it passes to the queue and diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm index eff85b1b0cb503..53a719502306bd 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm @@ -197,7 +197,8 @@ @implementation MTRAsyncWorkQueue { os_unfair_lock _lock; __weak id _context; NSMutableArray * _items; - NSInteger _runningWorkItemCount; + NSUInteger _runningWorkItemCount; + NSUInteger _width; } // A helper struct that facilitates access to _context while @@ -216,11 +217,17 @@ @implementation MTRAsyncWorkQueue { }; - (instancetype)initWithContext:(id)context +{ + return [self initWithContext:context width:1]; +} + +- (instancetype)initWithContext:(id)context width:(NSUInteger)width { NSParameterAssert(context); if (self = [super init]) { _context = context; _items = [NSMutableArray array]; + _width = width; } return self; } @@ -286,35 +293,84 @@ - (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem { os_unfair_lock_assert_owner(&_lock); - MTRAsyncWorkItem * runningWorkItem = (_runningWorkItemCount) ? _items.firstObject : nil; - if (workItem != runningWorkItem) { + BOOL foundWorkItem = NO; + NSUInteger indexOfWorkItem = 0; + for (NSUInteger i = 0; i < _width; i++) { + if (_items[i] == workItem) { + foundWorkItem = YES; + indexOfWorkItem = i; + break; + } + } + if (!foundWorkItem) { NSAssert(NO, @"work item to post-process is not running"); return; } + // already part of the running work items allowed by width - retry directly if (retry) { MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> retry needed for work item [%llu]", context.description, workItem.uniqueID); - } else { - [workItem markComplete]; - [_items removeObjectAtIndex:0]; - MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> completed work item [%llu]", context.description, _items.count, workItem.uniqueID); + [self _callWorkItem:workItem withContext:context]; + return; } - // when "concurrency width" is implemented this will be decremented instead - _runningWorkItemCount = 0; + [workItem markComplete]; + [_items removeObjectAtIndex:indexOfWorkItem]; + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> completed work item [%llu]", context.description, _items.count, workItem.uniqueID); + + // sanity check running work item count is positive + if (_runningWorkItemCount == 0) { + NSAssert(NO, @"running work item count should be positive"); + return; + } + + _runningWorkItemCount--; [self _callNextReadyWorkItemWithContext:context]; } +- (void)_callWorkItem:(MTRAsyncWorkItem *)workItem withContext:(ContextSnapshot const &)context +{ + os_unfair_lock_assert_owner(&_lock); + + mtr_weakify(self); + [workItem callReadyHandlerWithContext:context.reference completion:^(MTRAsyncWorkOutcome outcome) { + mtr_strongify(self); + BOOL handled = NO; + if (self) { + ContextSnapshot context(self); // re-acquire a new snapshot + std::lock_guard lock(self->_lock); + if (!workItem.isComplete) { + [self _postProcessWorkItem:workItem context:context retry:(outcome == MTRAsyncWorkNeedsRetry)]; + handled = YES; + } + } + return handled; + }]; +} + - (void)_callNextReadyWorkItemWithContext:(ContextSnapshot const &)context { os_unfair_lock_assert_owner(&_lock); - // when "concurrency width" is implemented this will be checked against the width - if (_runningWorkItemCount) { - return; // can't run next work item until the current one is done + // sanity check not running more than allowed + if (_runningWorkItemCount > _width) { + NSAssert(NO, @"running work item count larger than the maximum width"); + return; } - if (!_items.count) { + // sanity check consistent counts + if (_items.count < _runningWorkItemCount) { + NSAssert(NO, @"work item count is less than running work item count"); + return; + } + + // can't run more work items if already running at max concurrent width + if (_runningWorkItemCount == _width) { + return; + } + + // no more items to run + if (_items.count == _runningWorkItemCount) { return; // nothing to run } @@ -324,16 +380,16 @@ - (void)_callNextReadyWorkItemWithContext:(ContextSnapshot const &)context return; } - // when "concurrency width" is implemented this will be incremented instead - _runningWorkItemCount = 1; - - MTRAsyncWorkItem * workItem = _items.firstObject; + NSUInteger nextWorkItemToRunIndex = _runningWorkItemCount; + MTRAsyncWorkItem * workItem = _items[nextWorkItemToRunIndex]; + _runningWorkItemCount++; - // Check if batching is possible or needed. Only ask work item to batch once for simplicity + // Check if batching is possible or needed. auto batchingHandler = workItem.batchingHandler; - if (batchingHandler && workItem.retryCount == 0) { - while (_items.count >= 2) { - MTRAsyncWorkItem * nextWorkItem = _items[1]; + if (batchingHandler) { + while (_items.count > _runningWorkItemCount) { + NSUInteger firstNonRunningItemIndex = _runningWorkItemCount; + MTRAsyncWorkItem * nextWorkItem = _items[firstNonRunningItemIndex]; if (!nextWorkItem.batchingHandler || nextWorkItem.batchingID != workItem.batchingID) { goto done; // next item is not eligible to merge with this one } @@ -355,20 +411,7 @@ - (void)_callNextReadyWorkItemWithContext:(ContextSnapshot const &)context done:; } - mtr_weakify(self); - [workItem callReadyHandlerWithContext:context.reference completion:^(MTRAsyncWorkOutcome outcome) { - mtr_strongify(self); - BOOL handled = NO; - if (self) { - ContextSnapshot context(self); // re-acquire a new snapshot - std::lock_guard lock(self->_lock); - if (!workItem.isComplete) { - [self _postProcessWorkItem:workItem context:context retry:(outcome == MTRAsyncWorkNeedsRetry)]; - handled = YES; - } - } - return handled; - }]; + [self _callWorkItem:workItem withContext:context]; } - (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id)opaqueWorkItemData diff --git a/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm b/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm index 38c73b63a899d3..0d65304c843d04 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm @@ -23,10 +23,12 @@ #import #include +#include +#include @implementation MTRDeviceConnectivityMonitor { NSString * _instanceName; - DNSServiceRef _resolver; + std::vector _resolvers; NSMutableDictionary * _connections; MTRDeviceConnectivityMonitorHandler _monitorHandler; @@ -34,7 +36,10 @@ @implementation MTRDeviceConnectivityMonitor { } namespace { -constexpr char kLocalDot[] = "local."; +constexpr const char * kResolveDomains[] = { + "default.service.arpa.", // SRP + "local.", +}; constexpr char kOperationalType[] = "_matter._tcp"; constexpr int64_t kSharedConnectionLingerIntervalSeconds = (10); } @@ -68,8 +73,8 @@ - (instancetype)initWithCompressedFabricID:(NSNumber *)compressedFabricID nodeID - (void)dealloc { - if (_resolver) { - DNSServiceRefDeallocate(_resolver); + for (auto & resolver : _resolvers) { + DNSServiceRefDeallocate(resolver); } } @@ -188,32 +193,39 @@ - (void)startMonitoringWithHandler:(MTRDeviceConnectivityMonitorHandler)handler _handlerQueue = queue; // If there's already a resolver running, just return - if (_resolver) { + if (_resolvers.size() != 0) { MTR_LOG_INFO("%@ connectivity monitor already running", self); return; } MTR_LOG_INFO("%@ start connectivity monitoring for %@ (%lu monitoring objects)", self, _instanceName, static_cast(sConnectivityMonitorCount)); - _resolver = [MTRDeviceConnectivityMonitor _sharedResolverConnection]; - if (!_resolver) { + auto sharedConnection = [MTRDeviceConnectivityMonitor _sharedResolverConnection]; + if (!sharedConnection) { MTR_LOG_ERROR("%@ failed to get shared resolver connection", self); return; } - DNSServiceErrorType dnsError = DNSServiceResolve(&_resolver, - kDNSServiceFlagsShareConnection, - kDNSServiceInterfaceIndexAny, - _instanceName.UTF8String, - kOperationalType, - kLocalDot, - ResolveCallback, - (__bridge void *) self); - if (dnsError != kDNSServiceErr_NoError) { - MTR_LOG_ERROR("%@ failed to create resolver", self); - return; + + for (auto domain : kResolveDomains) { + DNSServiceRef resolver = sharedConnection; + DNSServiceErrorType dnsError = DNSServiceResolve(&resolver, + kDNSServiceFlagsShareConnection, + kDNSServiceInterfaceIndexAny, + _instanceName.UTF8String, + kOperationalType, + domain, + ResolveCallback, + (__bridge void *) self); + if (dnsError == kDNSServiceErr_NoError) { + _resolvers.emplace_back(std::move(resolver)); + } else { + MTR_LOG_ERROR("%@ failed to create resolver for \"%s\" domain: %" PRId32, self, StringOrNullMarker(domain), dnsError); + } } - sConnectivityMonitorCount++; + if (_resolvers.size() != 0) { + sConnectivityMonitorCount++; + } } - (void)_stopMonitoring @@ -227,9 +239,11 @@ - (void)_stopMonitoring _monitorHandler = nil; _handlerQueue = nil; - if (_resolver) { - DNSServiceRefDeallocate(_resolver); - _resolver = NULL; + if (_resolvers.size() != 0) { + for (auto & resolver : _resolvers) { + DNSServiceRefDeallocate(resolver); + } + _resolvers.clear(); // If no monitor objects exist, schedule to deallocate shared connection and queue sConnectivityMonitorCount--; diff --git a/src/darwin/Framework/CHIP/MTROperationalBrowser.mm b/src/darwin/Framework/CHIP/MTROperationalBrowser.mm index 689bab9376fd01..1ddc7868d88ecc 100644 --- a/src/darwin/Framework/CHIP/MTROperationalBrowser.mm +++ b/src/darwin/Framework/CHIP/MTROperationalBrowser.mm @@ -21,13 +21,16 @@ #include #include +#include #include #include namespace { -constexpr char kLocalDot[] = "local."; +constexpr const char * kBrowseDomains[] = { + "default.service.arpa.", // SRP + "local.", +}; constexpr char kOperationalType[] = "_matter._tcp"; -constexpr DNSServiceFlags kBrowseFlags = 0; } MTROperationalBrowser::MTROperationalBrowser(MTRDeviceControllerFactory * aFactory, dispatch_queue_t aQueue) @@ -43,23 +46,30 @@ { assertChipStackLockedByCurrentThread(); - ChipLogProgress(Controller, "Trying to start operational browse"); + ChipLogProgress(Controller, "Trying to start persistent operational browse"); - auto err - = DNSServiceBrowse(&mBrowseRef, kBrowseFlags, kDNSServiceInterfaceIndexAny, kOperationalType, kLocalDot, OnBrowse, this); + auto err = DNSServiceCreateConnection(&mBrowseRef); if (err != kDNSServiceErr_NoError) { - ChipLogError(Controller, "Failed to start operational browse: %" PRId32, err); + ChipLogError(Controller, "Failed to create connection for persistent operational browse: %" PRId32, err); return; } err = DNSServiceSetDispatchQueue(mBrowseRef, mQueue); if (err != kDNSServiceErr_NoError) { - ChipLogError(Controller, "Failed to set up dispatch queue properly"); + ChipLogError(Controller, "Failed to set up dispatch queue properly for persistent operational browse: %" PRId32, err); DNSServiceRefDeallocate(mBrowseRef); return; } mInitialized = true; + + for (auto domain : kBrowseDomains) { + auto browseRef = mBrowseRef; // Mandatory copy because of kDNSServiceFlagsShareConnection. + err = DNSServiceBrowse(&browseRef, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexAny, kOperationalType, domain, OnBrowse, this); + if (err != kDNSServiceErr_NoError) { + ChipLogError(Controller, "Failed to start persistent operational browse for \"%s\" domain: %" PRId32, StringOrNullMarker(domain), err); + } + } } void MTROperationalBrowser::OnBrowse(DNSServiceRef aServiceRef, DNSServiceFlags aFlags, uint32_t aInterfaceId, diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index e344f6df2151cd..e5cca2e7f47352 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -8515,6 +8515,8 @@ clusters: - ActivatedCarbonFilterMonitoring - AirQuality + - ElectricalEnergyMeasurement + - ElectricalPowerMeasurement - HEPAFilterMonitoring - SmokeCOAlarm # Concentration Measurement clusters @@ -8548,6 +8550,43 @@ - AttributeList - FeatureMap - ClusterRevision + ElectricalEnergyMeasurement: + - Accuracy + - CumulativeEnergyImported + - CumulativeEnergyExported + - PeriodicEnergyImported + - PeriodicEnergyExported + - CumulativeEnergyReset + - GeneratedCommandList + - AcceptedCommandList + - AttributeList + - FeatureMap + - ClusterRevision + ElectricalPowerMeasurement: + - PowerMode + - NumberOfMeasurementTypes + - Accuracy + - Ranges + - Voltage + - ActiveCurrent + - ReactiveCurrent + - ApparentCurrent + - ActivePower + - ReactivePower + - ApparentPower + - RMSVoltage + - RMSCurrent + - RMSPower + - Frequency + - HarmonicCurrents + - HarmonicPhases + - PowerFactor + - NeutralCurrent + - GeneratedCommandList + - AcceptedCommandList + - AttributeList + - FeatureMap + - ClusterRevision FanControl: - AirflowDirection HEPAFilterMonitoring: @@ -8769,6 +8808,15 @@ structs: ActivatedCarbonFilterMonitoring: - ReplacementProductStruct + ElectricalEnergyMeasurement: + - EnergyMeasurementStruct + - CumulativeEnergyResetStruct + - MeasurementAccuracyStruct + ElectricalPowerMeasurement: + - HarmonicMeasurementStruct + - MeasurementRangeStruct + - MeasurementAccuracyRangeStruct + - MeasurementAccuracyStruct HEPAFilterMonitoring: - ReplacementProductStruct struct fields: @@ -8776,11 +8824,74 @@ ReplacementProductStruct: - productIdentifierType - productIdentifierValue + ElectricalEnergyMeasurement: + EnergyMeasurementStruct: + - energy + - startTimestamp + - endTimestamp + - startSystime + - endSystime + CumulativeEnergyResetStruct: + - importedResetTimestamp + - exportedResetTimestamp + - importedResetSystime + - exportedResetSystime + MeasurementAccuracyStruct: + - measurementType + - measured + - minMeasuredValue + - maxMeasuredValue + - accuracyRanges + MeasurementAccuracyRangeStruct: + - rangeMin + - rangeMax + - percentMax + - percentMin + - percentTypical + - fixedMax + - fixedMin + - fixedTypical + ElectricalPowerMeasurement: + MeasurementRangeStruct: + - measurementType + - min + - max + - startTimestamp + - endTimestamp + - minTimestamp + - maxTimestamp + - startSystime + - endSystime + - minSystime + - maxSystime + HarmonicMeasurementStruct: + - order + - measurement + MeasurementAccuracyStruct: + - measurementType + - measured + - minMeasuredValue + - maxMeasuredValue + - accuracyRanges + MeasurementAccuracyRangeStruct: + - rangeMin + - rangeMax + - percentMax + - percentMin + - percentTypical + - fixedMax + - fixedMin + - fixedTypical HEPAFilterMonitoring: ReplacementProductStruct: - productIdentifierType - productIdentifierValue events: + ElectricalEnergyMeasurement: + - CumulativeEnergyMeasured + - PeriodicEnergyMeasured + ElectricalPowerMeasurement: + - MeasurementPeriodRanges SmokeCOAlarm: - SmokeAlarm - COAlarm @@ -8794,6 +8905,16 @@ - InterconnectCOAlarm - AllClear event fields: + ElectricalEnergyMeasurement: + CumulativeEnergyMeasured: + - energyImported + - energyExported + PeriodicEnergyMeasured: + - energyImported + - energyExported + ElectricalPowerMeasurement: + MeasurementPeriodRanges: + - ranges SmokeCOAlarm: SmokeAlarm: - alarmSeverityLevel @@ -8812,6 +8933,9 @@ - ProductIdentifierTypeEnum AirQuality: - AirQualityEnum + ElectricalPowerMeasurement: + - PowerModeEnum + - MeasurementTypeEnum FanControl: - StepDirectionEnum - AirflowDirectionEnum @@ -8890,6 +9014,28 @@ - Poor - VeryPoor - ExtremelyPoor + ElectricalPowerMeasurement: + PowerModeEnum: + - Unknown + - DC + - AC + MeasurementTypeEnum: + - Unspecified + - Voltage + - ActiveCurrent + - ReactiveCurrent + - ApparentCurrent + - ActivePower + - ReactivePower + - ApparentPower + - RMSVoltage + - RMSCurrent + - RMSPower + - Frequency + - PowerFactor + - NeutralCurrent + - ElectricalEnergy + FanControl: StepDirectionEnum: - Increase @@ -9146,6 +9292,10 @@ - Feature AirQuality: - Feature + ElectricalEnergyMeasurement: + - Feature + ElectricalPowerMeasurement: + - Feature HEPAFilterMonitoring: - Feature SmokeCOAlarm: @@ -9182,6 +9332,19 @@ - Moderate - VeryPoor - ExtremelyPoor + ElectricalEnergyMeasurement: + Feature: + - ImportedEnergy + - ExportedEnergy + - CumulativeEnergy + - PeriodicEnergy + ElectricalPowerMeasurement: + Feature: + - DirectCurrent + - AlternatingCurrent + - PolyphasePower + - Harmonics + - PowerQuality HEPAFilterMonitoring: Feature: - Condition @@ -9281,7 +9444,6 @@ - EnergyEVSEMode - DeviceEnergyManagementMode - Messages - - ElectricalPowerMeasurement - PowerTopology attributes: DoorLock: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index e1ef95eda2ba9b..4ba691a2f509ac 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7235,134 +7235,134 @@ MTR_PROVISIONALLY_AVAILABLE * * This cluster provides a mechanism for querying data about electrical power as measured by the server. */ -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRBaseClusterElectricalPowerMeasurement : MTRGenericBaseCluster -- (void)readAttributePowerModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributePowerModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributePowerModeWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePowerModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributePowerModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeNumberOfMeasurementTypesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeNumberOfMeasurementTypesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeNumberOfMeasurementTypesWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeNumberOfMeasurementTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeNumberOfMeasurementTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeAccuracyWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAccuracyWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAccuracyWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAccuracyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAccuracyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeRangesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeRangesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeRangesWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeRangesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeRangesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeVoltageWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeVoltageWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeVoltageWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeActiveCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeActiveCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeActiveCurrentWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeActiveCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeActiveCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeReactiveCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeReactiveCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeReactiveCurrentWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeReactiveCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeReactiveCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeApparentCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeApparentCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeApparentCurrentWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeApparentCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeApparentCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeActivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeActivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeActivePowerWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeActivePowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeActivePowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeReactivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeReactivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeReactivePowerWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeReactivePowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeReactivePowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeApparentPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeApparentPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeApparentPowerWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeApparentPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeApparentPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeRMSVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeRMSVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeRMSVoltageWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeRMSVoltageWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeRMSVoltageWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeRMSCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeRMSCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeRMSCurrentWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeRMSCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeRMSCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeRMSPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeRMSPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeRMSPowerWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeRMSPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeRMSPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeFrequencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeFrequencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeFrequencyWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeFrequencyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFrequencyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeHarmonicCurrentsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeHarmonicCurrentsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeHarmonicCurrentsWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeHarmonicCurrentsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeHarmonicCurrentsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeHarmonicPhasesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeHarmonicPhasesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeHarmonicPhasesWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeHarmonicPhasesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeHarmonicPhasesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributePowerFactorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributePowerFactorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributePowerFactorWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePowerFactorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributePowerFactorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeNeutralCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeNeutralCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeNeutralCurrentWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeNeutralCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeNeutralCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params @@ -7370,23 +7370,23 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -7401,7 +7401,7 @@ MTR_PROVISIONALLY_AVAILABLE */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + queue:(dispatch_queue_t)queue MTR_NEWLY_AVAILABLE; @end @@ -7410,56 +7410,56 @@ MTR_PROVISIONALLY_AVAILABLE * * This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRBaseClusterElectricalEnergyMeasurement : MTRGenericBaseCluster -- (void)readAttributeAccuracyWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAccuracyWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAccuracyWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAccuracyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAccuracyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeCumulativeEnergyImportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeCumulativeEnergyImportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeCumulativeEnergyImportedWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeCumulativeEnergyImportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCumulativeEnergyImportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeCumulativeEnergyExportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeCumulativeEnergyExportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeCumulativeEnergyExportedWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeCumulativeEnergyExportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCumulativeEnergyExportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributePeriodicEnergyImportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributePeriodicEnergyImportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributePeriodicEnergyImportedWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePeriodicEnergyImportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributePeriodicEnergyImportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributePeriodicEnergyExportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributePeriodicEnergyExportedWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributePeriodicEnergyExportedWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePeriodicEnergyExportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributePeriodicEnergyExportedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeCumulativeEnergyResetWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeCumulativeEnergyResetWithCompletion:(void (^)(MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeCumulativeEnergyResetWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeCumulativeEnergyResetWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCumulativeEnergyResetWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params @@ -7467,23 +7467,23 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -7498,7 +7498,7 @@ MTR_PROVISIONALLY_AVAILABLE */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + queue:(dispatch_queue_t)queue MTR_NEWLY_AVAILABLE; @end @@ -17739,36 +17739,36 @@ typedef NS_OPTIONS(uint16_t, MTRValveConfigurationAndControlValveFaultBitmap) { } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint16_t, MTRElectricalPowerMeasurementMeasurementType) { - MTRElectricalPowerMeasurementMeasurementTypeUnspecified MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRElectricalPowerMeasurementMeasurementTypeVoltage MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRElectricalPowerMeasurementMeasurementTypeActiveCurrent MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRElectricalPowerMeasurementMeasurementTypeReactiveCurrent MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRElectricalPowerMeasurementMeasurementTypeApparentCurrent MTR_PROVISIONALLY_AVAILABLE = 0x04, - MTRElectricalPowerMeasurementMeasurementTypeActivePower MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTRElectricalPowerMeasurementMeasurementTypeReactivePower MTR_PROVISIONALLY_AVAILABLE = 0x06, - MTRElectricalPowerMeasurementMeasurementTypeApparentPower MTR_PROVISIONALLY_AVAILABLE = 0x07, - MTRElectricalPowerMeasurementMeasurementTypeRMSVoltage MTR_PROVISIONALLY_AVAILABLE = 0x08, - MTRElectricalPowerMeasurementMeasurementTypeRMSCurrent MTR_PROVISIONALLY_AVAILABLE = 0x09, - MTRElectricalPowerMeasurementMeasurementTypeRMSPower MTR_PROVISIONALLY_AVAILABLE = 0x0A, - MTRElectricalPowerMeasurementMeasurementTypeFrequency MTR_PROVISIONALLY_AVAILABLE = 0x0B, - MTRElectricalPowerMeasurementMeasurementTypePowerFactor MTR_PROVISIONALLY_AVAILABLE = 0x0C, - MTRElectricalPowerMeasurementMeasurementTypeNeutralCurrent MTR_PROVISIONALLY_AVAILABLE = 0x0D, - MTRElectricalPowerMeasurementMeasurementTypeElectricalEnergy MTR_PROVISIONALLY_AVAILABLE = 0x0E, -} MTR_PROVISIONALLY_AVAILABLE; + MTRElectricalPowerMeasurementMeasurementTypeUnspecified MTR_NEWLY_AVAILABLE = 0x00, + MTRElectricalPowerMeasurementMeasurementTypeVoltage MTR_NEWLY_AVAILABLE = 0x01, + MTRElectricalPowerMeasurementMeasurementTypeActiveCurrent MTR_NEWLY_AVAILABLE = 0x02, + MTRElectricalPowerMeasurementMeasurementTypeReactiveCurrent MTR_NEWLY_AVAILABLE = 0x03, + MTRElectricalPowerMeasurementMeasurementTypeApparentCurrent MTR_NEWLY_AVAILABLE = 0x04, + MTRElectricalPowerMeasurementMeasurementTypeActivePower MTR_NEWLY_AVAILABLE = 0x05, + MTRElectricalPowerMeasurementMeasurementTypeReactivePower MTR_NEWLY_AVAILABLE = 0x06, + MTRElectricalPowerMeasurementMeasurementTypeApparentPower MTR_NEWLY_AVAILABLE = 0x07, + MTRElectricalPowerMeasurementMeasurementTypeRMSVoltage MTR_NEWLY_AVAILABLE = 0x08, + MTRElectricalPowerMeasurementMeasurementTypeRMSCurrent MTR_NEWLY_AVAILABLE = 0x09, + MTRElectricalPowerMeasurementMeasurementTypeRMSPower MTR_NEWLY_AVAILABLE = 0x0A, + MTRElectricalPowerMeasurementMeasurementTypeFrequency MTR_NEWLY_AVAILABLE = 0x0B, + MTRElectricalPowerMeasurementMeasurementTypePowerFactor MTR_NEWLY_AVAILABLE = 0x0C, + MTRElectricalPowerMeasurementMeasurementTypeNeutralCurrent MTR_NEWLY_AVAILABLE = 0x0D, + MTRElectricalPowerMeasurementMeasurementTypeElectricalEnergy MTR_NEWLY_AVAILABLE = 0x0E, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRElectricalPowerMeasurementPowerMode) { - MTRElectricalPowerMeasurementPowerModeUnknown MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRElectricalPowerMeasurementPowerModeDC MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRElectricalPowerMeasurementPowerModeAC MTR_PROVISIONALLY_AVAILABLE = 0x02, -} MTR_PROVISIONALLY_AVAILABLE; + MTRElectricalPowerMeasurementPowerModeUnknown MTR_NEWLY_AVAILABLE = 0x00, + MTRElectricalPowerMeasurementPowerModeDC MTR_NEWLY_AVAILABLE = 0x01, + MTRElectricalPowerMeasurementPowerModeAC MTR_NEWLY_AVAILABLE = 0x02, +} MTR_NEWLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTRElectricalPowerMeasurementFeature) { - MTRElectricalPowerMeasurementFeatureDirectCurrent MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRElectricalPowerMeasurementFeatureAlternatingCurrent MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRElectricalPowerMeasurementFeaturePolyphasePower MTR_PROVISIONALLY_AVAILABLE = 0x4, - MTRElectricalPowerMeasurementFeatureHarmonics MTR_PROVISIONALLY_AVAILABLE = 0x8, - MTRElectricalPowerMeasurementFeaturePowerQuality MTR_PROVISIONALLY_AVAILABLE = 0x10, -} MTR_PROVISIONALLY_AVAILABLE; + MTRElectricalPowerMeasurementFeatureDirectCurrent MTR_NEWLY_AVAILABLE = 0x1, + MTRElectricalPowerMeasurementFeatureAlternatingCurrent MTR_NEWLY_AVAILABLE = 0x2, + MTRElectricalPowerMeasurementFeaturePolyphasePower MTR_NEWLY_AVAILABLE = 0x4, + MTRElectricalPowerMeasurementFeatureHarmonics MTR_NEWLY_AVAILABLE = 0x8, + MTRElectricalPowerMeasurementFeaturePowerQuality MTR_NEWLY_AVAILABLE = 0x10, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint16_t, MTRElectricalEnergyMeasurementMeasurementType) { MTRElectricalEnergyMeasurementMeasurementTypeUnspecified MTR_PROVISIONALLY_AVAILABLE = 0x00, @@ -17789,11 +17789,11 @@ typedef NS_ENUM(uint16_t, MTRElectricalEnergyMeasurementMeasurementType) { } MTR_PROVISIONALLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTRElectricalEnergyMeasurementFeature) { - MTRElectricalEnergyMeasurementFeatureImportedEnergy MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRElectricalEnergyMeasurementFeatureExportedEnergy MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRElectricalEnergyMeasurementFeatureCumulativeEnergy MTR_PROVISIONALLY_AVAILABLE = 0x4, - MTRElectricalEnergyMeasurementFeaturePeriodicEnergy MTR_PROVISIONALLY_AVAILABLE = 0x8, -} MTR_PROVISIONALLY_AVAILABLE; + MTRElectricalEnergyMeasurementFeatureImportedEnergy MTR_NEWLY_AVAILABLE = 0x1, + MTRElectricalEnergyMeasurementFeatureExportedEnergy MTR_NEWLY_AVAILABLE = 0x2, + MTRElectricalEnergyMeasurementFeatureCumulativeEnergy MTR_NEWLY_AVAILABLE = 0x4, + MTRElectricalEnergyMeasurementFeaturePeriodicEnergy MTR_NEWLY_AVAILABLE = 0x8, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRDemandResponseLoadControlCriticalityLevel) { MTRDemandResponseLoadControlCriticalityLevelUnknown MTR_PROVISIONALLY_AVAILABLE = 0x00, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 566550b98af6b5..3d7ea40fef43ee 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -149,8 +149,8 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeBooleanStateConfigurationID MTR_PROVISIONALLY_AVAILABLE = 0x00000080, MTRClusterIDTypeValveConfigurationAndControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000081, - MTRClusterIDTypeElectricalPowerMeasurementID MTR_PROVISIONALLY_AVAILABLE = 0x00000090, - MTRClusterIDTypeElectricalEnergyMeasurementID MTR_PROVISIONALLY_AVAILABLE = 0x00000091, + MTRClusterIDTypeElectricalPowerMeasurementID MTR_NEWLY_AVAILABLE = 0x00000090, + MTRClusterIDTypeElectricalEnergyMeasurementID MTR_NEWLY_AVAILABLE = 0x00000091, MTRClusterIDTypeDemandResponseLoadControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000096, MTRClusterIDTypeMessagesID MTR_PROVISIONALLY_AVAILABLE = 0x00000097, MTRClusterIDTypeDeviceEnergyManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000098, @@ -2580,45 +2580,45 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, // Cluster ElectricalPowerMeasurement attributes - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributePowerModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeNumberOfMeasurementTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeAccuracyID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRangesID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeVoltageID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeActiveCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeReactiveCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeApparentCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeActivePowerID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeReactivePowerID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeApparentPowerID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRMSVoltageID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRMSCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRMSPowerID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeFrequencyID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeHarmonicCurrentsID MTR_PROVISIONALLY_AVAILABLE = 0x0000000F, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeHarmonicPhasesID MTR_PROVISIONALLY_AVAILABLE = 0x00000010, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributePowerFactorID MTR_PROVISIONALLY_AVAILABLE = 0x00000011, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeNeutralCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000012, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributePowerModeID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeNumberOfMeasurementTypesID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeAccuracyID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRangesID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeVoltageID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeActiveCurrentID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeReactiveCurrentID MTR_NEWLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeApparentCurrentID MTR_NEWLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeActivePowerID MTR_NEWLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeReactivePowerID MTR_NEWLY_AVAILABLE = 0x00000009, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeApparentPowerID MTR_NEWLY_AVAILABLE = 0x0000000A, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRMSVoltageID MTR_NEWLY_AVAILABLE = 0x0000000B, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRMSCurrentID MTR_NEWLY_AVAILABLE = 0x0000000C, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeRMSPowerID MTR_NEWLY_AVAILABLE = 0x0000000D, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeFrequencyID MTR_NEWLY_AVAILABLE = 0x0000000E, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeHarmonicCurrentsID MTR_NEWLY_AVAILABLE = 0x0000000F, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeHarmonicPhasesID MTR_NEWLY_AVAILABLE = 0x00000010, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributePowerFactorID MTR_NEWLY_AVAILABLE = 0x00000011, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeNeutralCurrentID MTR_NEWLY_AVAILABLE = 0x00000012, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, - MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeAttributeListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterElectricalPowerMeasurementAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, // Cluster ElectricalEnergyMeasurement attributes - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeAccuracyID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeCumulativeEnergyImportedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeCumulativeEnergyExportedID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributePeriodicEnergyImportedID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributePeriodicEnergyExportedID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeCumulativeEnergyResetID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeAccuracyID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeCumulativeEnergyImportedID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeCumulativeEnergyExportedID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributePeriodicEnergyImportedID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributePeriodicEnergyExportedID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeCumulativeEnergyResetID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, - MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeAttributeListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, // Cluster DemandResponseLoadControl attributes MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeLoadControlProgramsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, @@ -7199,11 +7199,11 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterValveConfigurationAndControlEventValveFaultID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, // Cluster ElectricalPowerMeasurement events - MTREventIDTypeClusterElectricalPowerMeasurementEventMeasurementPeriodRangesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterElectricalPowerMeasurementEventMeasurementPeriodRangesID MTR_NEWLY_AVAILABLE = 0x00000000, // Cluster ElectricalEnergyMeasurement events - MTREventIDTypeClusterElectricalEnergyMeasurementEventCumulativeEnergyMeasuredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, - MTREventIDTypeClusterElectricalEnergyMeasurementEventPeriodicEnergyMeasuredID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterElectricalEnergyMeasurementEventCumulativeEnergyMeasuredID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterElectricalEnergyMeasurementEventPeriodicEnergyMeasuredID MTR_NEWLY_AVAILABLE = 0x00000001, // Cluster DemandResponseLoadControl events MTREventIDTypeClusterDemandResponseLoadControlEventLoadControlEventStatusChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index d08b2fa36b5fb0..a3b2e0f35598ab 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3432,58 +3432,58 @@ MTR_PROVISIONALLY_AVAILABLE * Cluster Electrical Power Measurement * This cluster provides a mechanism for querying data about electrical power as measured by the server. */ -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRClusterElectricalPowerMeasurement : MTRGenericCluster -- (NSDictionary * _Nullable)readAttributePowerModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributePowerModeWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeNumberOfMeasurementTypesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeNumberOfMeasurementTypesWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeAccuracyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeAccuracyWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeRangesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeRangesWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeVoltageWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeVoltageWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeActiveCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeActiveCurrentWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeReactiveCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeReactiveCurrentWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeApparentCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeApparentCurrentWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeActivePowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeActivePowerWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeReactivePowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeReactivePowerWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeApparentPowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeApparentPowerWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeRMSVoltageWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeRMSVoltageWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeRMSCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeRMSCurrentWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeRMSPowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeRMSPowerWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeFrequencyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeFrequencyWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeHarmonicCurrentsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeHarmonicCurrentsWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeHarmonicPhasesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeHarmonicPhasesWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributePowerFactorWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributePowerFactorWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeNeutralCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeNeutralCurrentWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -3498,7 +3498,7 @@ MTR_PROVISIONALLY_AVAILABLE */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + queue:(dispatch_queue_t)queue MTR_NEWLY_AVAILABLE; @end @@ -3506,32 +3506,32 @@ MTR_PROVISIONALLY_AVAILABLE * Cluster Electrical Energy Measurement * This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRClusterElectricalEnergyMeasurement : MTRGenericCluster -- (NSDictionary * _Nullable)readAttributeAccuracyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeAccuracyWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeCumulativeEnergyImportedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeCumulativeEnergyImportedWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeCumulativeEnergyExportedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeCumulativeEnergyExportedWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributePeriodicEnergyImportedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributePeriodicEnergyImportedWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributePeriodicEnergyExportedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributePeriodicEnergyExportedWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeCumulativeEnergyResetWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeCumulativeEnergyResetWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -3546,7 +3546,7 @@ MTR_PROVISIONALLY_AVAILABLE */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + queue:(dispatch_queue_t)queue MTR_NEWLY_AVAILABLE; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 5dbf7101e1b480..a311e59ce46b16 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1071,101 +1071,101 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull valveFault MTR_PROVISIONALLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull rangeMin MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull rangeMax MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable percentMax MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable percentMin MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable percentTypical MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable fixedMax MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable fixedMin MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable fixedTypical MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull rangeMin MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull rangeMax MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable percentMax MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable percentMin MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable percentTypical MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable fixedMax MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable fixedMin MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable fixedTypical MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalPowerMeasurementClusterMeasurementAccuracyStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull measurementType MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull measured MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull minMeasuredValue MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull maxMeasuredValue MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSArray * _Nonnull accuracyRanges MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull measurementType MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull measured MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minMeasuredValue MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxMeasuredValue MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull accuracyRanges MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalPowerMeasurementClusterHarmonicMeasurementStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull order MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable measurement MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull order MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable measurement MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalPowerMeasurementClusterMeasurementRangeStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull measurementType MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull min MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull max MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable startTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable endTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable minTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable maxTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable startSystime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable endSystime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable minSystime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable maxSystime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull measurementType MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull min MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull max MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable startTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable endTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable startSystime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable endSystime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minSystime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxSystime MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalPowerMeasurementClusterMeasurementPeriodRangesEvent : NSObject -@property (nonatomic, copy) NSArray * _Nonnull ranges MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull ranges MTR_NEWLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE @interface MTRElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull rangeMin MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull rangeMax MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable percentMax MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable percentMin MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable percentTypical MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable fixedMax MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable fixedMin MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable fixedTypical MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull rangeMin MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull rangeMax MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable percentMax MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable percentMin MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable percentTypical MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable fixedMax MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable fixedMin MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable fixedTypical MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalEnergyMeasurementClusterMeasurementAccuracyStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull measurementType MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull measured MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull minMeasuredValue MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull maxMeasuredValue MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSArray * _Nonnull accuracyRanges MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull measurementType MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull measured MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minMeasuredValue MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxMeasuredValue MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull accuracyRanges MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nullable importedResetTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable exportedResetTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable importedResetSystime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable exportedResetSystime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable importedResetTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable exportedResetTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable importedResetSystime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable exportedResetSystime MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull energy MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable startTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable endTimestamp MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable startSystime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable endSystime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull energy MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable startTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable endTimestamp MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable startSystime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable endSystime MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalEnergyMeasurementClusterCumulativeEnergyMeasuredEvent : NSObject -@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyImported MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyExported MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyImported MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyExported MTR_NEWLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE +MTR_NEWLY_AVAILABLE @interface MTRElectricalEnergyMeasurementClusterPeriodicEnergyMeasuredEvent : NSObject -@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyImported MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyExported MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyImported MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyExported MTR_NEWLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m b/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m index 031c45380496f0..3207a851b2e9ac 100644 --- a/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m +++ b/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m @@ -491,4 +491,70 @@ - (void)testContextLoss [self waitForExpectationsWithTimeout:1 handler:nil]; } +- (void)testItemsConcurrently +{ + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null width:3]; + + XCTestExpectation * first3WorkItemsExecutedExpectation = [self expectationWithDescription:@"First 3 work items executed"]; + XCTestExpectation * first3WorkItemsSleptExpectation = [self expectationWithDescription:@"First 3 work items slept"]; + __block os_unfair_lock counterLock = OS_UNFAIR_LOCK_INIT; + __block int beforeSleepCounter = 0; + __block int afterSleepCounter = 0; + __auto_type sleep1ReadyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + os_unfair_lock_lock(&counterLock); + beforeSleepCounter++; + if (beforeSleepCounter == 3) { + [first3WorkItemsExecutedExpectation fulfill]; + } + os_unfair_lock_unlock(&counterLock); + sleep(1); + os_unfair_lock_lock(&counterLock); + afterSleepCounter++; + if (afterSleepCounter == 3) { + [first3WorkItemsSleptExpectation fulfill]; + } + os_unfair_lock_unlock(&counterLock); + completion(MTRAsyncWorkComplete); + }; + + MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + workItem1.readyHandler = sleep1ReadyHandler; + [workQueue enqueueWorkItem:workItem1 descriptionWithFormat:@"work item %d", 1]; + + MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + workItem2.readyHandler = sleep1ReadyHandler; + [workQueue enqueueWorkItem:workItem2 descriptionWithFormat:@"work item %d", 2]; + + MTRAsyncWorkItem * workItem3 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + workItem3.readyHandler = sleep1ReadyHandler; + [workQueue enqueueWorkItem:workItem3 descriptionWithFormat:@"work item %d", 3]; + + // This is the item after the first 3, and should only execute when one of them finished + XCTestExpectation * lastWorkItemWaitedExpectation = [self expectationWithDescription:@"Last work item waited properly"]; + MTRAsyncWorkItem * workItemLast = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + workItemLast.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + // expect this to have waited until at least one of the above items finished after sleep() and incremented counter + os_unfair_lock_lock(&counterLock); + XCTAssert(afterSleepCounter > 0); + [lastWorkItemWaitedExpectation fulfill]; + os_unfair_lock_unlock(&counterLock); + completion(MTRAsyncWorkComplete); + }; + [workQueue enqueueWorkItem:workItemLast description:@"last work item"]; + + [self waitForExpectations:@[ first3WorkItemsExecutedExpectation ] timeout:2]; + // the before-sleep counter should have reached 3 immediately as they all run concurrently. + os_unfair_lock_lock(&counterLock); + XCTAssertEqual(afterSleepCounter, 0); + os_unfair_lock_unlock(&counterLock); + + [self waitForExpectations:@[ lastWorkItemWaitedExpectation, first3WorkItemsSleptExpectation ] timeout:2]; + + // see that all 3 first items ran and slept + os_unfair_lock_lock(&counterLock); + XCTAssertEqual(beforeSleepCounter, 3); + XCTAssertEqual(afterSleepCounter, 3); + os_unfair_lock_unlock(&counterLock); +} + @end diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 237389a8cef01f..33d4a441bf2019 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -220,5 +220,6 @@ find_in_ancestors() { # generate and build set -x gn --root="$CHIP_ROOT" gen --check out --args="${args[*]}" - exec ninja -v -C out + ninja -C out -v + ninja -C out -t missingdeps } diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h index 0c00e327cc3d71..8fc6a6338d4140 100644 --- a/src/inet/TCPEndPoint.h +++ b/src/inet/TCPEndPoint.h @@ -38,10 +38,6 @@ namespace chip { -namespace Transport { -class TCPTest; -}; - namespace Inet { class TCPTest; @@ -529,7 +525,6 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis constexpr static size_t kMaxReceiveMessageSize = System::PacketBuffer::kMaxSizeWithoutReserve; protected: - friend class ::chip::Transport::TCPTest; friend class TCPTest; TCPEndPoint(EndPointManager & endPointManager) : diff --git a/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp b/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp index 80ae9dc1b2c55b..e248a647bf2f6d 100644 --- a/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp +++ b/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp @@ -286,34 +286,34 @@ TEST_F(TestResponseSender, AddManyQueryResponders) TEST_F(TestResponseSender, PtrSrvTxtMultipleRespondersToInstance) { - CommonTestElements common1("test1"); - CommonTestElements common2("test2"); + auto common1 = std::make_unique("test1"); + auto common2 = std::make_unique("test2"); // Just use the server from common1. - ResponseSender responseSender(&common1.server); + ResponseSender responseSender(&common1->server); - EXPECT_EQ(responseSender.AddQueryResponder(&common1.queryResponder), CHIP_NO_ERROR); - common1.queryResponder.AddResponder(&common1.ptrResponder).SetReportInServiceListing(true); - common1.queryResponder.AddResponder(&common1.srvResponder); - common1.queryResponder.AddResponder(&common1.txtResponder); + EXPECT_EQ(responseSender.AddQueryResponder(&common1->queryResponder), CHIP_NO_ERROR); + common1->queryResponder.AddResponder(&common1->ptrResponder).SetReportInServiceListing(true); + common1->queryResponder.AddResponder(&common1->srvResponder); + common1->queryResponder.AddResponder(&common1->txtResponder); - EXPECT_EQ(responseSender.AddQueryResponder(&common2.queryResponder), CHIP_NO_ERROR); - common2.queryResponder.AddResponder(&common2.ptrResponder).SetReportInServiceListing(true); - common2.queryResponder.AddResponder(&common2.srvResponder); - common2.queryResponder.AddResponder(&common2.txtResponder); + EXPECT_EQ(responseSender.AddQueryResponder(&common2->queryResponder), CHIP_NO_ERROR); + common2->queryResponder.AddResponder(&common2->ptrResponder).SetReportInServiceListing(true); + common2->queryResponder.AddResponder(&common2->srvResponder); + common2->queryResponder.AddResponder(&common2->txtResponder); // Build a query for the second instance. - common2.recordWriter.WriteQName(common2.instance); - QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common2.requestNameStart, common2.requestBytesRange); + common2->recordWriter.WriteQName(common2->instance); + QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common2->requestNameStart, common2->requestBytesRange); // Should get back answers from second instance only. - common1.server.AddExpectedRecord(&common2.srvRecord); - common1.server.AddExpectedRecord(&common2.txtRecord); + common1->server.AddExpectedRecord(&common2->srvRecord); + common1->server.AddExpectedRecord(&common2->txtRecord); - responseSender.Respond(1, queryData, &common1.packetInfo, ResponseConfiguration()); + responseSender.Respond(1, queryData, &common1->packetInfo, ResponseConfiguration()); - EXPECT_TRUE(common1.server.GetSendCalled()); - EXPECT_TRUE(common1.server.GetHeaderFound()); + EXPECT_TRUE(common1->server.GetSendCalled()); + EXPECT_TRUE(common1->server.GetHeaderFound()); } TEST_F(TestResponseSender, PtrSrvTxtMultipleRespondersToServiceListing) diff --git a/src/messaging/tests/MessagingContext.h b/src/messaging/tests/MessagingContext.h index 7ae452b9678a90..9ed82de60e4d5d 100644 --- a/src/messaging/tests/MessagingContext.h +++ b/src/messaging/tests/MessagingContext.h @@ -212,15 +212,14 @@ class LoopbackMessagingContext : public LoopbackTransportManager, public Messagi virtual ~LoopbackMessagingContext() {} // Performs shared setup for all tests in the test suite - virtual CHIP_ERROR SetUpTestSuite() + virtual void SetUpTestSuite() { CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = chip::Platform::MemoryInit()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init CHIP memory failed: %" CHIP_ERROR_FORMAT, err.Format())); - VerifyOrExit((err = LoopbackTransportManager::Init()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init LoopbackTransportManager failed: %" CHIP_ERROR_FORMAT, err.Format())); - exit: - return err; + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = chip::Platform::MemoryInit()) == CHIP_NO_ERROR, AppServer, + "Init CHIP memory failed: %" CHIP_ERROR_FORMAT, err.Format()); + VerifyOrDieWithMsg((err = LoopbackTransportManager::Init()) == CHIP_NO_ERROR, AppServer, + "Init LoopbackTransportManager failed: %" CHIP_ERROR_FORMAT, err.Format()); } // Performs shared teardown for all tests in the test suite @@ -231,13 +230,11 @@ class LoopbackMessagingContext : public LoopbackTransportManager, public Messagi } // Performs setup for each individual test in the test suite - virtual CHIP_ERROR SetUp() + virtual void SetUp() { CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = MessagingContext::Init(&GetTransportMgr(), &GetIOContext())) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init MessagingContext failed: %" CHIP_ERROR_FORMAT, err.Format())); - exit: - return err; + VerifyOrDieWithMsg((err = MessagingContext::Init(&GetTransportMgr(), &GetIOContext())) == CHIP_NO_ERROR, AppServer, + "Init MessagingContext failed: %" CHIP_ERROR_FORMAT, err.Format()); } // Performs teardown for each individual test in the test suite @@ -247,8 +244,8 @@ class LoopbackMessagingContext : public LoopbackTransportManager, public Messagi static int nlTestSetUpTestSuite(void * context) { - auto err = static_cast(context)->SetUpTestSuite(); - return err == CHIP_NO_ERROR ? SUCCESS : FAILURE; + static_cast(context)->SetUpTestSuite(); + return SUCCESS; } static int nlTestTearDownTestSuite(void * context) @@ -259,8 +256,8 @@ class LoopbackMessagingContext : public LoopbackTransportManager, public Messagi static int nlTestSetUp(void * context) { - auto err = static_cast(context)->SetUp(); - return err == CHIP_NO_ERROR ? SUCCESS : FAILURE; + static_cast(context)->SetUp(); + return SUCCESS; } static int nlTestTearDown(void * context) diff --git a/src/messaging/tests/TestAbortExchangesForFabric.cpp b/src/messaging/tests/TestAbortExchangesForFabric.cpp index 6dc5d8c2775cd3..5993a771e76bd4 100644 --- a/src/messaging/tests/TestAbortExchangesForFabric.cpp +++ b/src/messaging/tests/TestAbortExchangesForFabric.cpp @@ -51,13 +51,13 @@ using namespace chip::Protocols; struct TestContext : Test::LoopbackMessagingContext { - virtual CHIP_ERROR SetUp() + void SetUp() override { #if CHIP_CRYPTO_PSA - ReturnErrorOnFailure(psa_crypto_init() == PSA_SUCCESS ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDie(psa_crypto_init() == PSA_SUCCESS); #endif - ReturnErrorOnFailure(chip::Test::LoopbackMessagingContext::SetUp()); - return CHIP_NO_ERROR; + chip::Test::LoopbackMessagingContext::SetUp(); } }; diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index f85bebe455259e..cc4dbf10e5a4f4 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -55,13 +55,13 @@ struct TestContext : Test::LoopbackMessagingContext { // TODO Add TearDown function during changing test framework to Pigweed to make it more clear how does it work. // Currently, the TearDown function is from LoopbackMessagingContext - virtual CHIP_ERROR SetUp() + void SetUp() override { #if CHIP_CRYPTO_PSA - ReturnErrorOnFailure(psa_crypto_init() == PSA_SUCCESS ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDie(psa_crypto_init() == PSA_SUCCESS); #endif - ReturnErrorOnFailure(chip::Test::LoopbackMessagingContext::SetUp()); - return CHIP_NO_ERROR; + chip::Test::LoopbackMessagingContext::SetUp(); } }; diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index 4636193bb06378..dc70e013a55bc5 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -77,15 +77,15 @@ class TestContext : public chip::Test::LoopbackMessagingContext { public: // Performs setup for each individual test in the test suite - CHIP_ERROR SetUp() override + void SetUp() override { #if CHIP_CRYPTO_PSA - ReturnErrorOnFailure(psa_crypto_init() == PSA_SUCCESS ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDie(psa_crypto_init() == PSA_SUCCESS); #endif - ReturnErrorOnFailure(chip::Test::LoopbackMessagingContext::SetUp()); + chip::Test::LoopbackMessagingContext::SetUp(); GetSessionAliceToBob()->AsSecureSession()->SetRemoteSessionParameters(GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig())); GetSessionBobToAlice()->AsSecureSession()->SetRemoteSessionParameters(GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig())); - return CHIP_NO_ERROR; } }; diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 048b7e96af9025..84870e55362c41 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -418,7 +418,9 @@ if (chip_device_platform != "none") { source_set("platform_base") { public_deps = [ ":platform_config_header", + "${chip_root}/src/app/icd/server:icd-server-config", "${chip_root}/src/ble", + "${chip_root}/src/credentials:build_time_header", "${chip_root}/src/inet", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", @@ -507,10 +509,8 @@ if (chip_device_platform != "none") { public_deps = [ ":platform_base", - "${chip_root}/src/app:app_config", + "${chip_root}/src/app:app_config", # TODO: Move into platforms using it "${chip_root}/src/app/common:cluster-objects", - "${chip_root}/src/app/icd/server:icd-server-config", - "${chip_root}/src/credentials:build_time_header", "${chip_root}/src/crypto", "${chip_root}/src/lib/support", ] diff --git a/src/platform/Linux/DiagnosticDataProviderImpl.cpp b/src/platform/Linux/DiagnosticDataProviderImpl.cpp index cc57da65e2d036..5ee5558064afeb 100644 --- a/src/platform/Linux/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Linux/DiagnosticDataProviderImpl.cpp @@ -287,8 +287,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() // If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the // value of the CurrentHeapUsed. - // On Linux, the write operation is non-op since we always rely on the mallinfo system - // function to get the current heap memory. + // Get the current amount of heap memory, in bytes, that are being used by + // the current running program and reset the max heap high watermark to current heap amount. struct mallinfo mallocInfo = mallinfo(); maxHeapHighWatermark = mallocInfo.uordblks; diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index df4a2edf05ea29..1ef821f30c8b50 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -61,7 +61,7 @@ class TestContext : public Test::LoopbackMessagingContext { public: // Performs shared setup for all tests in the test suite - CHIP_ERROR SetUpTestSuite() override; + void SetUpTestSuite() override; // Performs shared teardown for all tests in the test suite void TearDownTestSuite() override; }; @@ -327,22 +327,20 @@ CHIP_ERROR InitCredentialSets() return CHIP_NO_ERROR; } -CHIP_ERROR TestContext::SetUpTestSuite() +void TestContext::SetUpTestSuite() { ConfigInitializeNodes(false); CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit((err = LoopbackMessagingContext::SetUpTestSuite()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "SetUpTestSuite lo messaging context failed: %" CHIP_ERROR_FORMAT, err.Format())); - VerifyOrExit((err = chip::DeviceLayer::PlatformMgr().InitChipStack()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "Init CHIP stack failed: %" CHIP_ERROR_FORMAT, err.Format())); - VerifyOrExit((err = InitFabricTable(gCommissionerFabrics, &gCommissionerStorageDelegate, /* opKeyStore = */ nullptr, - &gCommissionerOpCertStore)) == CHIP_NO_ERROR, - ChipLogError(AppServer, "InitFabricTable failed: %" CHIP_ERROR_FORMAT, err.Format())); - VerifyOrExit((err = InitCredentialSets()) == CHIP_NO_ERROR, - ChipLogError(AppServer, "InitCredentialSets failed: %" CHIP_ERROR_FORMAT, err.Format())); + LoopbackMessagingContext::SetUpTestSuite(); + // TODO: use ASSERT_EQ, once transition to pw_unit_test is complete + VerifyOrDieWithMsg((err = chip::DeviceLayer::PlatformMgr().InitChipStack()) == CHIP_NO_ERROR, AppServer, + "Init CHIP stack failed: %" CHIP_ERROR_FORMAT, err.Format()); + VerifyOrDieWithMsg((err = InitFabricTable(gCommissionerFabrics, &gCommissionerStorageDelegate, /* opKeyStore = */ nullptr, + &gCommissionerOpCertStore)) == CHIP_NO_ERROR, + AppServer, "InitFabricTable failed: %" CHIP_ERROR_FORMAT, err.Format()); + VerifyOrDieWithMsg((err = InitCredentialSets()) == CHIP_NO_ERROR, AppServer, "InitCredentialSets failed: %" CHIP_ERROR_FORMAT, + err.Format()); chip::DeviceLayer::SetSystemLayerForTesting(&GetSystemLayer()); -exit: - return err; } void TestContext::TearDownTestSuite() diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index 073a2afb6ae651..b25252f15b7385 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -89,10 +89,10 @@ class TestContext : public chip::Test::LoopbackMessagingContext { public: // Performs shared setup for all tests in the test suite - CHIP_ERROR SetUpTestSuite() override + void SetUpTestSuite() override { ConfigInitializeNodes(false); - return chip::Test::LoopbackMessagingContext::SetUpTestSuite(); + chip::Test::LoopbackMessagingContext::SetUpTestSuite(); } }; diff --git a/src/transport/raw/TCP.h b/src/transport/raw/TCP.h index bb4671215b96c8..783f3844d2d16d 100644 --- a/src/transport/raw/TCP.h +++ b/src/transport/raw/TCP.h @@ -41,6 +41,10 @@ namespace chip { namespace Transport { +// Forward declaration of friend class for test access. +template +class TCPBaseTestAccess; + /** Defines listening parameters for setting up a TCP transport */ class TcpListenParameters { @@ -200,7 +204,9 @@ class DLL_EXPORT TCPBase : public Base void CloseActiveConnections(); private: - friend class TCPTest; + // Allow tests to access private members. + template + friend class TCPBaseTestAccess; /** * Allocate an unused connection from the pool @@ -330,7 +336,6 @@ class TCP : public TCPBase ~TCP() override { mPendingPackets.ReleaseAll(); } private: - friend class TCPTest; ActiveTCPConnectionState mConnectionsBuffer[kActiveConnectionsSize]; PoolImpl mPendingPackets; }; diff --git a/src/transport/raw/tests/BUILD.gn b/src/transport/raw/tests/BUILD.gn index 973626af7f340b..a6bc6a5a017524 100644 --- a/src/transport/raw/tests/BUILD.gn +++ b/src/transport/raw/tests/BUILD.gn @@ -49,6 +49,8 @@ chip_test_suite("tests") { test_sources += [ "TestTCP.cpp" ] } + sources = [ "TCPBaseTestAccess.h" ] + public_deps = [ ":helpers", "${chip_root}/src/inet/tests:helpers", diff --git a/src/transport/raw/tests/TCPBaseTestAccess.h b/src/transport/raw/tests/TCPBaseTestAccess.h new file mode 100644 index 00000000000000..e89392f76c4daa --- /dev/null +++ b/src/transport/raw/tests/TCPBaseTestAccess.h @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#if INET_CONFIG_ENABLE_TCP_ENDPOINT +#include +#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT + +namespace chip { +namespace Transport { +/** + * @brief Class acts as an accessor to private members of the TCPBase class without needing to give + * friend access to each individual test. + */ +template +class TCPBaseTestAccess +{ +public: + using TCPImpl = Transport::TCP; + + static void * FindActiveConnection(TCPImpl & tcp, Transport::PeerAddress & peerAddress) + { + return tcp.FindActiveConnection(peerAddress); + } + static Inet::TCPEndPoint * GetEndpoint(void * state) { return static_cast(state)->mEndPoint; } + + static CHIP_ERROR ProcessReceivedBuffer(TCPImpl & tcp, Inet::TCPEndPoint * endPoint, const PeerAddress & peerAddress, + System::PacketBufferHandle && buffer) + { + return tcp.ProcessReceivedBuffer(endPoint, peerAddress, std::move(buffer)); + } +}; +} // namespace Transport +} // namespace chip diff --git a/src/transport/raw/tests/TestMessageHeader.cpp b/src/transport/raw/tests/TestMessageHeader.cpp index 436bb887f4616e..4c807afc5c3608 100644 --- a/src/transport/raw/tests/TestMessageHeader.cpp +++ b/src/transport/raw/tests/TestMessageHeader.cpp @@ -23,14 +23,14 @@ * */ +#include + #include #include #include #include #include -#include - namespace { using namespace chip; diff --git a/src/transport/raw/tests/TestPeerAddress.cpp b/src/transport/raw/tests/TestPeerAddress.cpp index 8d82e28ad58eb5..d96bc1990e0755 100644 --- a/src/transport/raw/tests/TestPeerAddress.cpp +++ b/src/transport/raw/tests/TestPeerAddress.cpp @@ -21,13 +21,13 @@ #include #include +#include + #include #include #include #include -#include - namespace { using namespace chip; diff --git a/src/transport/raw/tests/TestTCP.cpp b/src/transport/raw/tests/TestTCP.cpp index 6a60fb330c70f7..f5e343f1a2ea79 100644 --- a/src/transport/raw/tests/TestTCP.cpp +++ b/src/transport/raw/tests/TestTCP.cpp @@ -23,6 +23,13 @@ #include "NetworkTestHelpers.h" +#include +#include +#include +#include + +#include + #include #include #include @@ -34,15 +41,10 @@ #if INET_CONFIG_ENABLE_TCP_ENDPOINT #include #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT - -#include - -#include -#include -#include -#include +#include using namespace chip; +using namespace chip::Test; using namespace chip::Inet; namespace { @@ -54,14 +56,13 @@ uint16_t gChipTCPPort = static_cast(CHIP_PORT chip::Transport::AppTCPConnectionCallbackCtxt gAppTCPConnCbCtxt; chip::Transport::ActiveTCPConnectionState * gActiveTCPConnState = nullptr; -using TCPImpl = Transport::TCP; +using TCPImpl = Transport::TCP; +using TestAccess = Transport::TCPBaseTestAccess; constexpr NodeId kSourceNodeId = 123654; constexpr NodeId kDestinationNodeId = 111222333; constexpr uint32_t kMessageCounter = 18; -using TestContext = chip::Test::IOContext; - const char PAYLOAD[] = "Hello!"; class MockTransportMgrDelegate : public chip::TransportMgrDelegate @@ -69,7 +70,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate public: typedef int (*MessageReceivedCallback)(const uint8_t * message, size_t length, int count, void * data); - MockTransportMgrDelegate(TestContext * inContext) : mContext(inContext), mCallback(nullptr), mCallbackData(nullptr) {} + MockTransportMgrDelegate(IOContext * inContext) : mIOContext(inContext), mCallback(nullptr), mCallbackData(nullptr) {} ~MockTransportMgrDelegate() override {} void SetCallback(MessageReceivedCallback callback = nullptr, void * callback_data = nullptr) @@ -134,7 +135,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate void InitializeMessageTest(TCPImpl & tcp, const IPAddress & addr) { - CHIP_ERROR err = tcp.Init(Transport::TcpListenParameters(mContext->GetTCPEndPointManager()) + CHIP_ERROR err = tcp.Init(Transport::TcpListenParameters(mIOContext->GetTCPEndPointManager()) .SetAddressType(addr.Type()) .SetListenPort(gChipTCPPort)); @@ -155,7 +156,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate { ChipLogProgress(NotSpecified, "RETRYING tcp initialization"); chip::test_utils::SleepMillis(100); - err = tcp.Init(Transport::TcpListenParameters(mContext->GetTCPEndPointManager()) + err = tcp.Init(Transport::TcpListenParameters(mIOContext->GetTCPEndPointManager()) .SetAddressType(addr.Type()) .SetListenPort(gChipTCPPort)); } @@ -193,7 +194,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate err = tcp.SendMessage(Transport::PeerAddress::TCP(addr, gChipTCPPort), std::move(buffer)); EXPECT_EQ(err, CHIP_NO_ERROR); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mReceiveHandlerCallCount != 0; }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mReceiveHandlerCallCount != 0; }); EXPECT_EQ(mReceiveHandlerCallCount, 1); SetCallback(nullptr); @@ -205,7 +206,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate CHIP_ERROR err = tcp.TCPConnect(Transport::PeerAddress::TCP(addr, gChipTCPPort), &gAppTCPConnCbCtxt, &gActiveTCPConnState); EXPECT_EQ(err, CHIP_NO_ERROR); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return tcp.HasActiveConnections(); }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return tcp.HasActiveConnections(); }); EXPECT_EQ(tcp.HasActiveConnections(), true); } @@ -216,7 +217,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate CHIP_ERROR err = tcp.TCPConnect(Transport::PeerAddress::TCP(addr, gChipTCPPort), &gAppTCPConnCbCtxt, &gActiveTCPConnState); EXPECT_EQ(err, CHIP_NO_ERROR); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mHandleConnectionCompleteCalled; }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mHandleConnectionCompleteCalled; }); EXPECT_EQ(mHandleConnectionCompleteCalled, true); } @@ -227,11 +228,11 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate CHIP_ERROR err = tcp.TCPConnect(Transport::PeerAddress::TCP(addr, gChipTCPPort), &gAppTCPConnCbCtxt, &gActiveTCPConnState); EXPECT_EQ(err, CHIP_NO_ERROR); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mHandleConnectionCompleteCalled; }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mHandleConnectionCompleteCalled; }); EXPECT_EQ(mHandleConnectionCompleteCalled, true); tcp.TCPDisconnect(Transport::PeerAddress::TCP(addr, gChipTCPPort)); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); EXPECT_EQ(mHandleConnectionCloseCalled, true); } @@ -239,7 +240,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate { // Disconnect and wait for seeing peer close tcp.TCPDisconnect(conn, true); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); EXPECT_EQ(tcp.HasActiveConnections(), false); } @@ -247,7 +248,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate { // Disconnect and wait for seeing peer close tcp.TCPDisconnect(Transport::PeerAddress::TCP(addr, gChipTCPPort)); - mContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); EXPECT_EQ(tcp.HasActiveConnections(), false); } @@ -280,7 +281,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate bool mHandleConnectionCloseCalled = false; private: - TestContext * mContext; + IOContext * mIOContext; MessageReceivedCallback mCallback; void * mCallbackData; TransportMgrBase mTransportMgrBase; @@ -289,153 +290,6 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate OnTCPConnectionReceivedCallback mConnReceivedCb = nullptr; }; -class TestTCP : public ::testing::Test, public chip::Test::IOContext -{ -protected: - void SetUp() { ASSERT_EQ(Init(), CHIP_NO_ERROR); } - void TearDown() { Shutdown(); } - - /////////////////////////// Init test - void CheckSimpleInitTest(Inet::IPAddressType type) - { - TCPImpl tcp; - - CHIP_ERROR err = - tcp.Init(Transport::TcpListenParameters(GetTCPEndPointManager()).SetAddressType(type).SetListenPort(gChipTCPPort)); - - EXPECT_EQ(err, CHIP_NO_ERROR); - } - - /////////////////////////// Messaging test - void CheckMessageTest(const IPAddress & addr) - { - TCPImpl tcp; - - MockTransportMgrDelegate gMockTransportMgrDelegate(this); - gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); - gMockTransportMgrDelegate.SingleMessageTest(tcp, addr); - gMockTransportMgrDelegate.DisconnectTest(tcp, addr); - } - - void ConnectToSelfTest(const IPAddress & addr) - { - TCPImpl tcp; - - MockTransportMgrDelegate gMockTransportMgrDelegate(this); - gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); - gMockTransportMgrDelegate.ConnectTest(tcp, addr); - gMockTransportMgrDelegate.DisconnectTest(tcp, addr); - } - - void ConnectSendMessageThenCloseTest(const IPAddress & addr) - { - TCPImpl tcp; - - MockTransportMgrDelegate gMockTransportMgrDelegate(this); - gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); - gMockTransportMgrDelegate.ConnectTest(tcp, addr); - gMockTransportMgrDelegate.SingleMessageTest(tcp, addr); - gMockTransportMgrDelegate.DisconnectTest(tcp, addr); - } - - void HandleConnCompleteTest(const IPAddress & addr) - { - TCPImpl tcp; - - MockTransportMgrDelegate gMockTransportMgrDelegate(this); - gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); - gMockTransportMgrDelegate.HandleConnectCompleteCbCalledTest(tcp, addr); - gMockTransportMgrDelegate.DisconnectTest(tcp, addr); - } - - void HandleConnCloseTest(const IPAddress & addr) - { - TCPImpl tcp; - - MockTransportMgrDelegate gMockTransportMgrDelegate(this); - gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); - gMockTransportMgrDelegate.HandleConnectCloseCbCalledTest(tcp, addr); - gMockTransportMgrDelegate.DisconnectTest(tcp, addr); - } -}; - -#if INET_CONFIG_ENABLE_IPV4 -TEST_F(TestTCP, CheckSimpleInitTest4) -{ - CheckSimpleInitTest(IPAddressType::kIPv4); -} - -TEST_F(TestTCP, CheckMessageTest4) -{ - IPAddress addr; - IPAddress::FromString("127.0.0.1", addr); - CheckMessageTest(addr); -} -#endif - -TEST_F(TestTCP, CheckSimpleInitTest6) -{ - CheckSimpleInitTest(IPAddressType::kIPv6); -} - -TEST_F(TestTCP, CheckMessageTest6) -{ - IPAddress addr; - IPAddress::FromString("::1", addr); - CheckMessageTest(addr); -} - -#if INET_CONFIG_ENABLE_IPV4 -TEST_F(TestTCP, ConnectToSelfTest4) -{ - IPAddress addr; - IPAddress::FromString("127.0.0.1", addr); - ConnectToSelfTest(addr); -} - -TEST_F(TestTCP, ConnectSendMessageThenCloseTest4) -{ - IPAddress addr; - IPAddress::FromString("127.0.0.1", addr); - ConnectSendMessageThenCloseTest(addr); -} - -TEST_F(TestTCP, HandleConnCompleteCalledTest4) -{ - IPAddress addr; - IPAddress::FromString("127.0.0.1", addr); - HandleConnCompleteTest(addr); -} -#endif // INET_CONFIG_ENABLE_IPV4 - -TEST_F(TestTCP, ConnectToSelfTest6) -{ - IPAddress addr; - IPAddress::FromString("::1", addr); - ConnectToSelfTest(addr); -} - -TEST_F(TestTCP, ConnectSendMessageThenCloseTest6) -{ - IPAddress addr; - IPAddress::FromString("::1", addr); - ConnectSendMessageThenCloseTest(addr); -} - -TEST_F(TestTCP, HandleConnCompleteCalledTest6) -{ - IPAddress addr; - IPAddress::FromString("::1", addr); - HandleConnCompleteTest(addr); -} - -TEST_F(TestTCP, HandleConnCloseCalledTest6) -{ - IPAddress addr; - IPAddress::FromString("::1", addr); - HandleConnCloseTest(addr); -} - // Generates a packet buffer or a chain of packet buffers for a single message. struct TestData { @@ -563,108 +417,264 @@ void TestData::Free() mMessageOffset = 0; } -int TestDataCallbackCheck(const uint8_t * message, size_t length, int count, void * data) +class TestTCP : public ::testing::Test { - if (data == nullptr) +public: + static void SetUpTestSuite() { - return -1; + if (mIOContext == nullptr) + { + mIOContext = new IOContext(); + ASSERT_NE(mIOContext, nullptr); + } + ASSERT_EQ(mIOContext->Init(), CHIP_NO_ERROR); } - TestData * currentData = static_cast(data) + count; - if (currentData->mPayload == nullptr) + static void TearDownTestSuite() { - return -2; + if (mIOContext != nullptr) + { + mIOContext->Shutdown(); + delete mIOContext; + mIOContext = nullptr; + } } - if (currentData->mMessageLength != length) + +protected: + static IOContext * mIOContext; + + /////////////////////////// Init test + void CheckSimpleInitTest(IPAddressType type) { - return -3; + TCPImpl tcp; + + CHIP_ERROR err = tcp.Init( + Transport::TcpListenParameters(mIOContext->GetTCPEndPointManager()).SetAddressType(type).SetListenPort(gChipTCPPort)); + + EXPECT_EQ(err, CHIP_NO_ERROR); } - if (memcmp(currentData->mPayload + currentData->mMessageOffset, message, length) != 0) + + /////////////////////////// Messaging test + void CheckMessageTest(const IPAddress & addr) { - return -4; - } - return 0; -} + TCPImpl tcp; -} // namespace + MockTransportMgrDelegate gMockTransportMgrDelegate(mIOContext); + gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); + gMockTransportMgrDelegate.SingleMessageTest(tcp, addr); + gMockTransportMgrDelegate.DisconnectTest(tcp, addr); + } -namespace chip { -namespace Transport { -class TCPTest -{ -public: - static void CheckProcessReceivedBuffer(TestContext * ctx) + void ConnectToSelfTest(const IPAddress & addr) { TCPImpl tcp; - IPAddress addr; - IPAddress::FromString("::1", addr); - - MockTransportMgrDelegate gMockTransportMgrDelegate(ctx); + MockTransportMgrDelegate gMockTransportMgrDelegate(mIOContext); gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); + gMockTransportMgrDelegate.ConnectTest(tcp, addr); + gMockTransportMgrDelegate.DisconnectTest(tcp, addr); + } - // Send a packet to get TCP going, so that we can find a TCPEndPoint to pass to ProcessReceivedBuffer. - // (The current TCPEndPoint implementation is not effectively mockable.) - gMockTransportMgrDelegate.SingleMessageTest(tcp, addr); + void ConnectSendMessageThenCloseTest(const IPAddress & addr) + { + TCPImpl tcp; - Transport::PeerAddress lPeerAddress = Transport::PeerAddress::TCP(addr, gChipTCPPort); - chip::Transport::ActiveTCPConnectionState * state = tcp.FindActiveConnection(lPeerAddress); - ASSERT_NE(state, nullptr); - Inet::TCPEndPoint * lEndPoint = state->mEndPoint; - ASSERT_NE(lEndPoint, nullptr); + MockTransportMgrDelegate gMockTransportMgrDelegate(mIOContext); + gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); + gMockTransportMgrDelegate.ConnectTest(tcp, addr); + gMockTransportMgrDelegate.SingleMessageTest(tcp, addr); + gMockTransportMgrDelegate.DisconnectTest(tcp, addr); + } - CHIP_ERROR err = CHIP_NO_ERROR; - TestData testData[2]; - gMockTransportMgrDelegate.SetCallback(TestDataCallbackCheck, testData); + void HandleConnCompleteTest(const IPAddress & addr) + { + TCPImpl tcp; - // Test a single packet buffer. - gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; - EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 111, 0 })); - err = tcp.ProcessReceivedBuffer(lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); - EXPECT_EQ(err, CHIP_NO_ERROR); - EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 1); + MockTransportMgrDelegate gMockTransportMgrDelegate(mIOContext); + gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); + gMockTransportMgrDelegate.HandleConnectCompleteCbCalledTest(tcp, addr); + gMockTransportMgrDelegate.DisconnectTest(tcp, addr); + } - // Test a message in a chain of three packet buffers. The message length is split across buffers. - gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; - EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 1, 122, 123, 0 })); - err = tcp.ProcessReceivedBuffer(lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); - EXPECT_EQ(err, CHIP_NO_ERROR); - EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 1); - - // Test two messages in a chain. - gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; - EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 131, 0 })); - EXPECT_TRUE(testData[1].Init((const uint16_t[]){ 132, 0 })); - testData[0].mHandle->AddToEnd(std::move(testData[1].mHandle)); - err = tcp.ProcessReceivedBuffer(lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); - EXPECT_EQ(err, CHIP_NO_ERROR); - EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 2); - - // Test a chain of two messages, each a chain. - gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; - EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 141, 142, 0 })); - EXPECT_TRUE(testData[1].Init((const uint16_t[]){ 143, 144, 0 })); - testData[0].mHandle->AddToEnd(std::move(testData[1].mHandle)); - err = tcp.ProcessReceivedBuffer(lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); - EXPECT_EQ(err, CHIP_NO_ERROR); - EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 2); - - // Test a message that is too large to coalesce into a single packet buffer. - gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; - gMockTransportMgrDelegate.SetCallback(TestDataCallbackCheck, &testData[1]); - EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 51, System::PacketBuffer::kMaxSizeWithoutReserve, 0 })); - // Sending only the first buffer of the long chain. This should be enough to trigger the error. - System::PacketBufferHandle head = testData[0].mHandle.PopHead(); - err = tcp.ProcessReceivedBuffer(lEndPoint, lPeerAddress, std::move(head)); - EXPECT_EQ(err, CHIP_ERROR_MESSAGE_TOO_LONG); - EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 0); + void HandleConnCloseTest(const IPAddress & addr) + { + TCPImpl tcp; + MockTransportMgrDelegate gMockTransportMgrDelegate(mIOContext); + gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); + gMockTransportMgrDelegate.HandleConnectCloseCbCalledTest(tcp, addr); gMockTransportMgrDelegate.DisconnectTest(tcp, addr); } + + // Callback used by CheckProcessReceivedBuffer. + static int TestDataCallbackCheck(const uint8_t * message, size_t length, int count, void * data) + { + if (data == nullptr) + { + return -1; + } + TestData * currentData = static_cast(data) + count; + if (currentData->mPayload == nullptr) + { + return -2; + } + if (currentData->mMessageLength != length) + { + return -3; + } + if (memcmp(currentData->mPayload + currentData->mMessageOffset, message, length) != 0) + { + return -4; + } + return 0; + } }; -} // namespace Transport -} // namespace chip + +IOContext * TestTCP::mIOContext = nullptr; + +#if INET_CONFIG_ENABLE_IPV4 +TEST_F(TestTCP, CheckSimpleInitTest4) +{ + CheckSimpleInitTest(IPAddressType::kIPv4); +} + +TEST_F(TestTCP, CheckMessageTest4) +{ + IPAddress addr; + IPAddress::FromString("127.0.0.1", addr); + CheckMessageTest(addr); +} +#endif + +TEST_F(TestTCP, CheckSimpleInitTest6) +{ + CheckSimpleInitTest(IPAddressType::kIPv6); +} + +TEST_F(TestTCP, CheckMessageTest6) +{ + IPAddress addr; + IPAddress::FromString("::1", addr); + CheckMessageTest(addr); +} + +#if INET_CONFIG_ENABLE_IPV4 +TEST_F(TestTCP, ConnectToSelfTest4) +{ + IPAddress addr; + IPAddress::FromString("127.0.0.1", addr); + ConnectToSelfTest(addr); +} + +TEST_F(TestTCP, ConnectSendMessageThenCloseTest4) +{ + IPAddress addr; + IPAddress::FromString("127.0.0.1", addr); + ConnectSendMessageThenCloseTest(addr); +} + +TEST_F(TestTCP, HandleConnCompleteCalledTest4) +{ + IPAddress addr; + IPAddress::FromString("127.0.0.1", addr); + HandleConnCompleteTest(addr); +} +#endif // INET_CONFIG_ENABLE_IPV4 + +TEST_F(TestTCP, ConnectToSelfTest6) +{ + IPAddress addr; + IPAddress::FromString("::1", addr); + ConnectToSelfTest(addr); +} + +TEST_F(TestTCP, ConnectSendMessageThenCloseTest6) +{ + IPAddress addr; + IPAddress::FromString("::1", addr); + ConnectSendMessageThenCloseTest(addr); +} + +TEST_F(TestTCP, HandleConnCompleteCalledTest6) +{ + IPAddress addr; + IPAddress::FromString("::1", addr); + HandleConnCompleteTest(addr); +} + +TEST_F(TestTCP, HandleConnCloseCalledTest6) +{ + IPAddress addr; + IPAddress::FromString("::1", addr); + HandleConnCloseTest(addr); +} TEST_F(TestTCP, CheckProcessReceivedBuffer) { - chip::Transport::TCPTest::CheckProcessReceivedBuffer(this); + TCPImpl tcp; + + IPAddress addr; + IPAddress::FromString("::1", addr); + + MockTransportMgrDelegate gMockTransportMgrDelegate(mIOContext); + gMockTransportMgrDelegate.InitializeMessageTest(tcp, addr); + + // Send a packet to get TCP going, so that we can find a TCPEndPoint to pass to ProcessReceivedBuffer. + // (The current TCPEndPoint implementation is not effectively mockable.) + gMockTransportMgrDelegate.SingleMessageTest(tcp, addr); + + Transport::PeerAddress lPeerAddress = Transport::PeerAddress::TCP(addr, gChipTCPPort); + void * state = TestAccess::FindActiveConnection(tcp, lPeerAddress); + ASSERT_NE(state, nullptr); + TCPEndPoint * lEndPoint = TestAccess::GetEndpoint(state); + ASSERT_NE(lEndPoint, nullptr); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestData testData[2]; + gMockTransportMgrDelegate.SetCallback(TestDataCallbackCheck, testData); + + // Test a single packet buffer. + gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; + EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 111, 0 })); + err = TestAccess::ProcessReceivedBuffer(tcp, lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); + EXPECT_EQ(err, CHIP_NO_ERROR); + EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 1); + + // Test a message in a chain of three packet buffers. The message length is split across buffers. + gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; + EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 1, 122, 123, 0 })); + err = TestAccess::ProcessReceivedBuffer(tcp, lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); + EXPECT_EQ(err, CHIP_NO_ERROR); + EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 1); + + // Test two messages in a chain. + gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; + EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 131, 0 })); + EXPECT_TRUE(testData[1].Init((const uint16_t[]){ 132, 0 })); + testData[0].mHandle->AddToEnd(std::move(testData[1].mHandle)); + err = TestAccess::ProcessReceivedBuffer(tcp, lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); + EXPECT_EQ(err, CHIP_NO_ERROR); + EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 2); + + // Test a chain of two messages, each a chain. + gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; + EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 141, 142, 0 })); + EXPECT_TRUE(testData[1].Init((const uint16_t[]){ 143, 144, 0 })); + testData[0].mHandle->AddToEnd(std::move(testData[1].mHandle)); + err = TestAccess::ProcessReceivedBuffer(tcp, lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); + EXPECT_EQ(err, CHIP_NO_ERROR); + EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 2); + + // Test a message that is too large to coalesce into a single packet buffer. + gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; + gMockTransportMgrDelegate.SetCallback(TestDataCallbackCheck, &testData[1]); + EXPECT_TRUE(testData[0].Init((const uint16_t[]){ 51, System::PacketBuffer::kMaxSizeWithoutReserve, 0 })); + // Sending only the first buffer of the long chain. This should be enough to trigger the error. + System::PacketBufferHandle head = testData[0].mHandle.PopHead(); + err = TestAccess::ProcessReceivedBuffer(tcp, lEndPoint, lPeerAddress, std::move(head)); + EXPECT_EQ(err, CHIP_ERROR_MESSAGE_TOO_LONG); + EXPECT_EQ(gMockTransportMgrDelegate.mReceiveHandlerCallCount, 0); + + gMockTransportMgrDelegate.DisconnectTest(tcp, addr); } + +} // namespace diff --git a/src/transport/raw/tests/TestUDP.cpp b/src/transport/raw/tests/TestUDP.cpp index 6a22a821fdfc94..39167b89a58bb7 100644 --- a/src/transport/raw/tests/TestUDP.cpp +++ b/src/transport/raw/tests/TestUDP.cpp @@ -23,16 +23,17 @@ #include "NetworkTestHelpers.h" +#include + +#include + #include #include #include #include -#include - -#include - using namespace chip; +using namespace chip::Test; using namespace chip::Inet; namespace { @@ -41,8 +42,6 @@ constexpr NodeId kSourceNodeId = 123654; constexpr NodeId kDestinationNodeId = 111222333; constexpr uint32_t kMessageCounter = 18; -using TestContext = chip::Test::IOContext; - const char PAYLOAD[] = "Hello!"; int ReceiveHandlerCallCount = 0; @@ -73,85 +72,106 @@ class MockTransportMgrDelegate : public TransportMgrDelegate } // namespace -/////////////////////////// Init test - class TestUDP : public ::testing::Test { +public: + // Performs shared setup for all tests in the test suite + static void SetUpTestSuite() + { + if (mIOContext == nullptr) + { + mIOContext = new IOContext(); + ASSERT_NE(mIOContext, nullptr); + } + ASSERT_EQ(mIOContext->Init(), CHIP_NO_ERROR); + } + + // Performs shared teardown for all tests in the test suite + static void TearDownTestSuite() + { + if (mIOContext != nullptr) + { + mIOContext->Shutdown(); + delete mIOContext; + mIOContext = nullptr; + } + } + protected: - TestUDP() { inContext = new TestContext(); } - ~TestUDP() { delete inContext; } - void SetUp() { ASSERT_EQ(inContext->Init(), CHIP_NO_ERROR); } - void TearDown() { inContext->Shutdown(); } - TestContext * inContext; -}; + static IOContext * mIOContext; -void CheckSimpleInitTest(TestContext * ctx, Inet::IPAddressType type) -{ - Transport::UDP udp; + void CheckSimpleInitTest(IPAddressType type) + { + Transport::UDP udp; - CHIP_ERROR err = udp.Init(Transport::UdpListenParameters(ctx->GetUDPEndPointManager()).SetAddressType(type).SetListenPort(0)); + CHIP_ERROR err = + udp.Init(Transport::UdpListenParameters(mIOContext->GetUDPEndPointManager()).SetAddressType(type).SetListenPort(0)); - EXPECT_EQ(err, CHIP_NO_ERROR); -} + EXPECT_EQ(err, CHIP_NO_ERROR); + } -void CheckMessageTest(TestContext * ctx, const IPAddress & addr) -{ - uint16_t payload_len = sizeof(PAYLOAD); + void CheckMessageTest(const IPAddress & addr) + { + uint16_t payload_len = sizeof(PAYLOAD); + + chip::System::PacketBufferHandle buffer = chip::System::PacketBufferHandle::NewWithData(PAYLOAD, payload_len); + EXPECT_FALSE(buffer.IsNull()); - chip::System::PacketBufferHandle buffer = chip::System::PacketBufferHandle::NewWithData(PAYLOAD, payload_len); - EXPECT_FALSE(buffer.IsNull()); + CHIP_ERROR err = CHIP_NO_ERROR; - CHIP_ERROR err = CHIP_NO_ERROR; + Transport::UDP udp; - Transport::UDP udp; + err = udp.Init( + Transport::UdpListenParameters(mIOContext->GetUDPEndPointManager()).SetAddressType(addr.Type()).SetListenPort(0)); + EXPECT_EQ(err, CHIP_NO_ERROR); - err = udp.Init(Transport::UdpListenParameters(ctx->GetUDPEndPointManager()).SetAddressType(addr.Type()).SetListenPort(0)); - EXPECT_EQ(err, CHIP_NO_ERROR); + MockTransportMgrDelegate gMockTransportMgrDelegate; + TransportMgrBase gTransportMgrBase; + gTransportMgrBase.SetSessionManager(&gMockTransportMgrDelegate); + gTransportMgrBase.Init(&udp); - MockTransportMgrDelegate gMockTransportMgrDelegate; - TransportMgrBase gTransportMgrBase; - gTransportMgrBase.SetSessionManager(&gMockTransportMgrDelegate); - gTransportMgrBase.Init(&udp); + ReceiveHandlerCallCount = 0; - ReceiveHandlerCallCount = 0; + PacketHeader header; + header.SetSourceNodeId(kSourceNodeId).SetDestinationNodeId(kDestinationNodeId).SetMessageCounter(kMessageCounter); - PacketHeader header; - header.SetSourceNodeId(kSourceNodeId).SetDestinationNodeId(kDestinationNodeId).SetMessageCounter(kMessageCounter); + err = header.EncodeBeforeData(buffer); + EXPECT_EQ(err, CHIP_NO_ERROR); - err = header.EncodeBeforeData(buffer); - EXPECT_EQ(err, CHIP_NO_ERROR); + // Should be able to send a message to itself by just calling send. + err = udp.SendMessage(Transport::PeerAddress::UDP(addr, udp.GetBoundPort()), std::move(buffer)); + EXPECT_EQ(err, CHIP_NO_ERROR); - // Should be able to send a message to itself by just calling send. - err = udp.SendMessage(Transport::PeerAddress::UDP(addr, udp.GetBoundPort()), std::move(buffer)); - EXPECT_EQ(err, CHIP_NO_ERROR); + mIOContext->DriveIOUntil(chip::System::Clock::Seconds16(1), []() { return ReceiveHandlerCallCount != 0; }); - ctx->DriveIOUntil(chip::System::Clock::Seconds16(1), []() { return ReceiveHandlerCallCount != 0; }); + EXPECT_EQ(ReceiveHandlerCallCount, 1); + } +}; - EXPECT_EQ(ReceiveHandlerCallCount, 1); -} +IOContext * TestUDP::mIOContext = nullptr; #if INET_CONFIG_ENABLE_IPV4 TEST_F(TestUDP, CheckSimpleInitTest4) { - CheckSimpleInitTest(inContext, IPAddressType::kIPv4); + CheckSimpleInitTest(IPAddressType::kIPv4); } TEST_F(TestUDP, CheckMessageTest4) { IPAddress addr; IPAddress::FromString("127.0.0.1", addr); - CheckMessageTest(inContext, addr); + CheckMessageTest(addr); } #endif TEST_F(TestUDP, CheckSimpleInitTest6) { - CheckSimpleInitTest(inContext, IPAddressType::kIPv6); + CheckSimpleInitTest(IPAddressType::kIPv6); } TEST_F(TestUDP, CheckMessageTest6) { IPAddress addr; IPAddress::FromString("::1", addr); - CheckMessageTest(inContext, addr); + CheckMessageTest(addr); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 1015f52f3e9abd..5d121f59368ea5 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -75958,7 +75958,6 @@ class SubscribeAttributeValveConfigurationAndControlClusterRevision : public Sub #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster ElectricalPowerMeasurement | 0x0090 | |------------------------------------------------------------------------------| @@ -75995,8 +75994,6 @@ class SubscribeAttributeValveConfigurationAndControlClusterRevision : public Sub | * MeasurementPeriodRanges | 0x0000 | \*----------------------------------------------------------------------------*/ -#if MTR_ENABLE_PROVISIONAL - /* * Attribute PowerMode */ @@ -76079,9 +76076,6 @@ class SubscribeAttributeElectricalPowerMeasurementPowerMode : public SubscribeAt } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute NumberOfMeasurementTypes */ @@ -76164,9 +76158,6 @@ class SubscribeAttributeElectricalPowerMeasurementNumberOfMeasurementTypes : pub } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute Accuracy */ @@ -76249,9 +76240,6 @@ class SubscribeAttributeElectricalPowerMeasurementAccuracy : public SubscribeAtt } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute Ranges */ @@ -76334,9 +76322,6 @@ class SubscribeAttributeElectricalPowerMeasurementRanges : public SubscribeAttri } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute Voltage */ @@ -76419,9 +76404,6 @@ class SubscribeAttributeElectricalPowerMeasurementVoltage : public SubscribeAttr } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ActiveCurrent */ @@ -76504,9 +76486,6 @@ class SubscribeAttributeElectricalPowerMeasurementActiveCurrent : public Subscri } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ReactiveCurrent */ @@ -76589,9 +76568,6 @@ class SubscribeAttributeElectricalPowerMeasurementReactiveCurrent : public Subsc } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ApparentCurrent */ @@ -76674,9 +76650,6 @@ class SubscribeAttributeElectricalPowerMeasurementApparentCurrent : public Subsc } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ActivePower */ @@ -76759,9 +76732,6 @@ class SubscribeAttributeElectricalPowerMeasurementActivePower : public Subscribe } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ReactivePower */ @@ -76844,9 +76814,6 @@ class SubscribeAttributeElectricalPowerMeasurementReactivePower : public Subscri } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ApparentPower */ @@ -76929,9 +76896,6 @@ class SubscribeAttributeElectricalPowerMeasurementApparentPower : public Subscri } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute RMSVoltage */ @@ -77014,9 +76978,6 @@ class SubscribeAttributeElectricalPowerMeasurementRMSVoltage : public SubscribeA } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute RMSCurrent */ @@ -77099,9 +77060,6 @@ class SubscribeAttributeElectricalPowerMeasurementRMSCurrent : public SubscribeA } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute RMSPower */ @@ -77184,9 +77142,6 @@ class SubscribeAttributeElectricalPowerMeasurementRMSPower : public SubscribeAtt } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute Frequency */ @@ -77269,9 +77224,6 @@ class SubscribeAttributeElectricalPowerMeasurementFrequency : public SubscribeAt } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute HarmonicCurrents */ @@ -77354,9 +77306,6 @@ class SubscribeAttributeElectricalPowerMeasurementHarmonicCurrents : public Subs } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute HarmonicPhases */ @@ -77439,9 +77388,6 @@ class SubscribeAttributeElectricalPowerMeasurementHarmonicPhases : public Subscr } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute PowerFactor */ @@ -77524,9 +77470,6 @@ class SubscribeAttributeElectricalPowerMeasurementPowerFactor : public Subscribe } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute NeutralCurrent */ @@ -77609,9 +77552,6 @@ class SubscribeAttributeElectricalPowerMeasurementNeutralCurrent : public Subscr } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute GeneratedCommandList */ @@ -77694,9 +77634,6 @@ class SubscribeAttributeElectricalPowerMeasurementGeneratedCommandList : public } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute AcceptedCommandList */ @@ -77779,7 +77716,6 @@ class SubscribeAttributeElectricalPowerMeasurementAcceptedCommandList : public S } }; -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* @@ -77865,7 +77801,6 @@ class SubscribeAttributeElectricalPowerMeasurementEventList : public SubscribeAt }; #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL /* * Attribute AttributeList @@ -77949,9 +77884,6 @@ class SubscribeAttributeElectricalPowerMeasurementAttributeList : public Subscri } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute FeatureMap */ @@ -78034,9 +77966,6 @@ class SubscribeAttributeElectricalPowerMeasurementFeatureMap : public SubscribeA } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ClusterRevision */ @@ -78119,9 +78048,6 @@ class SubscribeAttributeElectricalPowerMeasurementClusterRevision : public Subsc } }; -#endif // MTR_ENABLE_PROVISIONAL -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster ElectricalEnergyMeasurement | 0x0091 | |------------------------------------------------------------------------------| @@ -78146,8 +78072,6 @@ class SubscribeAttributeElectricalPowerMeasurementClusterRevision : public Subsc | * PeriodicEnergyMeasured | 0x0001 | \*----------------------------------------------------------------------------*/ -#if MTR_ENABLE_PROVISIONAL - /* * Attribute Accuracy */ @@ -78230,9 +78154,6 @@ class SubscribeAttributeElectricalEnergyMeasurementAccuracy : public SubscribeAt } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute CumulativeEnergyImported */ @@ -78315,9 +78236,6 @@ class SubscribeAttributeElectricalEnergyMeasurementCumulativeEnergyImported : pu } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute CumulativeEnergyExported */ @@ -78400,9 +78318,6 @@ class SubscribeAttributeElectricalEnergyMeasurementCumulativeEnergyExported : pu } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute PeriodicEnergyImported */ @@ -78485,9 +78400,6 @@ class SubscribeAttributeElectricalEnergyMeasurementPeriodicEnergyImported : publ } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute PeriodicEnergyExported */ @@ -78570,9 +78482,6 @@ class SubscribeAttributeElectricalEnergyMeasurementPeriodicEnergyExported : publ } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute CumulativeEnergyReset */ @@ -78655,9 +78564,6 @@ class SubscribeAttributeElectricalEnergyMeasurementCumulativeEnergyReset : publi } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute GeneratedCommandList */ @@ -78740,9 +78646,6 @@ class SubscribeAttributeElectricalEnergyMeasurementGeneratedCommandList : public } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute AcceptedCommandList */ @@ -78825,7 +78728,6 @@ class SubscribeAttributeElectricalEnergyMeasurementAcceptedCommandList : public } }; -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* @@ -78911,7 +78813,6 @@ class SubscribeAttributeElectricalEnergyMeasurementEventList : public SubscribeA }; #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL /* * Attribute AttributeList @@ -78995,9 +78896,6 @@ class SubscribeAttributeElectricalEnergyMeasurementAttributeList : public Subscr } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute FeatureMap */ @@ -79080,9 +78978,6 @@ class SubscribeAttributeElectricalEnergyMeasurementFeatureMap : public Subscribe } }; -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute ClusterRevision */ @@ -79165,8 +79060,6 @@ class SubscribeAttributeElectricalEnergyMeasurementClusterRevision : public Subs } }; -#endif // MTR_ENABLE_PROVISIONAL -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster DemandResponseLoadControl | 0x0096 | @@ -185691,7 +185584,6 @@ void registerClusterValveConfigurationAndControl(Commands & commands) } void registerClusterElectricalPowerMeasurement(Commands & commands) { -#if MTR_ENABLE_PROVISIONAL using namespace chip::app::Clusters::ElectricalPowerMeasurement; const char * clusterName = "ElectricalPowerMeasurement"; @@ -185701,116 +185593,66 @@ void registerClusterElectricalPowerMeasurement(Commands & commands) make_unique(Id), // make_unique(Id), // make_unique(Id), // -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands); -#endif // MTR_ENABLE_PROVISIONAL } void registerClusterElectricalEnergyMeasurement(Commands & commands) { -#if MTR_ENABLE_PROVISIONAL using namespace chip::app::Clusters::ElectricalEnergyMeasurement; const char * clusterName = "ElectricalEnergyMeasurement"; @@ -185820,60 +185662,37 @@ void registerClusterElectricalEnergyMeasurement(Commands & commands) make_unique(Id), // make_unique(Id), // make_unique(Id), // -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands); -#endif // MTR_ENABLE_PROVISIONAL } void registerClusterDemandResponseLoadControl(Commands & commands) {