From 6c9f1c5060ace92c9ab1819d05fe800b7a0bbbab Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Thu, 18 Nov 2021 00:58:13 +0800 Subject: [PATCH 1/5] Refactor/Split ExchangeMgrDelegate (#11789) --- src/app/CASESessionManager.cpp | 12 +- src/app/CASESessionManager.h | 9 +- src/app/DeviceProxy.h | 6 - src/app/OperationalDeviceProxy.cpp | 3 +- src/app/OperationalDeviceProxy.h | 4 +- src/channel/Manager.h | 23 +-- src/controller/CHIPDeviceController.cpp | 20 +-- src/controller/CHIPDeviceController.h | 17 +-- src/controller/CommissioneeDeviceProxy.cpp | 2 +- src/controller/CommissioneeDeviceProxy.h | 6 +- src/controller/tests/data_model/TestRead.cpp | 4 +- src/lib/core/CHIPConfig.h | 18 +++ src/messaging/BUILD.gn | 1 - src/messaging/ExchangeMgr.cpp | 32 +--- src/messaging/ExchangeMgr.h | 20 +-- src/messaging/tests/TestExchangeMgr.cpp | 4 +- src/transport/BUILD.gn | 5 + .../SessionDelegate.h} | 34 ++--- src/transport/SessionManager.cpp | 85 ++++++----- src/transport/SessionManager.h | 137 +++++++++--------- src/transport/SessionMessageDelegate.h | 58 ++++++++ src/transport/tests/TestSessionManager.cpp | 26 ++-- 22 files changed, 278 insertions(+), 248 deletions(-) rename src/{messaging/ExchangeMgrDelegate.h => transport/SessionDelegate.h} (55%) create mode 100644 src/transport/SessionMessageDelegate.h diff --git a/src/app/CASESessionManager.cpp b/src/app/CASESessionManager.cpp index ff152e47e6a22a..a4d3d982f3698f 100644 --- a/src/app/CASESessionManager.cpp +++ b/src/app/CASESessionManager.cpp @@ -111,18 +111,12 @@ CHIP_ERROR CASESessionManager::GetPeerAddress(NodeId nodeId, Transport::PeerAddr return CHIP_NO_ERROR; } -void CASESessionManager::OnNewConnection(SessionHandle sessionHandle, Messaging::ExchangeManager * mgr) -{ - // TODO Update the MRP params based on the MRP params extracted from CASE, when this is available. -} - -void CASESessionManager::OnConnectionExpired(SessionHandle sessionHandle, Messaging::ExchangeManager * mgr) +void CASESessionManager::OnSessionReleased(SessionHandle sessionHandle) { OperationalDeviceProxy * session = FindSession(sessionHandle); - VerifyOrReturn(session != nullptr, - ChipLogDetail(Controller, "OnConnectionExpired was called for unknown device, ignoring it.")); + VerifyOrReturn(session != nullptr, ChipLogDetail(Controller, "OnSessionReleased was called for unknown device, ignoring it.")); - session->OnConnectionExpired(sessionHandle); + session->OnSessionReleased(sessionHandle); } OperationalDeviceProxy * CASESessionManager::FindSession(SessionHandle session) diff --git a/src/app/CASESessionManager.h b/src/app/CASESessionManager.h index 56fbdfca449d2a..bf771945348875 100644 --- a/src/app/CASESessionManager.h +++ b/src/app/CASESessionManager.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include @@ -43,7 +43,7 @@ struct CASESessionManagerConfig * 4. During session establishment, trigger node ID resolution (if needed), and update the DNS-SD cache (if resolution is * successful) */ -class CASESessionManager : public Messaging::ExchangeMgrDelegate, public Dnssd::ResolverDelegate +class CASESessionManager : public SessionReleaseDelegate, public Dnssd::ResolverDelegate { public: CASESessionManager() = delete; @@ -91,9 +91,8 @@ class CASESessionManager : public Messaging::ExchangeMgrDelegate, public Dnssd:: */ CHIP_ERROR GetPeerAddress(NodeId nodeId, Transport::PeerAddress & addr); - //////////// ExchangeMgrDelegate Implementation /////////////// - void OnNewConnection(SessionHandle session, Messaging::ExchangeManager * mgr) override; - void OnConnectionExpired(SessionHandle session, Messaging::ExchangeManager * mgr) override; + //////////// SessionReleaseDelegate Implementation /////////////// + void OnSessionReleased(SessionHandle session) override; //////////// ResolverDelegate Implementation /////////////// void OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeData) override; diff --git a/src/app/DeviceProxy.h b/src/app/DeviceProxy.h index c4ce1c2f64d37c..9e4a6d0b90b659 100644 --- a/src/app/DeviceProxy.h +++ b/src/app/DeviceProxy.h @@ -42,12 +42,6 @@ class DLL_EXPORT DeviceProxy virtual ~DeviceProxy() {} DeviceProxy() {} - /** - * Called when a connection is closing. - * The object releases all resources associated with the connection. - */ - virtual void OnConnectionExpired(SessionHandle session) = 0; - /** * Mark any open session with the device as expired. */ diff --git a/src/app/OperationalDeviceProxy.cpp b/src/app/OperationalDeviceProxy.cpp index 140beb734867c8..bf78d8b014c9a2 100644 --- a/src/app/OperationalDeviceProxy.cpp +++ b/src/app/OperationalDeviceProxy.cpp @@ -229,6 +229,7 @@ void OperationalDeviceProxy::OnSessionEstablished() VerifyOrReturn(mState != State::Uninitialized, ChipLogError(Controller, "OnSessionEstablished was called while the device was not initialized")); + // TODO Update the MRP params based on the MRP params extracted from CASE, when this is available. CHIP_ERROR err = mInitParams.sessionManager->NewPairing( Optional::Value(mDeviceAddress), mPeerId.GetNodeId(), &mCASESession, CryptoContext::SessionRole::kInitiator, mInitParams.fabricInfo->GetFabricIndex()); @@ -267,7 +268,7 @@ void OperationalDeviceProxy::Clear() mInitParams = DeviceProxyInitParams(); } -void OperationalDeviceProxy::OnConnectionExpired(SessionHandle session) +void OperationalDeviceProxy::OnSessionReleased(SessionHandle session) { VerifyOrReturn(mSecureSession.HasValue() && mSecureSession.Value() == session, ChipLogDetail(Controller, "Connection expired, but it doesn't match the current session")); diff --git a/src/app/OperationalDeviceProxy.h b/src/app/OperationalDeviceProxy.h index a9cfa2725dcbd5..a98b96d6f515ef 100644 --- a/src/app/OperationalDeviceProxy.h +++ b/src/app/OperationalDeviceProxy.h @@ -69,7 +69,7 @@ class OperationalDeviceProxy; typedef void (*OnDeviceConnected)(void * context, DeviceProxy * device); typedef void (*OnDeviceConnectionFailure)(void * context, NodeId deviceId, CHIP_ERROR error); -class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, public SessionEstablishmentDelegate +class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, SessionReleaseDelegate, public SessionEstablishmentDelegate { public: virtual ~OperationalDeviceProxy(); @@ -113,7 +113,7 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, public SessionEsta * Called when a connection is closing. * The object releases all resources associated with the connection. */ - void OnConnectionExpired(SessionHandle session) override; + void OnSessionReleased(SessionHandle session) override; void OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeResolutionData) { diff --git a/src/channel/Manager.h b/src/channel/Manager.h index caf5035a9862d3..588fa099834292 100644 --- a/src/channel/Manager.h +++ b/src/channel/Manager.h @@ -34,10 +34,13 @@ class ChannelContext; * @brief * This class is used to manage Channel Contexts with other CHIP nodes. */ -class DLL_EXPORT ChannelManager : public ExchangeMgrDelegate +class DLL_EXPORT ChannelManager : public SessionCreationDelegate { public: - ChannelManager(ExchangeManager * exchangeManager) : mExchangeManager(exchangeManager) { exchangeManager->SetDelegate(this); } + ChannelManager(ExchangeManager * exchangeManager) : mExchangeManager(exchangeManager) + { + exchangeManager->GetSessionManager()->RegisterCreationDelegate(*this); + } ChannelManager(const ChannelManager &) = delete; ChannelManager operator=(const ChannelManager &) = delete; @@ -58,10 +61,10 @@ class DLL_EXPORT ChannelManager : public ExchangeMgrDelegate }); } - void OnNewConnection(SessionHandle session, ExchangeManager * mgr) override + void OnNewSession(SessionHandle session) override { mChannelContexts.ForEachActiveObject([&](ChannelContext * context) { - if (context->MatchesSession(session, mgr->GetSessionManager())) + if (context->MatchesSession(session, mExchangeManager->GetSessionManager())) { context->OnNewConnection(session); return false; @@ -70,18 +73,6 @@ class DLL_EXPORT ChannelManager : public ExchangeMgrDelegate }); } - void OnConnectionExpired(SessionHandle session, ExchangeManager * mgr) override - { - mChannelContexts.ForEachActiveObject([&](ChannelContext * context) { - if (context->MatchesSession(session, mgr->GetSessionManager())) - { - context->OnConnectionExpired(session); - return false; - } - return true; - }); - } - private: BitMapObjectPool mChannelContexts; BitMapObjectPool mChannelHandles; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index a4a168a68956ab..3b84465be3e11e 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -131,10 +131,6 @@ CHIP_ERROR DeviceController::Init(ControllerInitParams params) VerifyOrReturnError(params.systemState->TransportMgr() != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - // TODO Exchange Mgr needs to be able to track multiple delegates. Delegate API should be able to query for the right delegate - // to handle events. - params.systemState->ExchangeMgr()->SetDelegate(this); - #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD Dnssd::Resolver::Instance().Init(params.systemState->InetLayer()); Dnssd::Resolver::Instance().SetResolverDelegate(this); @@ -266,10 +262,10 @@ void DeviceController::ReleaseOperationalDevice(NodeId remoteDeviceId) mCASESessionManager->ReleaseSession(remoteDeviceId); } -void DeviceController::OnConnectionExpired(SessionHandle session, Messaging::ExchangeManager * mgr) +void DeviceController::OnSessionReleased(SessionHandle session) { VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnConnectionExpired was called in incorrect state")); - mCASESessionManager->OnConnectionExpired(session, mgr); + mCASESessionManager->OnSessionReleased(session); } CHIP_ERROR DeviceController::InitializePairedDeviceList() @@ -544,6 +540,9 @@ CHIP_ERROR DeviceCommissioner::Init(CommissionerInitParams params) { ReturnErrorOnFailure(DeviceController::Init(params)); + params.systemState->SessionMgr()->RegisterCreationDelegate(*this); + params.systemState->SessionMgr()->RegisterReleaseDelegate(*this); + uint16_t nextKeyID = 0; uint16_t size = sizeof(nextKeyID); CHIP_ERROR error = mStorageDelegate->SyncGetKeyValue(kNextAvailableKeyID, &nextKeyID, size); @@ -605,24 +604,25 @@ CHIP_ERROR DeviceCommissioner::Shutdown() return CHIP_NO_ERROR; } -void DeviceCommissioner::OnNewConnection(SessionHandle session, Messaging::ExchangeManager * mgr) +void DeviceCommissioner::OnNewSession(SessionHandle session) { VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnNewConnection was called in incorrect state")); - CommissioneeDeviceProxy * device = FindCommissioneeDevice(mgr->GetSessionManager()->GetSecureSession(session)->GetPeerNodeId()); + CommissioneeDeviceProxy * device = + FindCommissioneeDevice(mSystemState->SessionMgr()->GetSecureSession(session)->GetPeerNodeId()); VerifyOrReturn(device != nullptr, ChipLogDetail(Controller, "OnNewConnection was called for unknown device, ignoring it.")); device->OnNewConnection(session); } -void DeviceCommissioner::OnConnectionExpired(SessionHandle session, Messaging::ExchangeManager * mgr) +void DeviceCommissioner::OnSessionReleased(SessionHandle session) { VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnConnectionExpired was called in incorrect state")); CommissioneeDeviceProxy * device = FindCommissioneeDevice(session); VerifyOrReturn(device != nullptr, ChipLogDetail(Controller, "OnConnectionExpired was called for unknown device, ignoring it.")); - device->OnConnectionExpired(session); + device->OnSessionReleased(session); } CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(SessionHandle session) diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 8cf10ea0f8dbb8..29215884e7f3dc 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -187,7 +186,7 @@ typedef void (*OnOpenCommissioningWindow)(void * context, NodeId deviceId, CHIP_ * and device pairing information for individual devices). Alternatively, this class can retrieve the * relevant information when the application tries to communicate with the device */ -class DLL_EXPORT DeviceController : public Messaging::ExchangeMgrDelegate, +class DLL_EXPORT DeviceController : public SessionReleaseDelegate, #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD public AbstractDnssdDiscoveryController, #endif @@ -376,9 +375,8 @@ class DLL_EXPORT DeviceController : public Messaging::ExchangeMgrDelegate, uint16_t mVendorId; - //////////// ExchangeMgrDelegate Implementation /////////////// - void OnNewConnection(SessionHandle session, Messaging::ExchangeManager * mgr) override {} - void OnConnectionExpired(SessionHandle session, Messaging::ExchangeManager * mgr) override; + //////////// SessionReleaseDelegate Implementation /////////////// + void OnSessionReleased(SessionHandle session) override; #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD //////////// ResolverDelegate Implementation /////////////// @@ -412,12 +410,12 @@ class DLL_EXPORT DeviceController : public Messaging::ExchangeMgrDelegate, * will be stored. */ class DLL_EXPORT DeviceCommissioner : public DeviceController, + public SessionCreationDelegate, #if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY // make this commissioner discoverable public Protocols::UserDirectedCommissioning::InstanceNameResolver, public Protocols::UserDirectedCommissioning::UserConfirmationProvider, #endif public SessionEstablishmentDelegate - { public: DeviceCommissioner(); @@ -624,9 +622,10 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, void OnSessionEstablishmentTimeout(); - //////////// ExchangeMgrDelegate Implementation /////////////// - void OnNewConnection(SessionHandle session, Messaging::ExchangeManager * mgr) override; - void OnConnectionExpired(SessionHandle session, Messaging::ExchangeManager * mgr) override; + //////////// SessionCreationDelegate Implementation /////////////// + void OnNewSession(SessionHandle session) override; + //////////// SessionReleaseDelegate Implementation /////////////// + void OnSessionReleased(SessionHandle session) override; static void OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState); diff --git a/src/controller/CommissioneeDeviceProxy.cpp b/src/controller/CommissioneeDeviceProxy.cpp index 2cf52d31dccc0d..02394d64090137 100644 --- a/src/controller/CommissioneeDeviceProxy.cpp +++ b/src/controller/CommissioneeDeviceProxy.cpp @@ -92,7 +92,7 @@ void CommissioneeDeviceProxy::OnNewConnection(SessionHandle session) mSecureSession.SetValue(session); } -void CommissioneeDeviceProxy::OnConnectionExpired(SessionHandle session) +void CommissioneeDeviceProxy::OnSessionReleased(SessionHandle session) { VerifyOrReturn(mSecureSession.HasValue() && mSecureSession.Value() == session, ChipLogDetail(Controller, "Connection expired, but it doesn't match the current session")); diff --git a/src/controller/CommissioneeDeviceProxy.h b/src/controller/CommissioneeDeviceProxy.h index 64d4ae27b9dcf4..e4a62c0d82cd68 100644 --- a/src/controller/CommissioneeDeviceProxy.h +++ b/src/controller/CommissioneeDeviceProxy.h @@ -79,7 +79,7 @@ struct ControllerDeviceInitParams Controller::DeviceControllerInteractionModelDelegate * imDelegate = nullptr; }; -class CommissioneeDeviceProxy : public DeviceProxy +class CommissioneeDeviceProxy : public DeviceProxy, public SessionReleaseDelegate { public: ~CommissioneeDeviceProxy(); @@ -165,13 +165,13 @@ class CommissioneeDeviceProxy : public DeviceProxy /** * @brief - * Called when a connection is closing. + * Called when the associated session is released * * The receiver should release all resources associated with the connection. * * @param session A handle to the secure session */ - void OnConnectionExpired(SessionHandle session) override; + void OnSessionReleased(SessionHandle session) override; /** * In case there exists an open session to the device, mark it as expired. diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index 763d6a787ea309..aec1d89e7560ef 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -235,7 +235,7 @@ void TestReadInteraction::TestReadTimeout(nlTestSuite * apSuite, void * apContex NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 1); NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 2); - ctx.GetExchangeManager().OnConnectionExpired(ctx.GetSessionBobToAlice()); + ctx.GetExchangeManager().ExpireExchangesForSession(ctx.GetSessionBobToAlice()); ctx.DrainAndServiceIO(); @@ -251,7 +251,7 @@ void TestReadInteraction::TestReadTimeout(nlTestSuite * apSuite, void * apContex chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); ctx.DrainAndServiceIO(); - ctx.GetExchangeManager().OnConnectionExpired(ctx.GetSessionAliceToBob()); + ctx.GetExchangeManager().ExpireExchangesForSession(ctx.GetSessionAliceToBob()); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadHandlers() == 0); diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index fb9a34afea16c7..ba5208013b410c 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -2673,6 +2673,24 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; "Please enable at least one of CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_FAST_COPY_SUPPORT or CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_FLEXIBLE_COPY_SUPPORT" #endif +/** + * @def CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES + * + * @brief Defines the max number of SessionCreationDelegates + */ +#ifndef CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES +#define CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES 2 +#endif + +/** + * @def CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES + * + * @brief Defines the max number of SessionReleaseDelegate + */ +#ifndef CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES +#define CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES 2 +#endif + /** * @} */ diff --git a/src/messaging/BUILD.gn b/src/messaging/BUILD.gn index 6b3347ea2ff11e..b96b98b823dbeb 100644 --- a/src/messaging/BUILD.gn +++ b/src/messaging/BUILD.gn @@ -42,7 +42,6 @@ static_library("messaging") { "ExchangeMessageDispatch.h", "ExchangeMgr.cpp", "ExchangeMgr.h", - "ExchangeMgrDelegate.h", "Flags.h", "ReliableMessageContext.cpp", "ReliableMessageContext.h", diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index d562331a9703e1..a8f986b5ab50b7 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -59,7 +59,7 @@ namespace Messaging { * prior to use. * */ -ExchangeManager::ExchangeManager() : mDelegate(nullptr), mReliableMessageMgr(mContextPool) +ExchangeManager::ExchangeManager() : mReliableMessageMgr(mContextPool) { mState = State::kState_NotInitialized; } @@ -83,7 +83,8 @@ CHIP_ERROR ExchangeManager::Init(SessionManager * sessionManager) handler.Reset(); } - sessionManager->SetDelegate(this); + sessionManager->RegisterReleaseDelegate(*this); + sessionManager->SetMessageDelegate(this); mReliableMessageMgr.Init(sessionManager->SystemLayer(), sessionManager); ReturnErrorOnFailure(mDefaultExchangeDispatch.Init(mSessionManager)); @@ -105,7 +106,8 @@ CHIP_ERROR ExchangeManager::Shutdown() if (mSessionManager != nullptr) { - mSessionManager->SetDelegate(nullptr); + mSessionManager->SetMessageDelegate(nullptr); + mSessionManager->UnregisterReleaseDelegate(*this); mSessionManager = nullptr; } @@ -152,16 +154,6 @@ CHIP_ERROR ExchangeManager::UnregisterUnsolicitedMessageHandlerForType(Protocols return UnregisterUMH(protocolId, static_cast(msgType)); } -void ExchangeManager::OnReceiveError(CHIP_ERROR error, const Transport::PeerAddress & source) -{ -#if CHIP_ERROR_LOGGING - char srcAddressStr[Transport::PeerAddress::kMaxToStringSize]; - source.ToString(srcAddressStr); - - ChipLogError(ExchangeManager, "Error receiving message from %s: %s", srcAddressStr, ErrorStr(error)); -#endif // CHIP_ERROR_LOGGING -} - CHIP_ERROR ExchangeManager::RegisterUMH(Protocols::Id protocolId, int16_t msgType, ExchangeDelegate * delegate) { UnsolicitedMessageHandler * selected = nullptr; @@ -326,21 +318,13 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const } } -void ExchangeManager::OnNewConnection(SessionHandle session) +void ExchangeManager::OnSessionReleased(SessionHandle session) { - if (mDelegate != nullptr) - { - mDelegate->OnNewConnection(session, this); - } + ExpireExchangesForSession(session); } -void ExchangeManager::OnConnectionExpired(SessionHandle session) +void ExchangeManager::ExpireExchangesForSession(SessionHandle session) { - if (mDelegate != nullptr) - { - mDelegate->OnConnectionExpired(session, this); - } - mContextPool.ForEachActiveObject([&](auto * ec) { if (ec->mSession.HasValue() && ec->mSession.Value() == session) { diff --git a/src/messaging/ExchangeMgr.h b/src/messaging/ExchangeMgr.h index c4a93178e12342..7981b150daeeb5 100644 --- a/src/messaging/ExchangeMgr.h +++ b/src/messaging/ExchangeMgr.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -50,7 +49,7 @@ static constexpr int16_t kAnyMessageType = -1; * It works on be behalf of higher layers, creating ExchangeContexts and * handling the registration/unregistration of unsolicited message handlers. */ -class DLL_EXPORT ExchangeManager : public SessionManagerDelegate +class DLL_EXPORT ExchangeManager : public SessionMessageDelegate, public SessionReleaseDelegate { friend class ExchangeContext; @@ -184,10 +183,6 @@ class DLL_EXPORT ExchangeManager : public SessionManagerDelegate */ void CloseAllContextsForDelegate(const ExchangeDelegate * delegate); - // TODO Store more than one delegate and add API to query delegates to check if incoming messages are for them. - // Do the same for the UMHs as well - void SetDelegate(ExchangeMgrDelegate * delegate) { mDelegate = delegate; } - SessionManager * GetSessionManager() const { return mSessionManager; } ReliableMessageMgr * GetReliableMessageMgr() { return &mReliableMessageMgr; }; @@ -198,6 +193,10 @@ class DLL_EXPORT ExchangeManager : public SessionManagerDelegate size_t GetNumActiveExchanges() { return mContextPool.Allocated(); } + // TODO: this should be test only, after OnSessionReleased is move to SessionHandle within the exchange context + // Expire all exchanges associated with the given session + void ExpireExchangesForSession(SessionHandle session); + private: enum class State { @@ -230,7 +229,6 @@ class DLL_EXPORT ExchangeManager : public SessionManagerDelegate uint16_t mNextKeyId; State mState; - ExchangeMgrDelegate * mDelegate; SessionManager * mSessionManager; ReliableMessageMgr mReliableMessageMgr; @@ -245,17 +243,11 @@ class DLL_EXPORT ExchangeManager : public SessionManagerDelegate CHIP_ERROR RegisterUMH(Protocols::Id protocolId, int16_t msgType, ExchangeDelegate * delegate); CHIP_ERROR UnregisterUMH(Protocols::Id protocolId, int16_t msgType); - void OnReceiveError(CHIP_ERROR error, const Transport::PeerAddress & source) override; - void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, SessionHandle session, const Transport::PeerAddress & source, DuplicateMessage isDuplicate, System::PacketBufferHandle && msgBuf) override; - void OnNewConnection(SessionHandle session) override; -#if CHIP_CONFIG_TEST -public: // Allow OnConnectionExpired to be called directly from tests. -#endif // CHIP_CONFIG_TEST - void OnConnectionExpired(SessionHandle session) override; + void OnSessionReleased(SessionHandle session) override; }; } // namespace Messaging diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index c7a80b9a7a7466..52ee2995a161d3 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -124,7 +124,7 @@ void CheckSessionExpirationBasics(nlTestSuite * inSuite, void * inContext) ExchangeContext * ec1 = ctx.NewExchangeToBob(&sendDelegate); // Expire the session this exchange is supposedly on. - ctx.GetExchangeManager().OnConnectionExpired(ec1->GetSessionHandle()); + ctx.GetExchangeManager().ExpireExchangesForSession(ec1->GetSessionHandle()); MockAppDelegate receiveDelegate; CHIP_ERROR err = @@ -154,7 +154,7 @@ void CheckSessionExpirationTimeout(nlTestSuite * inSuite, void * inContext) // Expire the session this exchange is supposedly on. This should close the // exchange. - ctx.GetExchangeManager().OnConnectionExpired(ec1->GetSessionHandle()); + ctx.GetExchangeManager().ExpireExchangesForSession(ec1->GetSessionHandle()); NL_TEST_ASSERT(inSuite, sendDelegate.IsOnResponseTimeoutCalled); } diff --git a/src/transport/BUILD.gn b/src/transport/BUILD.gn index f7fd12ce73e8c0..e85742aff382a4 100644 --- a/src/transport/BUILD.gn +++ b/src/transport/BUILD.gn @@ -26,18 +26,23 @@ static_library("transport") { "FabricTable.h", "MessageCounter.cpp", "MessageCounter.h", + "MessageCounterManagerInterface.h", "PeerMessageCounter.h", "SecureMessageCodec.cpp", "SecureMessageCodec.h", "SecureSession.h", "SecureSessionTable.h", + "SessionDelegate.h", "SessionHandle.cpp", "SessionHandle.h", "SessionManager.cpp", "SessionManager.h", + "SessionMessageCounter.h", + "SessionMessageDelegate.h", "TransportMgr.h", "TransportMgrBase.cpp", "TransportMgrBase.h", + "UnauthenticatedSessionTable.h", ] cflags = [ "-Wconversion" ] diff --git a/src/messaging/ExchangeMgrDelegate.h b/src/transport/SessionDelegate.h similarity index 55% rename from src/messaging/ExchangeMgrDelegate.h rename to src/transport/SessionDelegate.h index 61de9cd1ed94d6..893b063071ba53 100644 --- a/src/messaging/ExchangeMgrDelegate.h +++ b/src/transport/SessionDelegate.h @@ -1,5 +1,4 @@ /* - * * Copyright (c) 2021 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,45 +14,38 @@ * limitations under the License. */ -/** - * @file - * This file defines the classes corresponding to CHIP Exchange Manager Delegate. - * - */ - #pragma once -#include -#include +#include namespace chip { -namespace Messaging { - -class ExchangeManager; -class DLL_EXPORT ExchangeMgrDelegate +class DLL_EXPORT SessionCreationDelegate { public: - virtual ~ExchangeMgrDelegate() {} + virtual ~SessionCreationDelegate() {} /** * @brief - * Called when a new pairing is being established + * Called when a new session is being established * * @param session The handle to the secure session - * @param mgr A pointer to the ExchangeManager */ - virtual void OnNewConnection(SessionHandle session, ExchangeManager * mgr) {} + virtual void OnNewSession(SessionHandle session) = 0; +}; + +class DLL_EXPORT SessionReleaseDelegate +{ +public: + virtual ~SessionReleaseDelegate() {} /** * @brief - * Called when a connection is closing + * Called when a session is releasing * * @param session The handle to the secure session - * @param mgr A pointer to the ExchangeManager */ - virtual void OnConnectionExpired(SessionHandle session, ExchangeManager * mgr) {} + virtual void OnSessionReleased(SessionHandle session) = 0; }; -} // namespace Messaging } // namespace chip diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 94585233b723fa..c3c16b0d505cf6 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -288,12 +288,12 @@ CHIP_ERROR SessionManager::NewPairing(const Optional & p ReturnErrorOnFailure(pairing->DeriveSecureSession(session->GetCryptoContext(), direction)); - if (mCB != nullptr) - { - session->GetSessionMessageCounter().GetPeerMessageCounter().SetCounter(pairing->GetPeerCounter()); - mCB->OnNewConnection( - SessionHandle(session->GetPeerNodeId(), session->GetLocalSessionId(), session->GetPeerSessionId(), fabric)); - } + session->GetSessionMessageCounter().GetPeerMessageCounter().SetCounter(pairing->GetPeerCounter()); + SessionHandle sessionHandle(session->GetPeerNodeId(), session->GetLocalSessionId(), session->GetPeerSessionId(), fabric); + mSessionCreationDelegates.ForEachActiveObject([&](std::reference_wrapper * cb) { + cb->get().OnNewSession(sessionHandle); + return true; + }); return CHIP_NO_ERROR; } @@ -348,13 +348,13 @@ void SessionManager::MessageDispatch(const PacketHeader & packetHeader, const Tr } Transport::UnauthenticatedSessionHandle session = optionalSession.Value(); - SessionManagerDelegate::DuplicateMessage isDuplicate = SessionManagerDelegate::DuplicateMessage::No; + SessionMessageDelegate::DuplicateMessage isDuplicate = SessionMessageDelegate::DuplicateMessage::No; // Verify message counter CHIP_ERROR err = session->GetPeerMessageCounter().VerifyOrTrustFirst(packetHeader.GetMessageCounter()); if (err == CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED) { - isDuplicate = SessionManagerDelegate::DuplicateMessage::Yes; + isDuplicate = SessionMessageDelegate::DuplicateMessage::Yes; err = CHIP_NO_ERROR; } VerifyOrDie(err == CHIP_NO_ERROR); @@ -364,7 +364,7 @@ void SessionManager::MessageDispatch(const PacketHeader & packetHeader, const Tr PayloadHeader payloadHeader; ReturnOnFailure(payloadHeader.DecodeAndConsume(msg)); - if (isDuplicate == SessionManagerDelegate::DuplicateMessage::Yes) + if (isDuplicate == SessionMessageDelegate::DuplicateMessage::Yes) { ChipLogDetail(Inet, "Received a duplicate message with MessageCounter:" ChipLogFormatMessageCounter @@ -389,35 +389,42 @@ void SessionManager::SecureUnicastMessageDispatch(const PacketHeader & packetHea PayloadHeader payloadHeader; - SessionManagerDelegate::DuplicateMessage isDuplicate = SessionManagerDelegate::DuplicateMessage::No; + SessionMessageDelegate::DuplicateMessage isDuplicate = SessionMessageDelegate::DuplicateMessage::No; - VerifyOrExit(!msg.IsNull(), ChipLogError(Inet, "Secure transport received NULL packet, discarding")); + if (msg.IsNull()) + { + ChipLogError(Inet, "Secure transport received NULL packet, discarding"); + return; + } if (session == nullptr) { ChipLogError(Inet, "Data received on an unknown connection (%d). Dropping it!!", packetHeader.GetSessionId()); - ExitNow(err = CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER); + return; } // Decrypt and verify the message before message counter verification or any further processing. - VerifyOrExit(CHIP_NO_ERROR == SecureMessageCodec::Decrypt(session, payloadHeader, packetHeader, msg), - ChipLogError(Inet, "Secure transport received message, but failed to decode/authenticate it, discarding")); + if (SecureMessageCodec::Decrypt(session, payloadHeader, packetHeader, msg) != CHIP_NO_ERROR) + { + ChipLogError(Inet, "Secure transport received message, but failed to decode/authenticate it, discarding"); + return; + } err = session->GetSessionMessageCounter().GetPeerMessageCounter().Verify(packetHeader.GetMessageCounter()); if (err == CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED) { - isDuplicate = SessionManagerDelegate::DuplicateMessage::Yes; + isDuplicate = SessionMessageDelegate::DuplicateMessage::Yes; err = CHIP_NO_ERROR; } if (err != CHIP_NO_ERROR) { ChipLogError(Inet, "Message counter verify failed, err = %" CHIP_ERROR_FORMAT, err.Format()); + return; } - SuccessOrExit(err); mSecureSessions.MarkSessionActive(session); - if (isDuplicate == SessionManagerDelegate::DuplicateMessage::Yes && !payloadHeader.NeedsAck()) + if (isDuplicate == SessionMessageDelegate::DuplicateMessage::Yes && !payloadHeader.NeedsAck()) { ChipLogDetail(Inet, "Received a duplicate message with MessageCounter:" ChipLogFormatMessageCounter @@ -427,7 +434,7 @@ void SessionManager::SecureUnicastMessageDispatch(const PacketHeader & packetHea { // If it's a duplicate message, but doesn't require an ack, let's drop it right here to save CPU // cycles on further message processing. - ExitNow(err = CHIP_NO_ERROR); + return; } } @@ -447,30 +454,27 @@ void SessionManager::SecureUnicastMessageDispatch(const PacketHeader & packetHea session->GetFabricIndex()); mCB->OnMessageReceived(packetHeader, payloadHeader, sessionHandle, peerAddress, isDuplicate, std::move(msg)); } - -exit: - if (err != CHIP_NO_ERROR && mCB != nullptr) - { - mCB->OnReceiveError(err, peerAddress); - } } void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msg) { - CHIP_ERROR err = CHIP_NO_ERROR; PayloadHeader payloadHeader; - SessionManagerDelegate::DuplicateMessage isDuplicate = SessionManagerDelegate::DuplicateMessage::No; + SessionMessageDelegate::DuplicateMessage isDuplicate = SessionMessageDelegate::DuplicateMessage::No; FabricIndex fabricIndex = 0; // TODO : remove initialization once GroupDataProvider->Decrypt is implemented // Credentials::GroupDataProvider * groups = Credentials::GetGroupDataProvider(); - VerifyOrExit(!msg.IsNull(), ChipLogError(Inet, "Secure transport received NULL packet, discarding")); + if (!msg.IsNull()) + { + ChipLogError(Inet, "Secure transport received NULL packet, discarding"); + return; + } // Check if Message Header is valid first if (!(packetHeader.IsValidMCSPMsg() || packetHeader.IsValidGroupMsg())) { ChipLogError(Inet, "Invalid condition found in packet header"); - ExitNow(err = CHIP_ERROR_INCORRECT_STATE); + return; } // Trial decryption with GroupDataProvider. TODO: Implement the GroupDataProvider Class @@ -487,20 +491,20 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade // MCSP processing.. // } - ExitNow(err = CHIP_NO_ERROR); + return; } // Group Messages should never send an Ack if (payloadHeader.NeedsAck()) { ChipLogError(Inet, "Unexpected ACK requested for group message"); - ExitNow(err = CHIP_ERROR_INCORRECT_STATE); + return; } // TODO: Handle Group message counter here spec 4.7.3 // spec 4.5.1.2 for msg counter - if (isDuplicate == SessionManagerDelegate::DuplicateMessage::Yes) + if (isDuplicate == SessionMessageDelegate::DuplicateMessage::Yes) { ChipLogDetail(Inet, "Received a duplicate message with MessageCounter:" ChipLogFormatMessageCounter @@ -508,7 +512,7 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade packetHeader.GetMessageCounter(), ChipLogValueExchangeIdFromReceivedHeader(payloadHeader)); // If it's a duplicate message, let's drop it right here to save CPU cycles - ExitNow(err = CHIP_NO_ERROR); + return; } // TODO: Commit Group Message Counter @@ -518,12 +522,6 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade SessionHandle session(packetHeader.GetSourceNodeId().Value(), packetHeader.GetDestinationGroupId().Value(), fabricIndex); mCB->OnMessageReceived(packetHeader, payloadHeader, session, peerAddress, isDuplicate, std::move(msg)); } - -exit: - if (err != CHIP_NO_ERROR && mCB != nullptr) - { - mCB->OnReceiveError(err, peerAddress); - } } void SessionManager::HandleConnectionExpired(const Transport::SecureSession & session) @@ -531,11 +529,12 @@ void SessionManager::HandleConnectionExpired(const Transport::SecureSession & se ChipLogDetail(Inet, "Marking old secure session for device 0x" ChipLogFormatX64 " as expired", ChipLogValueX64(session.GetPeerNodeId())); - if (mCB != nullptr) - { - mCB->OnConnectionExpired(SessionHandle(session.GetPeerNodeId(), session.GetLocalSessionId(), session.GetPeerSessionId(), - session.GetFabricIndex())); - } + SessionHandle sessionHandle(session.GetPeerNodeId(), session.GetLocalSessionId(), session.GetPeerSessionId(), + session.GetFabricIndex()); + mSessionReleaseDelegates.ForEachActiveObject([&](std::reference_wrapper * cb) { + cb->get().OnSessionReleased(sessionHandle); + return true; + }); mTransportMgr->Disconnect(session.GetPeerAddress()); } diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index 0248623ce58720..490ac37e6715a6 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -35,7 +35,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -113,67 +115,6 @@ class EncryptedPacketBufferHandle final : private System::PacketBufferHandle EncryptedPacketBufferHandle(PacketBufferHandle && aBuffer) : PacketBufferHandle(std::move(aBuffer)) {} }; -/** - * @brief - * This class provides a skeleton for the callback functions. The functions will be - * called by SecureSssionMgrBase object on specific events. If the user of SessionManager - * is interested in receiving these callbacks, they can specialize this class and handle - * each trigger in their implementation of this class. - */ -class DLL_EXPORT SessionManagerDelegate -{ -public: - enum class DuplicateMessage : uint8_t - { - Yes, - No, - }; - - /** - * @brief - * Called when a new message is received. The function must internally release the - * msgBuf after processing it. - * - * @param packetHeader The message header - * @param payloadHeader The payload header - * @param session The handle to the secure session - * @param source The sender's address - * @param isDuplicate The message is a duplicate of previously received message - * @param msgBuf The received message - */ - virtual void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, SessionHandle session, - const Transport::PeerAddress & source, DuplicateMessage isDuplicate, - System::PacketBufferHandle && msgBuf) - {} - - /** - * @brief - * Called when received message processing resulted in error - * - * @param error error code - * @param source network entity that sent the message - */ - virtual void OnReceiveError(CHIP_ERROR error, const Transport::PeerAddress & source) {} - - /** - * @brief - * Called when a new pairing is being established - * - * @param session The handle to the secure session - */ - virtual void OnNewConnection(SessionHandle session) {} - - /** - * @brief - * Called when a new connection is closing - * - * @param session The handle to the secure session - */ - virtual void OnConnectionExpired(SessionHandle session) {} - - virtual ~SessionManagerDelegate() {} -}; - class DLL_EXPORT SessionManager : public TransportMgrDelegate { public: @@ -202,14 +143,59 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate Transport::SecureSession * GetSecureSession(SessionHandle session); - /** - * @brief - * Set the callback object. - * - * @details - * Release if there was an existing callback object - */ - void SetDelegate(SessionManagerDelegate * cb) { mCB = cb; } + /// @brief Set the delegate for handling incoming messages. There can be only one message delegate (probably the + /// ExchangeManager) + void SetMessageDelegate(SessionMessageDelegate * cb) { mCB = cb; } + + /// @brief Set the delegate for handling session creation. + void RegisterCreationDelegate(SessionCreationDelegate & cb) + { +#ifndef NDEBUG + mSessionCreationDelegates.ForEachActiveObject([&](std::reference_wrapper * i) { + VerifyOrDie(std::addressof(cb) != std::addressof(i->get())); + return true; + }); +#endif + std::reference_wrapper * slot = mSessionCreationDelegates.CreateObject(cb); + VerifyOrDie(slot != nullptr); + } + + void UnregisterCreationDelegate(SessionCreationDelegate & cb) + { + mSessionCreationDelegates.ForEachActiveObject([&](std::reference_wrapper * i) { + if (std::addressof(cb) == std::addressof(i->get())) + { + mSessionCreationDelegates.ReleaseObject(i); + return false; + } + return true; + }); + } + + /// @brief Set the delegate for handling session release. + void RegisterReleaseDelegate(SessionReleaseDelegate & cb) + { +#ifndef NDEBUG + mSessionReleaseDelegates.ForEachActiveObject([&](std::reference_wrapper * i) { + VerifyOrDie(std::addressof(cb) != std::addressof(i->get())); + return true; + }); +#endif + std::reference_wrapper * slot = mSessionReleaseDelegates.CreateObject(cb); + VerifyOrDie(slot != nullptr); + } + + void UnregisterReleaseDelegate(SessionReleaseDelegate & cb) + { + mSessionReleaseDelegates.ForEachActiveObject([&](std::reference_wrapper * i) { + if (std::addressof(cb) == std::addressof(i->get())) + { + mSessionReleaseDelegates.ReleaseObject(i); + return false; + } + return true; + }); + } /** * @brief @@ -292,7 +278,16 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate Transport::SecureSessionTable mSecureSessions; // < Active connections to other peers State mState; // < Initialization state of the object - SessionManagerDelegate * mCB = nullptr; + SessionMessageDelegate * mCB = nullptr; + BitMapObjectPool, CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES> + mSessionCreationDelegates; + + // TODO: This is a temporary solution to release sessions, in the near future, SessionReleaseDelegate will be + // directly associated with the every SessionHandle. Then the callback function is called on over the handle + // delegate directly, in order to prevent dangling handles. + BitMapObjectPool, CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES> + mSessionReleaseDelegates; + TransportMgrBase * mTransportMgr = nullptr; Transport::MessageCounterManagerInterface * mMessageCounterManager = nullptr; @@ -324,6 +319,8 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate void MessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msg); + void OnReceiveError(CHIP_ERROR error, const Transport::PeerAddress & source); + static bool IsControlMessage(PayloadHeader & payloadHeader) { return payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::MsgCounterSyncReq) || diff --git a/src/transport/SessionMessageDelegate.h b/src/transport/SessionMessageDelegate.h new file mode 100644 index 00000000000000..afdae243971fef --- /dev/null +++ b/src/transport/SessionMessageDelegate.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 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 + +#include + +namespace chip { + +/** + * @brief + * This class provides a skeleton for the callback functions. The functions will be + * called by SecureSssionMgrBase object on specific events. If the user of SessionManager + * is interested in receiving these callbacks, they can specialize this class and handle + * each trigger in their implementation of this class. + */ +class DLL_EXPORT SessionMessageDelegate +{ +public: + virtual ~SessionMessageDelegate() {} + + enum class DuplicateMessage : uint8_t + { + Yes, + No, + }; + + /** + * @brief + * Called when a new message is received. The function must internally release the + * msgBuf after processing it. + * + * @param packetHeader The message header + * @param payloadHeader The payload header + * @param session The handle to the secure session + * @param source The sender's address + * @param isDuplicate The message is a duplicate of previously received message + * @param msgBuf The received message + */ + virtual void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, SessionHandle session, + const Transport::PeerAddress & source, DuplicateMessage isDuplicate, + System::PacketBufferHandle && msgBuf) = 0; +}; + +} // namespace chip diff --git a/src/transport/tests/TestSessionManager.cpp b/src/transport/tests/TestSessionManager.cpp index 5c7a9d7ebfda23..b3270936132f87 100644 --- a/src/transport/tests/TestSessionManager.cpp +++ b/src/transport/tests/TestSessionManager.cpp @@ -59,7 +59,7 @@ constexpr NodeId kDestinationNodeId = 111222333; const char LARGE_PAYLOAD[kMaxAppMessageLen + 1] = "test message"; -class TestSessMgrCallback : public SessionManagerDelegate +class TestSessMgrCallback : public SessionCreationDelegate, public SessionReleaseDelegate, public SessionMessageDelegate { public: void OnMessageReceived(const PacketHeader & header, const PayloadHeader & payloadHeader, SessionHandle session, @@ -84,7 +84,7 @@ class TestSessMgrCallback : public SessionManagerDelegate ReceiveHandlerCallCount++; } - void OnNewConnection(SessionHandle session) override + void OnNewSession(SessionHandle session) override { // Preset the MessageCounter if (NewConnectionHandlerCallCount == 0) @@ -93,7 +93,8 @@ class TestSessMgrCallback : public SessionManagerDelegate mLocalToRemoteSession.SetValue(session); NewConnectionHandlerCallCount++; } - void OnConnectionExpired(SessionHandle session) override { mOldConnectionDropped = true; } + + void OnSessionReleased(SessionHandle session) override { mOldConnectionDropped = true; } bool mOldConnectionDropped = false; @@ -106,8 +107,6 @@ class TestSessMgrCallback : public SessionManagerDelegate bool LargeMessageSent = false; }; -TestSessMgrCallback callback; - void CheckSimpleInitTest(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); @@ -131,6 +130,7 @@ void CheckMessageTest(nlTestSuite * inSuite, void * inContext) uint16_t payload_len = sizeof(PAYLOAD); + TestSessMgrCallback callback; callback.LargeMessageSent = false; chip::System::PacketBufferHandle buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, payload_len); @@ -152,7 +152,8 @@ void CheckMessageTest(nlTestSuite * inSuite, void * inContext) callback.mSuite = inSuite; - sessionManager.SetDelegate(&callback); + sessionManager.RegisterCreationDelegate(callback); + sessionManager.SetMessageDelegate(&callback); Optional peer(Transport::PeerAddress::UDP(addr, CHIP_PORT)); @@ -218,6 +219,7 @@ void SendEncryptedPacketTest(nlTestSuite * inSuite, void * inContext) uint16_t payload_len = sizeof(PAYLOAD); + TestSessMgrCallback callback; callback.LargeMessageSent = false; chip::System::PacketBufferHandle buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, payload_len); @@ -239,7 +241,8 @@ void SendEncryptedPacketTest(nlTestSuite * inSuite, void * inContext) callback.mSuite = inSuite; - sessionManager.SetDelegate(&callback); + sessionManager.RegisterCreationDelegate(callback); + sessionManager.SetMessageDelegate(&callback); Optional peer(Transport::PeerAddress::UDP(addr, CHIP_PORT)); @@ -291,6 +294,7 @@ void SendBadEncryptedPacketTest(nlTestSuite * inSuite, void * inContext) uint16_t payload_len = sizeof(PAYLOAD); + TestSessMgrCallback callback; callback.LargeMessageSent = false; chip::System::PacketBufferHandle buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, payload_len); @@ -312,7 +316,8 @@ void SendBadEncryptedPacketTest(nlTestSuite * inSuite, void * inContext) callback.mSuite = inSuite; - sessionManager.SetDelegate(&callback); + sessionManager.RegisterCreationDelegate(callback); + sessionManager.SetMessageDelegate(&callback); Optional peer(Transport::PeerAddress::UDP(addr, CHIP_PORT)); @@ -414,9 +419,12 @@ void StaleConnectionDropTest(nlTestSuite * inSuite, void * inContext) err = sessionManager.Init(ctx.GetInetLayer().SystemLayer(), &transportMgr, &gMessageCounterManager); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + TestSessMgrCallback callback; callback.mSuite = inSuite; - sessionManager.SetDelegate(&callback); + sessionManager.RegisterCreationDelegate(callback); + sessionManager.RegisterReleaseDelegate(callback); + sessionManager.SetMessageDelegate(&callback); Optional peer(Transport::PeerAddress::UDP(addr, CHIP_PORT)); From e568d7027fe64f8ac77a27adfe5cfe561ced3cef Mon Sep 17 00:00:00 2001 From: JasonLiuZhuoCheng Date: Wed, 17 Nov 2021 11:58:57 -0500 Subject: [PATCH 2/5] finish generating write attributes (#11804) * finish generating write attributes * refactor for comments * resolve comments * swap public and static keyword --- src/controller/java/BUILD.gn | 2 + .../java/templates/ClusterInfo-java.zapt | 53 +- .../ClusterInfo-read-interaction.zapt | 45 + .../ClusterInfo-write-interaction.zapt | 43 + src/controller/java/templates/templates.json | 10 + .../devicecontroller/ClusterInfoMapping.java | 6711 +---------------- .../devicecontroller/ClusterReadMapping.java | 6445 ++++++++++++++++ .../devicecontroller/ClusterWriteMapping.java | 1684 +++++ 8 files changed, 8364 insertions(+), 6629 deletions(-) create mode 100644 src/controller/java/templates/ClusterInfo-read-interaction.zapt create mode 100644 src/controller/java/templates/ClusterInfo-write-interaction.zapt create mode 100644 src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java create mode 100644 src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 6a1efd413ca8ea..52e7ac01b344f9 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -81,6 +81,8 @@ android_library("java") { "src/chip/devicecontroller/PaseVerifierParams.java", "zap-generated/chip/devicecontroller/ChipClusters.java", "zap-generated/chip/devicecontroller/ClusterInfoMapping.java", + "zap-generated/chip/devicecontroller/ClusterReadMapping.java", + "zap-generated/chip/devicecontroller/ClusterWriteMapping.java", ] javac_flags = [ "-Xlint:deprecation" ] diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index 28c5f98bebdd4d..05ea012ce6985c 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -15,11 +15,12 @@ import chip.clusterinfo.DelegatedClusterCallback; import chip.clusterinfo.ClusterCommandCallback; import chip.clusterinfo.CommandResponseInfo; import chip.devicecontroller.ChipClusters.DefaultClusterCallback; - +import chip.devicecontroller.ClusterReadMapping; +import chip.devicecontroller.ClusterWriteMapping; public class ClusterInfoMapping { - public class DelegatedCharStringAttributeCallback implements ChipClusters.CharStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCharStringAttributeCallback implements ChipClusters.CharStringAttributeCallback, DelegatedClusterCallback { /** Indicates a successful read for a CHAR_STRING attribute. */ private ClusterCommandCallback callback; @@ -42,7 +43,7 @@ public class ClusterInfoMapping { } } - public class DelegatedOctetStringAttributeCallback implements ChipClusters.OctetStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedOctetStringAttributeCallback implements ChipClusters.OctetStringAttributeCallback, DelegatedClusterCallback { /** Indicates a successful read for an OCTET_STRING attribute. */ private ClusterCommandCallback callback; @@ -65,7 +66,7 @@ public class ClusterInfoMapping { } } - public class DelegatedIntegerAttributeCallback implements ChipClusters.IntegerAttributeCallback, DelegatedClusterCallback { + public static class DelegatedIntegerAttributeCallback implements ChipClusters.IntegerAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -87,7 +88,7 @@ public class ClusterInfoMapping { } } - public class DelegatedLongAttributeCallback implements ChipClusters.LongAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLongAttributeCallback implements ChipClusters.LongAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -109,7 +110,7 @@ public class ClusterInfoMapping { } } - public class DelegatedBooleanAttributeCallback implements ChipClusters.BooleanAttributeCallback, DelegatedClusterCallback { + public static class DelegatedBooleanAttributeCallback implements ChipClusters.BooleanAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -131,7 +132,7 @@ public class ClusterInfoMapping { } } - class DelegatedDefaultClusterCallback implements DefaultClusterCallback, DelegatedClusterCallback { + public static class DelegatedDefaultClusterCallback implements DefaultClusterCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -153,7 +154,7 @@ public class ClusterInfoMapping { } {{#chip_client_clusters}} {{#chip_cluster_responses}} - public class Delegated{{asUpperCamelCase name}}Callback implements ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}Callback, DelegatedClusterCallback { + public static class Delegated{{asUpperCamelCase name}}Callback implements ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}Callback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -201,7 +202,7 @@ public class ClusterInfoMapping { {{/if}} - public class Delegated{{asUpperCamelCase name}}AttributeCallback implements ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}AttributeCallback, DelegatedClusterCallback { + public static class Delegated{{asUpperCamelCase name}}AttributeCallback implements ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}AttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -261,8 +262,10 @@ public class ClusterInfoMapping { Map clusterMap = initializeClusterMap(); Map> commandMap = getCommandMap(); combineCommand(clusterMap, commandMap); - Map> readAttributeMap = getReadAttributeMap(); + Map> readAttributeMap = new ClusterReadMapping().getReadAttributeMap(); combineCommand(clusterMap, readAttributeMap); + Map> writeAttributeMap = new ClusterWriteMapping().getWriteAttributeMap(); + combineCommand(clusterMap, writeAttributeMap); return clusterMap; } @@ -334,36 +337,6 @@ public class ClusterInfoMapping { return commandMap; } - public Map> getReadAttributeMap() { - Map> readAttributeMap = new HashMap<>(); - {{#chip_client_clusters}} - Map read{{asUpperCamelCase name}}InteractionInfo = new LinkedHashMap<>(); - // read attribute - {{#chip_server_cluster_attributes}} - Map read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap(); - InteractionInfo read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).read{{asUpperCamelCase name}}Attribute( - {{#if isList}} - (ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}AttributeCallback) callback - {{else}} - (ChipClusters.{{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback) callback - {{/if}} - ); - }, - {{#if isList}} - () -> new Delegated{{asUpperCamelCase name}}AttributeCallback(), - {{else}} - () -> new Delegated{{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback(), - {{/if}} - read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams - ); - read{{asUpperCamelCase ../name}}InteractionInfo.put("read{{asUpperCamelCase name}}Attribute", read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo); - {{/chip_server_cluster_attributes}} - readAttributeMap.put("{{asLowerCamelCase name}}", read{{asUpperCamelCase name}}InteractionInfo); - {{/chip_client_clusters}} - return readAttributeMap; - } } {{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/ClusterInfo-read-interaction.zapt b/src/controller/java/templates/ClusterInfo-read-interaction.zapt new file mode 100644 index 00000000000000..564fb91719d7aa --- /dev/null +++ b/src/controller/java/templates/ClusterInfo-read-interaction.zapt @@ -0,0 +1,45 @@ +{{> header}} +{{#if (chip_has_client_clusters)}} + +package chip.devicecontroller; + +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.InteractionInfo; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ClusterReadMapping { + + public Map> getReadAttributeMap() { + Map> readAttributeMap = new HashMap<>(); + {{#chip_client_clusters}} + Map read{{asUpperCamelCase name}}InteractionInfo = new LinkedHashMap<>(); + {{#chip_server_cluster_attributes}} + Map read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap(); + InteractionInfo read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).read{{asUpperCamelCase name}}Attribute( + {{#if isList}} + (ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}AttributeCallback) callback + {{else}} + (ChipClusters.{{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback) callback + {{/if}} + ); + }, + {{#if isList}} + () -> new ClusterInfoMapping.Delegated{{asUpperCamelCase name}}AttributeCallback(), + {{else}} + () -> new ClusterInfoMapping.Delegated{{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback(), + {{/if}} + read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams + ); + read{{asUpperCamelCase ../name}}InteractionInfo.put("read{{asUpperCamelCase name}}Attribute", read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo); + {{/chip_server_cluster_attributes}} + readAttributeMap.put("{{asLowerCamelCase name}}", read{{asUpperCamelCase name}}InteractionInfo); + {{/chip_client_clusters}} + return readAttributeMap; + } +} + +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/ClusterInfo-write-interaction.zapt b/src/controller/java/templates/ClusterInfo-write-interaction.zapt new file mode 100644 index 00000000000000..265fdf4c7ab599 --- /dev/null +++ b/src/controller/java/templates/ClusterInfo-write-interaction.zapt @@ -0,0 +1,43 @@ +{{> header}} +{{#if (chip_has_client_clusters)}} + +package chip.devicecontroller; + +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.InteractionInfo; +import chip.devicecontroller.ChipClusters.DefaultClusterCallback; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ClusterWriteMapping { + public Map> getWriteAttributeMap() { + Map> writeAttributeMap = new HashMap<>(); + {{#chip_client_clusters}} + Map write{{asUpperCamelCase name}}InteractionInfo = new LinkedHashMap<>(); + {{#chip_server_cluster_attributes}} + {{#if isWritableAttribute}} + Map write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap(); + CommandParameterInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParameterInfo = new CommandParameterInfo("value", {{asJavaBasicType type}}.class); + write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams.put("value",{{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParameterInfo); + InteractionInfo write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).write{{asUpperCamelCase name}}Attribute( + (DefaultClusterCallback) callback, + ({{asJavaBoxedType type}}) + commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams + ); + write{{asUpperCamelCase ../name}}InteractionInfo.put("write{{asUpperCamelCase name}}Attribute", write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo); + {{/if}} + {{/chip_server_cluster_attributes}} + writeAttributeMap.put("{{asLowerCamelCase name}}", write{{asUpperCamelCase name}}InteractionInfo); + {{/chip_client_clusters}} + return writeAttributeMap; + } +} + +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index 9adb75e1801f2c..c0fa30fabdb32a 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -55,6 +55,16 @@ "path": "ClusterInfo-java.zapt", "name": "Cluster information mapping for Java", "output": "src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java" + }, + { + "path": "ClusterInfo-read-interaction.zapt", + "name": "Generate read interaction for cluster information map", + "output": "src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java" + }, + { + "path": "ClusterInfo-write-interaction.zapt", + "name": "Generate write interaction for cluster information map", + "output": "src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java" } ] } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index b373fd95fa0fa1..2d405e24069506 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -33,7 +33,7 @@ public class ClusterInfoMapping { - public class DelegatedCharStringAttributeCallback + public static class DelegatedCharStringAttributeCallback implements ChipClusters.CharStringAttributeCallback, DelegatedClusterCallback { /** Indicates a successful read for a CHAR_STRING attribute. */ private ClusterCommandCallback callback; @@ -57,7 +57,7 @@ public void onError(Exception error) { } } - public class DelegatedOctetStringAttributeCallback + public static class DelegatedOctetStringAttributeCallback implements ChipClusters.OctetStringAttributeCallback, DelegatedClusterCallback { /** Indicates a successful read for an OCTET_STRING attribute. */ private ClusterCommandCallback callback; @@ -81,7 +81,7 @@ public void onError(Exception error) { } } - public class DelegatedIntegerAttributeCallback + public static class DelegatedIntegerAttributeCallback implements ChipClusters.IntegerAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -104,7 +104,7 @@ public void onError(Exception error) { } } - public class DelegatedLongAttributeCallback + public static class DelegatedLongAttributeCallback implements ChipClusters.LongAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -127,7 +127,7 @@ public void onError(Exception error) { } } - public class DelegatedBooleanAttributeCallback + public static class DelegatedBooleanAttributeCallback implements ChipClusters.BooleanAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -150,7 +150,7 @@ public void onError(Exception error) { } } - class DelegatedDefaultClusterCallback + public static class DelegatedDefaultClusterCallback implements DefaultClusterCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -173,7 +173,7 @@ public void onError(Exception e) { } } - public class DelegatedGetSetupPINResponseCallback + public static class DelegatedGetSetupPINResponseCallback implements ChipClusters.AccountLoginCluster.GetSetupPINResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -197,7 +197,7 @@ public void onError(Exception error) { } } - public class DelegatedLaunchAppResponseCallback + public static class DelegatedLaunchAppResponseCallback implements ChipClusters.ApplicationLauncherCluster.LaunchAppResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -223,7 +223,7 @@ public void onError(Exception error) { } } - public class DelegatedApplicationLauncherListAttributeCallback + public static class DelegatedApplicationLauncherListAttributeCallback implements ChipClusters.ApplicationLauncherCluster.ApplicationLauncherListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -249,7 +249,7 @@ public void onError(Exception ex) { } } - public class DelegatedAudioOutputListAttributeCallback + public static class DelegatedAudioOutputListAttributeCallback implements ChipClusters.AudioOutputCluster.AudioOutputListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -277,7 +277,7 @@ public void onError(Exception ex) { } } - public class DelegatedActionListAttributeCallback + public static class DelegatedActionListAttributeCallback implements ChipClusters.BridgedActionsCluster.ActionListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -304,7 +304,7 @@ public void onError(Exception ex) { } } - public class DelegatedEndpointListAttributeCallback + public static class DelegatedEndpointListAttributeCallback implements ChipClusters.BridgedActionsCluster.EndpointListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -332,7 +332,7 @@ public void onError(Exception ex) { } } - public class DelegatedLaunchContentResponseCallback + public static class DelegatedLaunchContentResponseCallback implements ChipClusters.ContentLauncherCluster.LaunchContentResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -359,7 +359,7 @@ public void onError(Exception error) { } } - public class DelegatedLaunchURLResponseCallback + public static class DelegatedLaunchURLResponseCallback implements ChipClusters.ContentLauncherCluster.LaunchURLResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -386,7 +386,7 @@ public void onError(Exception error) { } } - public class DelegatedAcceptsHeaderListAttributeCallback + public static class DelegatedAcceptsHeaderListAttributeCallback implements ChipClusters.ContentLauncherCluster.AcceptsHeaderListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -412,7 +412,7 @@ public void onError(Exception ex) { } } - public class DelegatedSupportedStreamingTypesAttributeCallback + public static class DelegatedSupportedStreamingTypesAttributeCallback implements ChipClusters.ContentLauncherCluster.SupportedStreamingTypesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -438,7 +438,7 @@ public void onError(Exception ex) { } } - public class DelegatedDeviceListAttributeCallback + public static class DelegatedDeviceListAttributeCallback implements ChipClusters.DescriptorCluster.DeviceListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -465,7 +465,7 @@ public void onError(Exception ex) { } } - public class DelegatedServerListAttributeCallback + public static class DelegatedServerListAttributeCallback implements ChipClusters.DescriptorCluster.ServerListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -490,7 +490,7 @@ public void onError(Exception ex) { } } - public class DelegatedClientListAttributeCallback + public static class DelegatedClientListAttributeCallback implements ChipClusters.DescriptorCluster.ClientListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -515,7 +515,7 @@ public void onError(Exception ex) { } } - public class DelegatedPartsListAttributeCallback + public static class DelegatedPartsListAttributeCallback implements ChipClusters.DescriptorCluster.PartsListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -541,7 +541,7 @@ public void onError(Exception ex) { } } - public class DelegatedRetrieveLogsResponseCallback + public static class DelegatedRetrieveLogsResponseCallback implements ChipClusters.DiagnosticLogsCluster.RetrieveLogsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -572,7 +572,7 @@ public void onError(Exception error) { } } - public class DelegatedClearAllPinsResponseCallback + public static class DelegatedClearAllPinsResponseCallback implements ChipClusters.DoorLockCluster.ClearAllPinsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -596,7 +596,7 @@ public void onError(Exception error) { } } - public class DelegatedClearAllRfidsResponseCallback + public static class DelegatedClearAllRfidsResponseCallback implements ChipClusters.DoorLockCluster.ClearAllRfidsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -620,7 +620,7 @@ public void onError(Exception error) { } } - public class DelegatedClearHolidayScheduleResponseCallback + public static class DelegatedClearHolidayScheduleResponseCallback implements ChipClusters.DoorLockCluster.ClearHolidayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -644,7 +644,7 @@ public void onError(Exception error) { } } - public class DelegatedClearPinResponseCallback + public static class DelegatedClearPinResponseCallback implements ChipClusters.DoorLockCluster.ClearPinResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -667,7 +667,7 @@ public void onError(Exception error) { } } - public class DelegatedClearRfidResponseCallback + public static class DelegatedClearRfidResponseCallback implements ChipClusters.DoorLockCluster.ClearRfidResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -690,7 +690,7 @@ public void onError(Exception error) { } } - public class DelegatedClearWeekdayScheduleResponseCallback + public static class DelegatedClearWeekdayScheduleResponseCallback implements ChipClusters.DoorLockCluster.ClearWeekdayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -714,7 +714,7 @@ public void onError(Exception error) { } } - public class DelegatedClearYeardayScheduleResponseCallback + public static class DelegatedClearYeardayScheduleResponseCallback implements ChipClusters.DoorLockCluster.ClearYeardayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -738,7 +738,7 @@ public void onError(Exception error) { } } - public class DelegatedGetHolidayScheduleResponseCallback + public static class DelegatedGetHolidayScheduleResponseCallback implements ChipClusters.DoorLockCluster.GetHolidayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -778,7 +778,7 @@ public void onError(Exception error) { } } - public class DelegatedGetLogRecordResponseCallback + public static class DelegatedGetLogRecordResponseCallback implements ChipClusters.DoorLockCluster.GetLogRecordResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -822,7 +822,7 @@ public void onError(Exception error) { } } - public class DelegatedGetPinResponseCallback + public static class DelegatedGetPinResponseCallback implements ChipClusters.DoorLockCluster.GetPinResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -851,7 +851,7 @@ public void onError(Exception error) { } } - public class DelegatedGetRfidResponseCallback + public static class DelegatedGetRfidResponseCallback implements ChipClusters.DoorLockCluster.GetRfidResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -880,7 +880,7 @@ public void onError(Exception error) { } } - public class DelegatedGetUserTypeResponseCallback + public static class DelegatedGetUserTypeResponseCallback implements ChipClusters.DoorLockCluster.GetUserTypeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -906,7 +906,7 @@ public void onError(Exception error) { } } - public class DelegatedGetWeekdayScheduleResponseCallback + public static class DelegatedGetWeekdayScheduleResponseCallback implements ChipClusters.DoorLockCluster.GetWeekdayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -952,7 +952,7 @@ public void onError(Exception error) { } } - public class DelegatedGetYeardayScheduleResponseCallback + public static class DelegatedGetYeardayScheduleResponseCallback implements ChipClusters.DoorLockCluster.GetYeardayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -987,7 +987,7 @@ public void onError(Exception error) { } } - public class DelegatedLockDoorResponseCallback + public static class DelegatedLockDoorResponseCallback implements ChipClusters.DoorLockCluster.LockDoorResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1010,7 +1010,7 @@ public void onError(Exception error) { } } - public class DelegatedSetHolidayScheduleResponseCallback + public static class DelegatedSetHolidayScheduleResponseCallback implements ChipClusters.DoorLockCluster.SetHolidayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1034,7 +1034,7 @@ public void onError(Exception error) { } } - public class DelegatedSetPinResponseCallback + public static class DelegatedSetPinResponseCallback implements ChipClusters.DoorLockCluster.SetPinResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1057,7 +1057,7 @@ public void onError(Exception error) { } } - public class DelegatedSetRfidResponseCallback + public static class DelegatedSetRfidResponseCallback implements ChipClusters.DoorLockCluster.SetRfidResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1080,7 +1080,7 @@ public void onError(Exception error) { } } - public class DelegatedSetUserTypeResponseCallback + public static class DelegatedSetUserTypeResponseCallback implements ChipClusters.DoorLockCluster.SetUserTypeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1104,7 +1104,7 @@ public void onError(Exception error) { } } - public class DelegatedSetWeekdayScheduleResponseCallback + public static class DelegatedSetWeekdayScheduleResponseCallback implements ChipClusters.DoorLockCluster.SetWeekdayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1128,7 +1128,7 @@ public void onError(Exception error) { } } - public class DelegatedSetYeardayScheduleResponseCallback + public static class DelegatedSetYeardayScheduleResponseCallback implements ChipClusters.DoorLockCluster.SetYeardayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1152,7 +1152,7 @@ public void onError(Exception error) { } } - public class DelegatedUnlockDoorResponseCallback + public static class DelegatedUnlockDoorResponseCallback implements ChipClusters.DoorLockCluster.UnlockDoorResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1175,7 +1175,7 @@ public void onError(Exception error) { } } - public class DelegatedUnlockWithTimeoutResponseCallback + public static class DelegatedUnlockWithTimeoutResponseCallback implements ChipClusters.DoorLockCluster.UnlockWithTimeoutResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1199,7 +1199,7 @@ public void onError(Exception error) { } } - public class DelegatedLabelListAttributeCallback + public static class DelegatedLabelListAttributeCallback implements ChipClusters.FixedLabelCluster.LabelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1226,7 +1226,7 @@ public void onError(Exception ex) { } } - public class DelegatedArmFailSafeResponseCallback + public static class DelegatedArmFailSafeResponseCallback implements ChipClusters.GeneralCommissioningCluster.ArmFailSafeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1252,7 +1252,7 @@ public void onError(Exception error) { } } - public class DelegatedCommissioningCompleteResponseCallback + public static class DelegatedCommissioningCompleteResponseCallback implements ChipClusters.GeneralCommissioningCluster.CommissioningCompleteResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1278,7 +1278,7 @@ public void onError(Exception error) { } } - public class DelegatedSetRegulatoryConfigResponseCallback + public static class DelegatedSetRegulatoryConfigResponseCallback implements ChipClusters.GeneralCommissioningCluster.SetRegulatoryConfigResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1304,7 +1304,7 @@ public void onError(Exception error) { } } - public class DelegatedBasicCommissioningInfoListAttributeCallback + public static class DelegatedBasicCommissioningInfoListAttributeCallback implements ChipClusters.GeneralCommissioningCluster .BasicCommissioningInfoListAttributeCallback, DelegatedClusterCallback { @@ -1335,7 +1335,7 @@ public void onError(Exception ex) { } } - public class DelegatedNetworkInterfacesAttributeCallback + public static class DelegatedNetworkInterfacesAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.NetworkInterfacesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1364,7 +1364,7 @@ public void onError(Exception ex) { } } - public class DelegatedActiveHardwareFaultsAttributeCallback + public static class DelegatedActiveHardwareFaultsAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.ActiveHardwareFaultsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1390,7 +1390,7 @@ public void onError(Exception ex) { } } - public class DelegatedActiveRadioFaultsAttributeCallback + public static class DelegatedActiveRadioFaultsAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.ActiveRadioFaultsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1416,7 +1416,7 @@ public void onError(Exception ex) { } } - public class DelegatedActiveNetworkFaultsAttributeCallback + public static class DelegatedActiveNetworkFaultsAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.ActiveNetworkFaultsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1442,7 +1442,7 @@ public void onError(Exception ex) { } } - public class DelegatedGroupsAttributeCallback + public static class DelegatedGroupsAttributeCallback implements ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1469,7 +1469,7 @@ public void onError(Exception ex) { } } - public class DelegatedGroupKeysAttributeCallback + public static class DelegatedGroupKeysAttributeCallback implements ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1497,7 +1497,7 @@ public void onError(Exception ex) { } } - public class DelegatedAddGroupResponseCallback + public static class DelegatedAddGroupResponseCallback implements ChipClusters.GroupsCluster.AddGroupResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1522,7 +1522,7 @@ public void onError(Exception error) { } } - public class DelegatedGetGroupMembershipResponseCallback + public static class DelegatedGetGroupMembershipResponseCallback implements ChipClusters.GroupsCluster.GetGroupMembershipResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1553,7 +1553,7 @@ public void onError(Exception error) { } } - public class DelegatedRemoveGroupResponseCallback + public static class DelegatedRemoveGroupResponseCallback implements ChipClusters.GroupsCluster.RemoveGroupResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1578,7 +1578,7 @@ public void onError(Exception error) { } } - public class DelegatedViewGroupResponseCallback + public static class DelegatedViewGroupResponseCallback implements ChipClusters.GroupsCluster.ViewGroupResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1605,7 +1605,7 @@ public void onError(Exception error) { } } - public class DelegatedIdentifyQueryResponseCallback + public static class DelegatedIdentifyQueryResponseCallback implements ChipClusters.IdentifyCluster.IdentifyQueryResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1629,7 +1629,7 @@ public void onError(Exception error) { } } - public class DelegatedSendKeyResponseCallback + public static class DelegatedSendKeyResponseCallback implements ChipClusters.KeypadInputCluster.SendKeyResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1652,7 +1652,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaInputListAttributeCallback + public static class DelegatedMediaInputListAttributeCallback implements ChipClusters.MediaInputCluster.MediaInputListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1679,7 +1679,7 @@ public void onError(Exception ex) { } } - public class DelegatedMediaFastForwardResponseCallback + public static class DelegatedMediaFastForwardResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaFastForwardResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1704,7 +1704,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaNextResponseCallback + public static class DelegatedMediaNextResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaNextResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1729,7 +1729,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaPauseResponseCallback + public static class DelegatedMediaPauseResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaPauseResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1754,7 +1754,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaPlayResponseCallback + public static class DelegatedMediaPlayResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaPlayResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1779,7 +1779,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaPreviousResponseCallback + public static class DelegatedMediaPreviousResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaPreviousResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1804,7 +1804,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaRewindResponseCallback + public static class DelegatedMediaRewindResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaRewindResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1829,7 +1829,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaSeekResponseCallback + public static class DelegatedMediaSeekResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaSeekResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1854,7 +1854,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaSkipBackwardResponseCallback + public static class DelegatedMediaSkipBackwardResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaSkipBackwardResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1879,7 +1879,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaSkipForwardResponseCallback + public static class DelegatedMediaSkipForwardResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaSkipForwardResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1904,7 +1904,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaStartOverResponseCallback + public static class DelegatedMediaStartOverResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaStartOverResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1929,7 +1929,7 @@ public void onError(Exception error) { } } - public class DelegatedMediaStopResponseCallback + public static class DelegatedMediaStopResponseCallback implements ChipClusters.MediaPlaybackCluster.MediaStopResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1954,7 +1954,7 @@ public void onError(Exception error) { } } - public class DelegatedSupportedModesAttributeCallback + public static class DelegatedSupportedModesAttributeCallback implements ChipClusters.ModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1981,7 +1981,7 @@ public void onError(Exception ex) { } } - public class DelegatedAddThreadNetworkResponseCallback + public static class DelegatedAddThreadNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.AddThreadNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2007,7 +2007,7 @@ public void onError(Exception error) { } } - public class DelegatedAddWiFiNetworkResponseCallback + public static class DelegatedAddWiFiNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.AddWiFiNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2033,7 +2033,7 @@ public void onError(Exception error) { } } - public class DelegatedDisableNetworkResponseCallback + public static class DelegatedDisableNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.DisableNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2059,7 +2059,7 @@ public void onError(Exception error) { } } - public class DelegatedEnableNetworkResponseCallback + public static class DelegatedEnableNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.EnableNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2085,7 +2085,7 @@ public void onError(Exception error) { } } - public class DelegatedRemoveNetworkResponseCallback + public static class DelegatedRemoveNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.RemoveNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2111,7 +2111,7 @@ public void onError(Exception error) { } } - public class DelegatedScanNetworksResponseCallback + public static class DelegatedScanNetworksResponseCallback implements ChipClusters.NetworkCommissioningCluster.ScanNetworksResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2146,7 +2146,7 @@ public void onError(Exception error) { } } - public class DelegatedUpdateThreadNetworkResponseCallback + public static class DelegatedUpdateThreadNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.UpdateThreadNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2172,7 +2172,7 @@ public void onError(Exception error) { } } - public class DelegatedUpdateWiFiNetworkResponseCallback + public static class DelegatedUpdateWiFiNetworkResponseCallback implements ChipClusters.NetworkCommissioningCluster.UpdateWiFiNetworkResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2198,7 +2198,7 @@ public void onError(Exception error) { } } - public class DelegatedApplyUpdateResponseCallback + public static class DelegatedApplyUpdateResponseCallback implements ChipClusters.OtaSoftwareUpdateProviderCluster.ApplyUpdateResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2225,7 +2225,7 @@ public void onError(Exception error) { } } - public class DelegatedQueryImageResponseCallback + public static class DelegatedQueryImageResponseCallback implements ChipClusters.OtaSoftwareUpdateProviderCluster.QueryImageResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2277,7 +2277,7 @@ public void onError(Exception error) { } } - public class DelegatedAttestationResponseCallback + public static class DelegatedAttestationResponseCallback implements ChipClusters.OperationalCredentialsCluster.AttestationResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2304,7 +2304,7 @@ public void onError(Exception error) { } } - public class DelegatedCertificateChainResponseCallback + public static class DelegatedCertificateChainResponseCallback implements ChipClusters.OperationalCredentialsCluster.CertificateChainResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2329,7 +2329,7 @@ public void onError(Exception error) { } } - public class DelegatedNOCResponseCallback + public static class DelegatedNOCResponseCallback implements ChipClusters.OperationalCredentialsCluster.NOCResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2357,7 +2357,7 @@ public void onError(Exception error) { } } - public class DelegatedOpCSRResponseCallback + public static class DelegatedOpCSRResponseCallback implements ChipClusters.OperationalCredentialsCluster.OpCSRResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2385,7 +2385,7 @@ public void onError(Exception error) { } } - public class DelegatedFabricsListAttributeCallback + public static class DelegatedFabricsListAttributeCallback implements ChipClusters.OperationalCredentialsCluster.FabricsListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2413,7 +2413,7 @@ public void onError(Exception ex) { } } - public class DelegatedTrustedRootCertificatesAttributeCallback + public static class DelegatedTrustedRootCertificatesAttributeCallback implements ChipClusters.OperationalCredentialsCluster .TrustedRootCertificatesAttributeCallback, DelegatedClusterCallback { @@ -2440,7 +2440,7 @@ public void onError(Exception ex) { } } - public class DelegatedActiveBatteryFaultsAttributeCallback + public static class DelegatedActiveBatteryFaultsAttributeCallback implements ChipClusters.PowerSourceCluster.ActiveBatteryFaultsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2466,7 +2466,7 @@ public void onError(Exception ex) { } } - public class DelegatedAddSceneResponseCallback + public static class DelegatedAddSceneResponseCallback implements ChipClusters.ScenesCluster.AddSceneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2493,7 +2493,7 @@ public void onError(Exception error) { } } - public class DelegatedGetSceneMembershipResponseCallback + public static class DelegatedGetSceneMembershipResponseCallback implements ChipClusters.ScenesCluster.GetSceneMembershipResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2528,7 +2528,7 @@ public void onError(Exception error) { } } - public class DelegatedRemoveAllScenesResponseCallback + public static class DelegatedRemoveAllScenesResponseCallback implements ChipClusters.ScenesCluster.RemoveAllScenesResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2554,7 +2554,7 @@ public void onError(Exception error) { } } - public class DelegatedRemoveSceneResponseCallback + public static class DelegatedRemoveSceneResponseCallback implements ChipClusters.ScenesCluster.RemoveSceneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2581,7 +2581,7 @@ public void onError(Exception error) { } } - public class DelegatedStoreSceneResponseCallback + public static class DelegatedStoreSceneResponseCallback implements ChipClusters.ScenesCluster.StoreSceneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2608,7 +2608,7 @@ public void onError(Exception error) { } } - public class DelegatedViewSceneResponseCallback + public static class DelegatedViewSceneResponseCallback implements ChipClusters.ScenesCluster.ViewSceneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2645,7 +2645,7 @@ public void onError(Exception error) { } } - public class DelegatedThreadMetricsAttributeCallback + public static class DelegatedThreadMetricsAttributeCallback implements ChipClusters.SoftwareDiagnosticsCluster.ThreadMetricsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2673,7 +2673,7 @@ public void onError(Exception ex) { } } - public class DelegatedChangeChannelResponseCallback + public static class DelegatedChangeChannelResponseCallback implements ChipClusters.TvChannelCluster.ChangeChannelResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2702,7 +2702,7 @@ public void onError(Exception error) { } } - public class DelegatedTvChannelListAttributeCallback + public static class DelegatedTvChannelListAttributeCallback implements ChipClusters.TvChannelCluster.TvChannelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2729,7 +2729,7 @@ public void onError(Exception ex) { } } - public class DelegatedNavigateTargetResponseCallback + public static class DelegatedNavigateTargetResponseCallback implements ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2755,7 +2755,7 @@ public void onError(Exception error) { } } - public class DelegatedTargetNavigatorListAttributeCallback + public static class DelegatedTargetNavigatorListAttributeCallback implements ChipClusters.TargetNavigatorCluster.TargetNavigatorListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2784,7 +2784,7 @@ public void onError(Exception ex) { } } - public class DelegatedBooleanResponseCallback + public static class DelegatedBooleanResponseCallback implements ChipClusters.TestClusterCluster.BooleanResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2807,7 +2807,7 @@ public void onError(Exception error) { } } - public class DelegatedTestAddArgumentsResponseCallback + public static class DelegatedTestAddArgumentsResponseCallback implements ChipClusters.TestClusterCluster.TestAddArgumentsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2831,7 +2831,7 @@ public void onError(Exception error) { } } - public class DelegatedTestEnumsResponseCallback + public static class DelegatedTestEnumsResponseCallback implements ChipClusters.TestClusterCluster.TestEnumsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2857,7 +2857,7 @@ public void onError(Exception error) { } } - public class DelegatedTestListInt8UReverseResponseCallback + public static class DelegatedTestListInt8UReverseResponseCallback implements ChipClusters.TestClusterCluster.TestListInt8UReverseResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2884,7 +2884,7 @@ public void onError(Exception error) { } } - public class DelegatedTestNullableOptionalResponseCallback + public static class DelegatedTestNullableOptionalResponseCallback implements ChipClusters.TestClusterCluster.TestNullableOptionalResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2916,7 +2916,7 @@ public void onError(Exception error) { } } - public class DelegatedTestSpecificResponseCallback + public static class DelegatedTestSpecificResponseCallback implements ChipClusters.TestClusterCluster.TestSpecificResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2940,7 +2940,7 @@ public void onError(Exception error) { } } - public class DelegatedListInt8uAttributeCallback + public static class DelegatedListInt8uAttributeCallback implements ChipClusters.TestClusterCluster.ListInt8uAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2966,7 +2966,7 @@ public void onError(Exception ex) { } } - public class DelegatedListOctetStringAttributeCallback + public static class DelegatedListOctetStringAttributeCallback implements ChipClusters.TestClusterCluster.ListOctetStringAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2992,7 +2992,7 @@ public void onError(Exception ex) { } } - public class DelegatedListStructOctetStringAttributeCallback + public static class DelegatedListStructOctetStringAttributeCallback implements ChipClusters.TestClusterCluster.ListStructOctetStringAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -3020,7 +3020,7 @@ public void onError(Exception ex) { } } - public class DelegatedListNullablesAndOptionalsStructAttributeCallback + public static class DelegatedListNullablesAndOptionalsStructAttributeCallback implements ChipClusters.TestClusterCluster.ListNullablesAndOptionalsStructAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -3049,7 +3049,7 @@ public void onError(Exception ex) { } } - public class DelegatedNeighborTableListAttributeCallback + public static class DelegatedNeighborTableListAttributeCallback implements ChipClusters.ThreadNetworkDiagnosticsCluster.NeighborTableListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -3078,7 +3078,7 @@ public void onError(Exception ex) { } } - public class DelegatedRouteTableListAttributeCallback + public static class DelegatedRouteTableListAttributeCallback implements ChipClusters.ThreadNetworkDiagnosticsCluster.RouteTableListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -3107,7 +3107,7 @@ public void onError(Exception ex) { } } - public class DelegatedSecurityPolicyAttributeCallback + public static class DelegatedSecurityPolicyAttributeCallback implements ChipClusters.ThreadNetworkDiagnosticsCluster.SecurityPolicyAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -3136,7 +3136,7 @@ public void onError(Exception ex) { } } - public class DelegatedOperationalDatasetComponentsAttributeCallback + public static class DelegatedOperationalDatasetComponentsAttributeCallback implements ChipClusters.ThreadNetworkDiagnosticsCluster .OperationalDatasetComponentsAttributeCallback, DelegatedClusterCallback { @@ -3167,7 +3167,7 @@ public void onError(Exception ex) { } } - public class DelegatedActiveNetworkFaultsListAttributeCallback + public static class DelegatedActiveNetworkFaultsListAttributeCallback implements ChipClusters.ThreadNetworkDiagnosticsCluster .ActiveNetworkFaultsListAttributeCallback, DelegatedClusterCallback { @@ -3198,8 +3198,12 @@ public Map getClusterMap() { Map clusterMap = initializeClusterMap(); Map> commandMap = getCommandMap(); combineCommand(clusterMap, commandMap); - Map> readAttributeMap = getReadAttributeMap(); + Map> readAttributeMap = + new ClusterReadMapping().getReadAttributeMap(); combineCommand(clusterMap, readAttributeMap); + Map> writeAttributeMap = + new ClusterWriteMapping().getWriteAttributeMap(); + combineCommand(clusterMap, writeAttributeMap); return clusterMap; } @@ -8286,6475 +8290,4 @@ public Map> getCommandMap() { commandMap.put("windowCovering", windowCoveringClusterInteractionInfoMap); return commandMap; } - - public Map> getReadAttributeMap() { - Map> readAttributeMap = new HashMap<>(); - Map readAccountLoginInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readAccountLoginClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readAccountLoginClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AccountLoginCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readAccountLoginClusterRevisionCommandParams); - readAccountLoginInteractionInfo.put( - "readClusterRevisionAttribute", readAccountLoginClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("accountLogin", readAccountLoginInteractionInfo); - Map readAdministratorCommissioningInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readAdministratorCommissioningClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readAdministratorCommissioningClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AdministratorCommissioningCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readAdministratorCommissioningClusterRevisionCommandParams); - readAdministratorCommissioningInteractionInfo.put( - "readClusterRevisionAttribute", - readAdministratorCommissioningClusterRevisionAttributeInteractionInfo); - readAttributeMap.put( - "administratorCommissioning", readAdministratorCommissioningInteractionInfo); - Map readApplicationBasicInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readApplicationBasicVendorNameCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicVendorNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readApplicationBasicVendorNameCommandParams); - readApplicationBasicInteractionInfo.put( - "readVendorNameAttribute", readApplicationBasicVendorNameAttributeInteractionInfo); - Map readApplicationBasicVendorIdCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicVendorIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationBasicVendorIdCommandParams); - readApplicationBasicInteractionInfo.put( - "readVendorIdAttribute", readApplicationBasicVendorIdAttributeInteractionInfo); - Map readApplicationBasicApplicationNameCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicApplicationNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readApplicationNameAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readApplicationBasicApplicationNameCommandParams); - readApplicationBasicInteractionInfo.put( - "readApplicationNameAttribute", - readApplicationBasicApplicationNameAttributeInteractionInfo); - Map readApplicationBasicProductIdCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicProductIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readProductIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationBasicProductIdCommandParams); - readApplicationBasicInteractionInfo.put( - "readProductIdAttribute", readApplicationBasicProductIdAttributeInteractionInfo); - Map readApplicationBasicApplicationIdCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicApplicationIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readApplicationIdAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readApplicationBasicApplicationIdCommandParams); - readApplicationBasicInteractionInfo.put( - "readApplicationIdAttribute", readApplicationBasicApplicationIdAttributeInteractionInfo); - Map readApplicationBasicCatalogVendorIdCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicCatalogVendorIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readCatalogVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationBasicCatalogVendorIdCommandParams); - readApplicationBasicInteractionInfo.put( - "readCatalogVendorIdAttribute", - readApplicationBasicCatalogVendorIdAttributeInteractionInfo); - Map readApplicationBasicApplicationStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicApplicationStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readApplicationStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationBasicApplicationStatusCommandParams); - readApplicationBasicInteractionInfo.put( - "readApplicationStatusAttribute", - readApplicationBasicApplicationStatusAttributeInteractionInfo); - Map readApplicationBasicClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationBasicClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationBasicClusterRevisionCommandParams); - readApplicationBasicInteractionInfo.put( - "readClusterRevisionAttribute", - readApplicationBasicClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("applicationBasic", readApplicationBasicInteractionInfo); - Map readApplicationLauncherInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readApplicationLauncherApplicationLauncherListCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationLauncherApplicationLauncherListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .readApplicationLauncherListAttribute( - (ChipClusters.ApplicationLauncherCluster - .ApplicationLauncherListAttributeCallback) - callback); - }, - () -> new DelegatedApplicationLauncherListAttributeCallback(), - readApplicationLauncherApplicationLauncherListCommandParams); - readApplicationLauncherInteractionInfo.put( - "readApplicationLauncherListAttribute", - readApplicationLauncherApplicationLauncherListAttributeInteractionInfo); - Map readApplicationLauncherCatalogVendorIdCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationLauncherCatalogVendorIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .readCatalogVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationLauncherCatalogVendorIdCommandParams); - readApplicationLauncherInteractionInfo.put( - "readCatalogVendorIdAttribute", - readApplicationLauncherCatalogVendorIdAttributeInteractionInfo); - Map readApplicationLauncherApplicationIdCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationLauncherApplicationIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .readApplicationIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationLauncherApplicationIdCommandParams); - readApplicationLauncherInteractionInfo.put( - "readApplicationIdAttribute", readApplicationLauncherApplicationIdAttributeInteractionInfo); - Map readApplicationLauncherClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readApplicationLauncherClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readApplicationLauncherClusterRevisionCommandParams); - readApplicationLauncherInteractionInfo.put( - "readClusterRevisionAttribute", - readApplicationLauncherClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("applicationLauncher", readApplicationLauncherInteractionInfo); - Map readAudioOutputInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readAudioOutputAudioOutputListCommandParams = - new LinkedHashMap(); - InteractionInfo readAudioOutputAudioOutputListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AudioOutputCluster) cluster) - .readAudioOutputListAttribute( - (ChipClusters.AudioOutputCluster.AudioOutputListAttributeCallback) callback); - }, - () -> new DelegatedAudioOutputListAttributeCallback(), - readAudioOutputAudioOutputListCommandParams); - readAudioOutputInteractionInfo.put( - "readAudioOutputListAttribute", readAudioOutputAudioOutputListAttributeInteractionInfo); - Map readAudioOutputCurrentAudioOutputCommandParams = - new LinkedHashMap(); - InteractionInfo readAudioOutputCurrentAudioOutputAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AudioOutputCluster) cluster) - .readCurrentAudioOutputAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readAudioOutputCurrentAudioOutputCommandParams); - readAudioOutputInteractionInfo.put( - "readCurrentAudioOutputAttribute", - readAudioOutputCurrentAudioOutputAttributeInteractionInfo); - Map readAudioOutputClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readAudioOutputClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AudioOutputCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readAudioOutputClusterRevisionCommandParams); - readAudioOutputInteractionInfo.put( - "readClusterRevisionAttribute", readAudioOutputClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("audioOutput", readAudioOutputInteractionInfo); - Map readBarrierControlInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBarrierControlBarrierMovingStateCommandParams = - new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierMovingStateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .readBarrierMovingStateAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierMovingStateCommandParams); - readBarrierControlInteractionInfo.put( - "readBarrierMovingStateAttribute", - readBarrierControlBarrierMovingStateAttributeInteractionInfo); - Map readBarrierControlBarrierSafetyStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierSafetyStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .readBarrierSafetyStatusAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierSafetyStatusCommandParams); - readBarrierControlInteractionInfo.put( - "readBarrierSafetyStatusAttribute", - readBarrierControlBarrierSafetyStatusAttributeInteractionInfo); - Map readBarrierControlBarrierCapabilitiesCommandParams = - new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierCapabilitiesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .readBarrierCapabilitiesAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierCapabilitiesCommandParams); - readBarrierControlInteractionInfo.put( - "readBarrierCapabilitiesAttribute", - readBarrierControlBarrierCapabilitiesAttributeInteractionInfo); - Map readBarrierControlBarrierPositionCommandParams = - new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierPositionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .readBarrierPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierPositionCommandParams); - readBarrierControlInteractionInfo.put( - "readBarrierPositionAttribute", readBarrierControlBarrierPositionAttributeInteractionInfo); - Map readBarrierControlClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBarrierControlClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBarrierControlClusterRevisionCommandParams); - readBarrierControlInteractionInfo.put( - "readClusterRevisionAttribute", readBarrierControlClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("barrierControl", readBarrierControlInteractionInfo); - Map readBasicInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBasicInteractionModelVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicInteractionModelVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readInteractionModelVersionAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBasicInteractionModelVersionCommandParams); - readBasicInteractionInfo.put( - "readInteractionModelVersionAttribute", - readBasicInteractionModelVersionAttributeInteractionInfo); - Map readBasicVendorNameCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicVendorNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicVendorNameCommandParams); - readBasicInteractionInfo.put( - "readVendorNameAttribute", readBasicVendorNameAttributeInteractionInfo); - Map readBasicVendorIDCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicVendorIDAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBasicVendorIDCommandParams); - readBasicInteractionInfo.put( - "readVendorIDAttribute", readBasicVendorIDAttributeInteractionInfo); - Map readBasicProductNameCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicProductNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicProductNameCommandParams); - readBasicInteractionInfo.put( - "readProductNameAttribute", readBasicProductNameAttributeInteractionInfo); - Map readBasicProductIDCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicProductIDAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readProductIDAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBasicProductIDCommandParams); - readBasicInteractionInfo.put( - "readProductIDAttribute", readBasicProductIDAttributeInteractionInfo); - Map readBasicUserLabelCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicUserLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readUserLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicUserLabelCommandParams); - readBasicInteractionInfo.put( - "readUserLabelAttribute", readBasicUserLabelAttributeInteractionInfo); - Map readBasicLocationCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicLocationAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readLocationAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicLocationCommandParams); - readBasicInteractionInfo.put( - "readLocationAttribute", readBasicLocationAttributeInteractionInfo); - Map readBasicHardwareVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicHardwareVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBasicHardwareVersionCommandParams); - readBasicInteractionInfo.put( - "readHardwareVersionAttribute", readBasicHardwareVersionAttributeInteractionInfo); - Map readBasicHardwareVersionStringCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicHardwareVersionStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readHardwareVersionStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicHardwareVersionStringCommandParams); - readBasicInteractionInfo.put( - "readHardwareVersionStringAttribute", - readBasicHardwareVersionStringAttributeInteractionInfo); - Map readBasicSoftwareVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicSoftwareVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readBasicSoftwareVersionCommandParams); - readBasicInteractionInfo.put( - "readSoftwareVersionAttribute", readBasicSoftwareVersionAttributeInteractionInfo); - Map readBasicSoftwareVersionStringCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicSoftwareVersionStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readSoftwareVersionStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicSoftwareVersionStringCommandParams); - readBasicInteractionInfo.put( - "readSoftwareVersionStringAttribute", - readBasicSoftwareVersionStringAttributeInteractionInfo); - Map readBasicManufacturingDateCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicManufacturingDateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readManufacturingDateAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicManufacturingDateCommandParams); - readBasicInteractionInfo.put( - "readManufacturingDateAttribute", readBasicManufacturingDateAttributeInteractionInfo); - Map readBasicPartNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicPartNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicPartNumberCommandParams); - readBasicInteractionInfo.put( - "readPartNumberAttribute", readBasicPartNumberAttributeInteractionInfo); - Map readBasicProductURLCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicProductURLAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicProductURLCommandParams); - readBasicInteractionInfo.put( - "readProductURLAttribute", readBasicProductURLAttributeInteractionInfo); - Map readBasicProductLabelCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicProductLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicProductLabelCommandParams); - readBasicInteractionInfo.put( - "readProductLabelAttribute", readBasicProductLabelAttributeInteractionInfo); - Map readBasicSerialNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicSerialNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBasicSerialNumberCommandParams); - readBasicInteractionInfo.put( - "readSerialNumberAttribute", readBasicSerialNumberAttributeInteractionInfo); - Map readBasicLocalConfigDisabledCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicLocalConfigDisabledAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readLocalConfigDisabledAttribute( - (ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readBasicLocalConfigDisabledCommandParams); - readBasicInteractionInfo.put( - "readLocalConfigDisabledAttribute", readBasicLocalConfigDisabledAttributeInteractionInfo); - Map readBasicReachableCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicReachableAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readBasicReachableCommandParams); - readBasicInteractionInfo.put( - "readReachableAttribute", readBasicReachableAttributeInteractionInfo); - Map readBasicClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBasicClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BasicCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBasicClusterRevisionCommandParams); - readBasicInteractionInfo.put( - "readClusterRevisionAttribute", readBasicClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("basic", readBasicInteractionInfo); - Map readBinaryInputBasicInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBinaryInputBasicOutOfServiceCommandParams = - new LinkedHashMap(); - InteractionInfo readBinaryInputBasicOutOfServiceAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster) - .readOutOfServiceAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readBinaryInputBasicOutOfServiceCommandParams); - readBinaryInputBasicInteractionInfo.put( - "readOutOfServiceAttribute", readBinaryInputBasicOutOfServiceAttributeInteractionInfo); - Map readBinaryInputBasicPresentValueCommandParams = - new LinkedHashMap(); - InteractionInfo readBinaryInputBasicPresentValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster) - .readPresentValueAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readBinaryInputBasicPresentValueCommandParams); - readBinaryInputBasicInteractionInfo.put( - "readPresentValueAttribute", readBinaryInputBasicPresentValueAttributeInteractionInfo); - Map readBinaryInputBasicStatusFlagsCommandParams = - new LinkedHashMap(); - InteractionInfo readBinaryInputBasicStatusFlagsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster) - .readStatusFlagsAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBinaryInputBasicStatusFlagsCommandParams); - readBinaryInputBasicInteractionInfo.put( - "readStatusFlagsAttribute", readBinaryInputBasicStatusFlagsAttributeInteractionInfo); - Map readBinaryInputBasicClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBinaryInputBasicClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBinaryInputBasicClusterRevisionCommandParams); - readBinaryInputBasicInteractionInfo.put( - "readClusterRevisionAttribute", - readBinaryInputBasicClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("binaryInputBasic", readBinaryInputBasicInteractionInfo); - Map readBindingInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBindingClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBindingClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BindingCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBindingClusterRevisionCommandParams); - readBindingInteractionInfo.put( - "readClusterRevisionAttribute", readBindingClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("binding", readBindingInteractionInfo); - Map readBooleanStateInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBooleanStateStateValueCommandParams = - new LinkedHashMap(); - InteractionInfo readBooleanStateStateValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BooleanStateCluster) cluster) - .readStateValueAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readBooleanStateStateValueCommandParams); - readBooleanStateInteractionInfo.put( - "readStateValueAttribute", readBooleanStateStateValueAttributeInteractionInfo); - Map readBooleanStateClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBooleanStateClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BooleanStateCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBooleanStateClusterRevisionCommandParams); - readBooleanStateInteractionInfo.put( - "readClusterRevisionAttribute", readBooleanStateClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("booleanState", readBooleanStateInteractionInfo); - Map readBridgedActionsInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBridgedActionsActionListCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedActionsActionListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedActionsCluster) cluster) - .readActionListAttribute( - (ChipClusters.BridgedActionsCluster.ActionListAttributeCallback) callback); - }, - () -> new DelegatedActionListAttributeCallback(), - readBridgedActionsActionListCommandParams); - readBridgedActionsInteractionInfo.put( - "readActionListAttribute", readBridgedActionsActionListAttributeInteractionInfo); - Map readBridgedActionsEndpointListCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedActionsEndpointListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedActionsCluster) cluster) - .readEndpointListAttribute( - (ChipClusters.BridgedActionsCluster.EndpointListAttributeCallback) callback); - }, - () -> new DelegatedEndpointListAttributeCallback(), - readBridgedActionsEndpointListCommandParams); - readBridgedActionsInteractionInfo.put( - "readEndpointListAttribute", readBridgedActionsEndpointListAttributeInteractionInfo); - Map readBridgedActionsSetupUrlCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedActionsSetupUrlAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedActionsCluster) cluster) - .readSetupUrlAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedActionsSetupUrlCommandParams); - readBridgedActionsInteractionInfo.put( - "readSetupUrlAttribute", readBridgedActionsSetupUrlAttributeInteractionInfo); - Map readBridgedActionsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedActionsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedActionsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBridgedActionsClusterRevisionCommandParams); - readBridgedActionsInteractionInfo.put( - "readClusterRevisionAttribute", readBridgedActionsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("bridgedActions", readBridgedActionsInteractionInfo); - Map readBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readBridgedDeviceBasicVendorNameCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicVendorNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicVendorNameCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readVendorNameAttribute", readBridgedDeviceBasicVendorNameAttributeInteractionInfo); - Map readBridgedDeviceBasicVendorIDCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicVendorIDAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBridgedDeviceBasicVendorIDCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readVendorIDAttribute", readBridgedDeviceBasicVendorIDAttributeInteractionInfo); - Map readBridgedDeviceBasicProductNameCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicProductNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicProductNameCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readProductNameAttribute", readBridgedDeviceBasicProductNameAttributeInteractionInfo); - Map readBridgedDeviceBasicUserLabelCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicUserLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readUserLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicUserLabelCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readUserLabelAttribute", readBridgedDeviceBasicUserLabelAttributeInteractionInfo); - Map readBridgedDeviceBasicHardwareVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBridgedDeviceBasicHardwareVersionCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readHardwareVersionAttribute", - readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo); - Map readBridgedDeviceBasicHardwareVersionStringCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readHardwareVersionStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicHardwareVersionStringCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readHardwareVersionStringAttribute", - readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo); - Map readBridgedDeviceBasicSoftwareVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readBridgedDeviceBasicSoftwareVersionCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readSoftwareVersionAttribute", - readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo); - Map readBridgedDeviceBasicSoftwareVersionStringCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readSoftwareVersionStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicSoftwareVersionStringCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readSoftwareVersionStringAttribute", - readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo); - Map readBridgedDeviceBasicManufacturingDateCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readManufacturingDateAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicManufacturingDateCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readManufacturingDateAttribute", - readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo); - Map readBridgedDeviceBasicPartNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicPartNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicPartNumberCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readPartNumberAttribute", readBridgedDeviceBasicPartNumberAttributeInteractionInfo); - Map readBridgedDeviceBasicProductURLCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicProductURLAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicProductURLCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readProductURLAttribute", readBridgedDeviceBasicProductURLAttributeInteractionInfo); - Map readBridgedDeviceBasicProductLabelCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicProductLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicProductLabelCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readProductLabelAttribute", readBridgedDeviceBasicProductLabelAttributeInteractionInfo); - Map readBridgedDeviceBasicSerialNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicSerialNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicSerialNumberCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readSerialNumberAttribute", readBridgedDeviceBasicSerialNumberAttributeInteractionInfo); - Map readBridgedDeviceBasicReachableCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicReachableAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readBridgedDeviceBasicReachableCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readReachableAttribute", readBridgedDeviceBasicReachableAttributeInteractionInfo); - Map readBridgedDeviceBasicClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readBridgedDeviceBasicClusterRevisionCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readClusterRevisionAttribute", - readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("bridgedDeviceBasic", readBridgedDeviceBasicInteractionInfo); - Map readColorControlInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readColorControlCurrentHueCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlCurrentHueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readCurrentHueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlCurrentHueCommandParams); - readColorControlInteractionInfo.put( - "readCurrentHueAttribute", readColorControlCurrentHueAttributeInteractionInfo); - Map readColorControlCurrentSaturationCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlCurrentSaturationAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readCurrentSaturationAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlCurrentSaturationCommandParams); - readColorControlInteractionInfo.put( - "readCurrentSaturationAttribute", - readColorControlCurrentSaturationAttributeInteractionInfo); - Map readColorControlRemainingTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlRemainingTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readRemainingTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlRemainingTimeCommandParams); - readColorControlInteractionInfo.put( - "readRemainingTimeAttribute", readColorControlRemainingTimeAttributeInteractionInfo); - Map readColorControlCurrentXCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlCurrentXAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readCurrentXAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlCurrentXCommandParams); - readColorControlInteractionInfo.put( - "readCurrentXAttribute", readColorControlCurrentXAttributeInteractionInfo); - Map readColorControlCurrentYCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlCurrentYAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readCurrentYAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlCurrentYCommandParams); - readColorControlInteractionInfo.put( - "readCurrentYAttribute", readColorControlCurrentYAttributeInteractionInfo); - Map readColorControlDriftCompensationCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlDriftCompensationAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readDriftCompensationAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlDriftCompensationCommandParams); - readColorControlInteractionInfo.put( - "readDriftCompensationAttribute", - readColorControlDriftCompensationAttributeInteractionInfo); - Map readColorControlCompensationTextCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlCompensationTextAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readCompensationTextAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readColorControlCompensationTextCommandParams); - readColorControlInteractionInfo.put( - "readCompensationTextAttribute", readColorControlCompensationTextAttributeInteractionInfo); - Map readColorControlColorTemperatureCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorTemperatureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorTemperatureCommandParams); - readColorControlInteractionInfo.put( - "readColorTemperatureAttribute", readColorControlColorTemperatureAttributeInteractionInfo); - Map readColorControlColorModeCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorModeCommandParams); - readColorControlInteractionInfo.put( - "readColorModeAttribute", readColorControlColorModeAttributeInteractionInfo); - Map readColorControlColorControlOptionsCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorControlOptionsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorControlOptionsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorControlOptionsCommandParams); - readColorControlInteractionInfo.put( - "readColorControlOptionsAttribute", - readColorControlColorControlOptionsAttributeInteractionInfo); - Map readColorControlNumberOfPrimariesCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlNumberOfPrimariesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readNumberOfPrimariesAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlNumberOfPrimariesCommandParams); - readColorControlInteractionInfo.put( - "readNumberOfPrimariesAttribute", - readColorControlNumberOfPrimariesAttributeInteractionInfo); - Map readColorControlPrimary1XCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary1XAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary1XAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary1XCommandParams); - readColorControlInteractionInfo.put( - "readPrimary1XAttribute", readColorControlPrimary1XAttributeInteractionInfo); - Map readColorControlPrimary1YCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary1YAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary1YAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary1YCommandParams); - readColorControlInteractionInfo.put( - "readPrimary1YAttribute", readColorControlPrimary1YAttributeInteractionInfo); - Map readColorControlPrimary1IntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary1IntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary1IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary1IntensityCommandParams); - readColorControlInteractionInfo.put( - "readPrimary1IntensityAttribute", - readColorControlPrimary1IntensityAttributeInteractionInfo); - Map readColorControlPrimary2XCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary2XAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary2XAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary2XCommandParams); - readColorControlInteractionInfo.put( - "readPrimary2XAttribute", readColorControlPrimary2XAttributeInteractionInfo); - Map readColorControlPrimary2YCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary2YAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary2YAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary2YCommandParams); - readColorControlInteractionInfo.put( - "readPrimary2YAttribute", readColorControlPrimary2YAttributeInteractionInfo); - Map readColorControlPrimary2IntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary2IntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary2IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary2IntensityCommandParams); - readColorControlInteractionInfo.put( - "readPrimary2IntensityAttribute", - readColorControlPrimary2IntensityAttributeInteractionInfo); - Map readColorControlPrimary3XCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary3XAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary3XAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary3XCommandParams); - readColorControlInteractionInfo.put( - "readPrimary3XAttribute", readColorControlPrimary3XAttributeInteractionInfo); - Map readColorControlPrimary3YCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary3YAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary3YAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary3YCommandParams); - readColorControlInteractionInfo.put( - "readPrimary3YAttribute", readColorControlPrimary3YAttributeInteractionInfo); - Map readColorControlPrimary3IntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary3IntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary3IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary3IntensityCommandParams); - readColorControlInteractionInfo.put( - "readPrimary3IntensityAttribute", - readColorControlPrimary3IntensityAttributeInteractionInfo); - Map readColorControlPrimary4XCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary4XAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary4XAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary4XCommandParams); - readColorControlInteractionInfo.put( - "readPrimary4XAttribute", readColorControlPrimary4XAttributeInteractionInfo); - Map readColorControlPrimary4YCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary4YAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary4YAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary4YCommandParams); - readColorControlInteractionInfo.put( - "readPrimary4YAttribute", readColorControlPrimary4YAttributeInteractionInfo); - Map readColorControlPrimary4IntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary4IntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary4IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary4IntensityCommandParams); - readColorControlInteractionInfo.put( - "readPrimary4IntensityAttribute", - readColorControlPrimary4IntensityAttributeInteractionInfo); - Map readColorControlPrimary5XCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary5XAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary5XAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary5XCommandParams); - readColorControlInteractionInfo.put( - "readPrimary5XAttribute", readColorControlPrimary5XAttributeInteractionInfo); - Map readColorControlPrimary5YCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary5YAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary5YAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary5YCommandParams); - readColorControlInteractionInfo.put( - "readPrimary5YAttribute", readColorControlPrimary5YAttributeInteractionInfo); - Map readColorControlPrimary5IntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary5IntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary5IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary5IntensityCommandParams); - readColorControlInteractionInfo.put( - "readPrimary5IntensityAttribute", - readColorControlPrimary5IntensityAttributeInteractionInfo); - Map readColorControlPrimary6XCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary6XAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary6XAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary6XCommandParams); - readColorControlInteractionInfo.put( - "readPrimary6XAttribute", readColorControlPrimary6XAttributeInteractionInfo); - Map readColorControlPrimary6YCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary6YAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary6YAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary6YCommandParams); - readColorControlInteractionInfo.put( - "readPrimary6YAttribute", readColorControlPrimary6YAttributeInteractionInfo); - Map readColorControlPrimary6IntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlPrimary6IntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readPrimary6IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlPrimary6IntensityCommandParams); - readColorControlInteractionInfo.put( - "readPrimary6IntensityAttribute", - readColorControlPrimary6IntensityAttributeInteractionInfo); - Map readColorControlWhitePointXCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlWhitePointXAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readWhitePointXAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlWhitePointXCommandParams); - readColorControlInteractionInfo.put( - "readWhitePointXAttribute", readColorControlWhitePointXAttributeInteractionInfo); - Map readColorControlWhitePointYCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlWhitePointYAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readWhitePointYAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlWhitePointYCommandParams); - readColorControlInteractionInfo.put( - "readWhitePointYAttribute", readColorControlWhitePointYAttributeInteractionInfo); - Map readColorControlColorPointRXCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointRXAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointRXAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointRXCommandParams); - readColorControlInteractionInfo.put( - "readColorPointRXAttribute", readColorControlColorPointRXAttributeInteractionInfo); - Map readColorControlColorPointRYCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointRYAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointRYAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointRYCommandParams); - readColorControlInteractionInfo.put( - "readColorPointRYAttribute", readColorControlColorPointRYAttributeInteractionInfo); - Map readColorControlColorPointRIntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointRIntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointRIntensityAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointRIntensityCommandParams); - readColorControlInteractionInfo.put( - "readColorPointRIntensityAttribute", - readColorControlColorPointRIntensityAttributeInteractionInfo); - Map readColorControlColorPointGXCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointGXAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointGXAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointGXCommandParams); - readColorControlInteractionInfo.put( - "readColorPointGXAttribute", readColorControlColorPointGXAttributeInteractionInfo); - Map readColorControlColorPointGYCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointGYAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointGYAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointGYCommandParams); - readColorControlInteractionInfo.put( - "readColorPointGYAttribute", readColorControlColorPointGYAttributeInteractionInfo); - Map readColorControlColorPointGIntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointGIntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointGIntensityAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointGIntensityCommandParams); - readColorControlInteractionInfo.put( - "readColorPointGIntensityAttribute", - readColorControlColorPointGIntensityAttributeInteractionInfo); - Map readColorControlColorPointBXCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointBXAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointBXAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointBXCommandParams); - readColorControlInteractionInfo.put( - "readColorPointBXAttribute", readColorControlColorPointBXAttributeInteractionInfo); - Map readColorControlColorPointBYCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointBYAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointBYAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointBYCommandParams); - readColorControlInteractionInfo.put( - "readColorPointBYAttribute", readColorControlColorPointBYAttributeInteractionInfo); - Map readColorControlColorPointBIntensityCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorPointBIntensityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorPointBIntensityAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorPointBIntensityCommandParams); - readColorControlInteractionInfo.put( - "readColorPointBIntensityAttribute", - readColorControlColorPointBIntensityAttributeInteractionInfo); - Map readColorControlEnhancedCurrentHueCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlEnhancedCurrentHueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readEnhancedCurrentHueAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlEnhancedCurrentHueCommandParams); - readColorControlInteractionInfo.put( - "readEnhancedCurrentHueAttribute", - readColorControlEnhancedCurrentHueAttributeInteractionInfo); - Map readColorControlEnhancedColorModeCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlEnhancedColorModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readEnhancedColorModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlEnhancedColorModeCommandParams); - readColorControlInteractionInfo.put( - "readEnhancedColorModeAttribute", - readColorControlEnhancedColorModeAttributeInteractionInfo); - Map readColorControlColorLoopActiveCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorLoopActiveAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorLoopActiveAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorLoopActiveCommandParams); - readColorControlInteractionInfo.put( - "readColorLoopActiveAttribute", readColorControlColorLoopActiveAttributeInteractionInfo); - Map readColorControlColorLoopDirectionCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorLoopDirectionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorLoopDirectionAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorLoopDirectionCommandParams); - readColorControlInteractionInfo.put( - "readColorLoopDirectionAttribute", - readColorControlColorLoopDirectionAttributeInteractionInfo); - Map readColorControlColorLoopTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorLoopTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorLoopTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorLoopTimeCommandParams); - readColorControlInteractionInfo.put( - "readColorLoopTimeAttribute", readColorControlColorLoopTimeAttributeInteractionInfo); - Map readColorControlColorLoopStartEnhancedHueCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorLoopStartEnhancedHueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorLoopStartEnhancedHueAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorLoopStartEnhancedHueCommandParams); - readColorControlInteractionInfo.put( - "readColorLoopStartEnhancedHueAttribute", - readColorControlColorLoopStartEnhancedHueAttributeInteractionInfo); - Map readColorControlColorLoopStoredEnhancedHueCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorLoopStoredEnhancedHueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorLoopStoredEnhancedHueAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorLoopStoredEnhancedHueCommandParams); - readColorControlInteractionInfo.put( - "readColorLoopStoredEnhancedHueAttribute", - readColorControlColorLoopStoredEnhancedHueAttributeInteractionInfo); - Map readColorControlColorCapabilitiesCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorCapabilitiesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorCapabilitiesAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorCapabilitiesCommandParams); - readColorControlInteractionInfo.put( - "readColorCapabilitiesAttribute", - readColorControlColorCapabilitiesAttributeInteractionInfo); - Map readColorControlColorTempPhysicalMinCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorTempPhysicalMinAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorTempPhysicalMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorTempPhysicalMinCommandParams); - readColorControlInteractionInfo.put( - "readColorTempPhysicalMinAttribute", - readColorControlColorTempPhysicalMinAttributeInteractionInfo); - Map readColorControlColorTempPhysicalMaxCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlColorTempPhysicalMaxAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readColorTempPhysicalMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlColorTempPhysicalMaxCommandParams); - readColorControlInteractionInfo.put( - "readColorTempPhysicalMaxAttribute", - readColorControlColorTempPhysicalMaxAttributeInteractionInfo); - Map readColorControlCoupleColorTempToLevelMinMiredsCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlCoupleColorTempToLevelMinMiredsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readCoupleColorTempToLevelMinMiredsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlCoupleColorTempToLevelMinMiredsCommandParams); - readColorControlInteractionInfo.put( - "readCoupleColorTempToLevelMinMiredsAttribute", - readColorControlCoupleColorTempToLevelMinMiredsAttributeInteractionInfo); - Map readColorControlStartUpColorTemperatureMiredsCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readStartUpColorTemperatureMiredsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlStartUpColorTemperatureMiredsCommandParams); - readColorControlInteractionInfo.put( - "readStartUpColorTemperatureMiredsAttribute", - readColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo); - Map readColorControlClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readColorControlClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readColorControlClusterRevisionCommandParams); - readColorControlInteractionInfo.put( - "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("colorControl", readColorControlInteractionInfo); - Map readContentLauncherInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readContentLauncherAcceptsHeaderListCommandParams = - new LinkedHashMap(); - InteractionInfo readContentLauncherAcceptsHeaderListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentLauncherCluster) cluster) - .readAcceptsHeaderListAttribute( - (ChipClusters.ContentLauncherCluster.AcceptsHeaderListAttributeCallback) - callback); - }, - () -> new DelegatedAcceptsHeaderListAttributeCallback(), - readContentLauncherAcceptsHeaderListCommandParams); - readContentLauncherInteractionInfo.put( - "readAcceptsHeaderListAttribute", - readContentLauncherAcceptsHeaderListAttributeInteractionInfo); - Map readContentLauncherSupportedStreamingTypesCommandParams = - new LinkedHashMap(); - InteractionInfo readContentLauncherSupportedStreamingTypesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentLauncherCluster) cluster) - .readSupportedStreamingTypesAttribute( - (ChipClusters.ContentLauncherCluster.SupportedStreamingTypesAttributeCallback) - callback); - }, - () -> new DelegatedSupportedStreamingTypesAttributeCallback(), - readContentLauncherSupportedStreamingTypesCommandParams); - readContentLauncherInteractionInfo.put( - "readSupportedStreamingTypesAttribute", - readContentLauncherSupportedStreamingTypesAttributeInteractionInfo); - Map readContentLauncherClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readContentLauncherClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentLauncherCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readContentLauncherClusterRevisionCommandParams); - readContentLauncherInteractionInfo.put( - "readClusterRevisionAttribute", readContentLauncherClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("contentLauncher", readContentLauncherInteractionInfo); - Map readDescriptorInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readDescriptorDeviceListCommandParams = - new LinkedHashMap(); - InteractionInfo readDescriptorDeviceListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DescriptorCluster) cluster) - .readDeviceListAttribute( - (ChipClusters.DescriptorCluster.DeviceListAttributeCallback) callback); - }, - () -> new DelegatedDeviceListAttributeCallback(), - readDescriptorDeviceListCommandParams); - readDescriptorInteractionInfo.put( - "readDeviceListAttribute", readDescriptorDeviceListAttributeInteractionInfo); - Map readDescriptorServerListCommandParams = - new LinkedHashMap(); - InteractionInfo readDescriptorServerListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DescriptorCluster) cluster) - .readServerListAttribute( - (ChipClusters.DescriptorCluster.ServerListAttributeCallback) callback); - }, - () -> new DelegatedServerListAttributeCallback(), - readDescriptorServerListCommandParams); - readDescriptorInteractionInfo.put( - "readServerListAttribute", readDescriptorServerListAttributeInteractionInfo); - Map readDescriptorClientListCommandParams = - new LinkedHashMap(); - InteractionInfo readDescriptorClientListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DescriptorCluster) cluster) - .readClientListAttribute( - (ChipClusters.DescriptorCluster.ClientListAttributeCallback) callback); - }, - () -> new DelegatedClientListAttributeCallback(), - readDescriptorClientListCommandParams); - readDescriptorInteractionInfo.put( - "readClientListAttribute", readDescriptorClientListAttributeInteractionInfo); - Map readDescriptorPartsListCommandParams = - new LinkedHashMap(); - InteractionInfo readDescriptorPartsListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DescriptorCluster) cluster) - .readPartsListAttribute( - (ChipClusters.DescriptorCluster.PartsListAttributeCallback) callback); - }, - () -> new DelegatedPartsListAttributeCallback(), - readDescriptorPartsListCommandParams); - readDescriptorInteractionInfo.put( - "readPartsListAttribute", readDescriptorPartsListAttributeInteractionInfo); - Map readDescriptorClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readDescriptorClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DescriptorCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readDescriptorClusterRevisionCommandParams); - readDescriptorInteractionInfo.put( - "readClusterRevisionAttribute", readDescriptorClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("descriptor", readDescriptorInteractionInfo); - Map readDiagnosticLogsInteractionInfo = new LinkedHashMap<>(); - // read attribute - readAttributeMap.put("diagnosticLogs", readDiagnosticLogsInteractionInfo); - Map readDoorLockInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readDoorLockLockStateCommandParams = - new LinkedHashMap(); - InteractionInfo readDoorLockLockStateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DoorLockCluster) cluster) - .readLockStateAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readDoorLockLockStateCommandParams); - readDoorLockInteractionInfo.put( - "readLockStateAttribute", readDoorLockLockStateAttributeInteractionInfo); - Map readDoorLockLockTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readDoorLockLockTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DoorLockCluster) cluster) - .readLockTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readDoorLockLockTypeCommandParams); - readDoorLockInteractionInfo.put( - "readLockTypeAttribute", readDoorLockLockTypeAttributeInteractionInfo); - Map readDoorLockActuatorEnabledCommandParams = - new LinkedHashMap(); - InteractionInfo readDoorLockActuatorEnabledAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DoorLockCluster) cluster) - .readActuatorEnabledAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readDoorLockActuatorEnabledCommandParams); - readDoorLockInteractionInfo.put( - "readActuatorEnabledAttribute", readDoorLockActuatorEnabledAttributeInteractionInfo); - Map readDoorLockClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readDoorLockClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DoorLockCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readDoorLockClusterRevisionCommandParams); - readDoorLockInteractionInfo.put( - "readClusterRevisionAttribute", readDoorLockClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("doorLock", readDoorLockInteractionInfo); - Map readElectricalMeasurementInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readElectricalMeasurementMeasurementTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasurementTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readMeasurementTypeAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readElectricalMeasurementMeasurementTypeCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readMeasurementTypeAttribute", - readElectricalMeasurementMeasurementTypeAttributeInteractionInfo); - Map readElectricalMeasurementTotalActivePowerCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementTotalActivePowerAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readTotalActivePowerAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readElectricalMeasurementTotalActivePowerCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readTotalActivePowerAttribute", - readElectricalMeasurementTotalActivePowerAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readRmsVoltageAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readRmsVoltageAttribute", readElectricalMeasurementRmsVoltageAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMinCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readRmsVoltageMinAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMinCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readRmsVoltageMinAttribute", - readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMaxCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readRmsVoltageMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMaxCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readRmsVoltageMaxAttribute", - readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readRmsCurrentAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readRmsCurrentAttribute", readElectricalMeasurementRmsCurrentAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMinCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readRmsCurrentMinAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMinCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readRmsCurrentMinAttribute", - readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMaxCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readRmsCurrentMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMaxCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readRmsCurrentMaxAttribute", - readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readActivePowerAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readActivePowerAttribute", readElectricalMeasurementActivePowerAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMinCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMinAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readActivePowerMinAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMinCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readActivePowerMinAttribute", - readElectricalMeasurementActivePowerMinAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMaxCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMaxAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readActivePowerMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMaxCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readActivePowerMaxAttribute", - readElectricalMeasurementActivePowerMaxAttributeInteractionInfo); - Map readElectricalMeasurementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readElectricalMeasurementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readElectricalMeasurementClusterRevisionCommandParams); - readElectricalMeasurementInteractionInfo.put( - "readClusterRevisionAttribute", - readElectricalMeasurementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("electricalMeasurement", readElectricalMeasurementInteractionInfo); - Map readEthernetNetworkDiagnosticsInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readEthernetNetworkDiagnosticsPHYRateCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsPHYRateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readPHYRateAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readEthernetNetworkDiagnosticsPHYRateCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readPHYRateAttribute", readEthernetNetworkDiagnosticsPHYRateAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsFullDuplexCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsFullDuplexAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readFullDuplexAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readEthernetNetworkDiagnosticsFullDuplexCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readFullDuplexAttribute", - readEthernetNetworkDiagnosticsFullDuplexAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsPacketRxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsPacketRxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readPacketRxCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readEthernetNetworkDiagnosticsPacketRxCountCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readPacketRxCountAttribute", - readEthernetNetworkDiagnosticsPacketRxCountAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsPacketTxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsPacketTxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readPacketTxCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readEthernetNetworkDiagnosticsPacketTxCountCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readPacketTxCountAttribute", - readEthernetNetworkDiagnosticsPacketTxCountAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsTxErrCountCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsTxErrCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readTxErrCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readEthernetNetworkDiagnosticsTxErrCountCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readTxErrCountAttribute", - readEthernetNetworkDiagnosticsTxErrCountAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsCollisionCountCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsCollisionCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readCollisionCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readEthernetNetworkDiagnosticsCollisionCountCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readCollisionCountAttribute", - readEthernetNetworkDiagnosticsCollisionCountAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsOverrunCountCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsOverrunCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readEthernetNetworkDiagnosticsOverrunCountCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readOverrunCountAttribute", - readEthernetNetworkDiagnosticsOverrunCountAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsCarrierDetectCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsCarrierDetectAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readCarrierDetectAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readEthernetNetworkDiagnosticsCarrierDetectCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readCarrierDetectAttribute", - readEthernetNetworkDiagnosticsCarrierDetectAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsTimeSinceResetCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsTimeSinceResetAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readTimeSinceResetAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readEthernetNetworkDiagnosticsTimeSinceResetCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readTimeSinceResetAttribute", - readEthernetNetworkDiagnosticsTimeSinceResetAttributeInteractionInfo); - Map readEthernetNetworkDiagnosticsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readEthernetNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readEthernetNetworkDiagnosticsClusterRevisionCommandParams); - readEthernetNetworkDiagnosticsInteractionInfo.put( - "readClusterRevisionAttribute", - readEthernetNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put( - "ethernetNetworkDiagnostics", readEthernetNetworkDiagnosticsInteractionInfo); - Map readFixedLabelInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readFixedLabelLabelListCommandParams = - new LinkedHashMap(); - InteractionInfo readFixedLabelLabelListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FixedLabelCluster) cluster) - .readLabelListAttribute( - (ChipClusters.FixedLabelCluster.LabelListAttributeCallback) callback); - }, - () -> new DelegatedLabelListAttributeCallback(), - readFixedLabelLabelListCommandParams); - readFixedLabelInteractionInfo.put( - "readLabelListAttribute", readFixedLabelLabelListAttributeInteractionInfo); - Map readFixedLabelClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readFixedLabelClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FixedLabelCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readFixedLabelClusterRevisionCommandParams); - readFixedLabelInteractionInfo.put( - "readClusterRevisionAttribute", readFixedLabelClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("fixedLabel", readFixedLabelInteractionInfo); - Map readFlowMeasurementInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readFlowMeasurementMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readFlowMeasurementMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FlowMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readFlowMeasurementMeasuredValueCommandParams); - readFlowMeasurementInteractionInfo.put( - "readMeasuredValueAttribute", readFlowMeasurementMeasuredValueAttributeInteractionInfo); - Map readFlowMeasurementMinMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readFlowMeasurementMinMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FlowMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readFlowMeasurementMinMeasuredValueCommandParams); - readFlowMeasurementInteractionInfo.put( - "readMinMeasuredValueAttribute", - readFlowMeasurementMinMeasuredValueAttributeInteractionInfo); - Map readFlowMeasurementMaxMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readFlowMeasurementMaxMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FlowMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readFlowMeasurementMaxMeasuredValueCommandParams); - readFlowMeasurementInteractionInfo.put( - "readMaxMeasuredValueAttribute", - readFlowMeasurementMaxMeasuredValueAttributeInteractionInfo); - Map readFlowMeasurementToleranceCommandParams = - new LinkedHashMap(); - InteractionInfo readFlowMeasurementToleranceAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FlowMeasurementCluster) cluster) - .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readFlowMeasurementToleranceCommandParams); - readFlowMeasurementInteractionInfo.put( - "readToleranceAttribute", readFlowMeasurementToleranceAttributeInteractionInfo); - Map readFlowMeasurementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readFlowMeasurementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FlowMeasurementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readFlowMeasurementClusterRevisionCommandParams); - readFlowMeasurementInteractionInfo.put( - "readClusterRevisionAttribute", readFlowMeasurementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("flowMeasurement", readFlowMeasurementInteractionInfo); - Map readGeneralCommissioningInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readGeneralCommissioningBreadcrumbCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralCommissioningBreadcrumbAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralCommissioningCluster) cluster) - .readBreadcrumbAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readGeneralCommissioningBreadcrumbCommandParams); - readGeneralCommissioningInteractionInfo.put( - "readBreadcrumbAttribute", readGeneralCommissioningBreadcrumbAttributeInteractionInfo); - Map - readGeneralCommissioningBasicCommissioningInfoListCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralCommissioningBasicCommissioningInfoListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralCommissioningCluster) cluster) - .readBasicCommissioningInfoListAttribute( - (ChipClusters.GeneralCommissioningCluster - .BasicCommissioningInfoListAttributeCallback) - callback); - }, - () -> new DelegatedBasicCommissioningInfoListAttributeCallback(), - readGeneralCommissioningBasicCommissioningInfoListCommandParams); - readGeneralCommissioningInteractionInfo.put( - "readBasicCommissioningInfoListAttribute", - readGeneralCommissioningBasicCommissioningInfoListAttributeInteractionInfo); - Map readGeneralCommissioningClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralCommissioningClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralCommissioningCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGeneralCommissioningClusterRevisionCommandParams); - readGeneralCommissioningInteractionInfo.put( - "readClusterRevisionAttribute", - readGeneralCommissioningClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("generalCommissioning", readGeneralCommissioningInteractionInfo); - Map readGeneralDiagnosticsInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readGeneralDiagnosticsNetworkInterfacesCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsNetworkInterfacesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readNetworkInterfacesAttribute( - (ChipClusters.GeneralDiagnosticsCluster.NetworkInterfacesAttributeCallback) - callback); - }, - () -> new DelegatedNetworkInterfacesAttributeCallback(), - readGeneralDiagnosticsNetworkInterfacesCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readNetworkInterfacesAttribute", - readGeneralDiagnosticsNetworkInterfacesAttributeInteractionInfo); - Map readGeneralDiagnosticsRebootCountCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsRebootCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readRebootCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGeneralDiagnosticsRebootCountCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readRebootCountAttribute", readGeneralDiagnosticsRebootCountAttributeInteractionInfo); - Map readGeneralDiagnosticsUpTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsUpTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readUpTimeAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readGeneralDiagnosticsUpTimeCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readUpTimeAttribute", readGeneralDiagnosticsUpTimeAttributeInteractionInfo); - Map readGeneralDiagnosticsTotalOperationalHoursCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsTotalOperationalHoursAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readTotalOperationalHoursAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readGeneralDiagnosticsTotalOperationalHoursCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readTotalOperationalHoursAttribute", - readGeneralDiagnosticsTotalOperationalHoursAttributeInteractionInfo); - Map readGeneralDiagnosticsBootReasonsCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsBootReasonsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readBootReasonsAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGeneralDiagnosticsBootReasonsCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readBootReasonsAttribute", readGeneralDiagnosticsBootReasonsAttributeInteractionInfo); - Map readGeneralDiagnosticsActiveHardwareFaultsCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsActiveHardwareFaultsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readActiveHardwareFaultsAttribute( - (ChipClusters.GeneralDiagnosticsCluster.ActiveHardwareFaultsAttributeCallback) - callback); - }, - () -> new DelegatedActiveHardwareFaultsAttributeCallback(), - readGeneralDiagnosticsActiveHardwareFaultsCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readActiveHardwareFaultsAttribute", - readGeneralDiagnosticsActiveHardwareFaultsAttributeInteractionInfo); - Map readGeneralDiagnosticsActiveRadioFaultsCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsActiveRadioFaultsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readActiveRadioFaultsAttribute( - (ChipClusters.GeneralDiagnosticsCluster.ActiveRadioFaultsAttributeCallback) - callback); - }, - () -> new DelegatedActiveRadioFaultsAttributeCallback(), - readGeneralDiagnosticsActiveRadioFaultsCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readActiveRadioFaultsAttribute", - readGeneralDiagnosticsActiveRadioFaultsAttributeInteractionInfo); - Map readGeneralDiagnosticsActiveNetworkFaultsCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsActiveNetworkFaultsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readActiveNetworkFaultsAttribute( - (ChipClusters.GeneralDiagnosticsCluster.ActiveNetworkFaultsAttributeCallback) - callback); - }, - () -> new DelegatedActiveNetworkFaultsAttributeCallback(), - readGeneralDiagnosticsActiveNetworkFaultsCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readActiveNetworkFaultsAttribute", - readGeneralDiagnosticsActiveNetworkFaultsAttributeInteractionInfo); - Map readGeneralDiagnosticsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GeneralDiagnosticsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGeneralDiagnosticsClusterRevisionCommandParams); - readGeneralDiagnosticsInteractionInfo.put( - "readClusterRevisionAttribute", - readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("generalDiagnostics", readGeneralDiagnosticsInteractionInfo); - Map readGroupKeyManagementInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readGroupKeyManagementGroupsCommandParams = - new LinkedHashMap(); - InteractionInfo readGroupKeyManagementGroupsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GroupKeyManagementCluster) cluster) - .readGroupsAttribute( - (ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback) callback); - }, - () -> new DelegatedGroupsAttributeCallback(), - readGroupKeyManagementGroupsCommandParams); - readGroupKeyManagementInteractionInfo.put( - "readGroupsAttribute", readGroupKeyManagementGroupsAttributeInteractionInfo); - Map readGroupKeyManagementGroupKeysCommandParams = - new LinkedHashMap(); - InteractionInfo readGroupKeyManagementGroupKeysAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GroupKeyManagementCluster) cluster) - .readGroupKeysAttribute( - (ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback) callback); - }, - () -> new DelegatedGroupKeysAttributeCallback(), - readGroupKeyManagementGroupKeysCommandParams); - readGroupKeyManagementInteractionInfo.put( - "readGroupKeysAttribute", readGroupKeyManagementGroupKeysAttributeInteractionInfo); - Map readGroupKeyManagementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readGroupKeyManagementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GroupKeyManagementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGroupKeyManagementClusterRevisionCommandParams); - readGroupKeyManagementInteractionInfo.put( - "readClusterRevisionAttribute", - readGroupKeyManagementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("groupKeyManagement", readGroupKeyManagementInteractionInfo); - Map readGroupsInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readGroupsNameSupportCommandParams = - new LinkedHashMap(); - InteractionInfo readGroupsNameSupportAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GroupsCluster) cluster) - .readNameSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGroupsNameSupportCommandParams); - readGroupsInteractionInfo.put( - "readNameSupportAttribute", readGroupsNameSupportAttributeInteractionInfo); - Map readGroupsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readGroupsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.GroupsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readGroupsClusterRevisionCommandParams); - readGroupsInteractionInfo.put( - "readClusterRevisionAttribute", readGroupsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("groups", readGroupsInteractionInfo); - Map readIdentifyInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readIdentifyIdentifyTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readIdentifyIdentifyTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IdentifyCluster) cluster) - .readIdentifyTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIdentifyIdentifyTimeCommandParams); - readIdentifyInteractionInfo.put( - "readIdentifyTimeAttribute", readIdentifyIdentifyTimeAttributeInteractionInfo); - Map readIdentifyIdentifyTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readIdentifyIdentifyTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IdentifyCluster) cluster) - .readIdentifyTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIdentifyIdentifyTypeCommandParams); - readIdentifyInteractionInfo.put( - "readIdentifyTypeAttribute", readIdentifyIdentifyTypeAttributeInteractionInfo); - Map readIdentifyClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readIdentifyClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IdentifyCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIdentifyClusterRevisionCommandParams); - readIdentifyInteractionInfo.put( - "readClusterRevisionAttribute", readIdentifyClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("identify", readIdentifyInteractionInfo); - Map readIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readIlluminanceMeasurementMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readIlluminanceMeasurementMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIlluminanceMeasurementMeasuredValueCommandParams); - readIlluminanceMeasurementInteractionInfo.put( - "readMeasuredValueAttribute", - readIlluminanceMeasurementMeasuredValueAttributeInteractionInfo); - Map readIlluminanceMeasurementMinMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readIlluminanceMeasurementMinMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIlluminanceMeasurementMinMeasuredValueCommandParams); - readIlluminanceMeasurementInteractionInfo.put( - "readMinMeasuredValueAttribute", - readIlluminanceMeasurementMinMeasuredValueAttributeInteractionInfo); - Map readIlluminanceMeasurementMaxMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readIlluminanceMeasurementMaxMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIlluminanceMeasurementMaxMeasuredValueCommandParams); - readIlluminanceMeasurementInteractionInfo.put( - "readMaxMeasuredValueAttribute", - readIlluminanceMeasurementMaxMeasuredValueAttributeInteractionInfo); - Map readIlluminanceMeasurementToleranceCommandParams = - new LinkedHashMap(); - InteractionInfo readIlluminanceMeasurementToleranceAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIlluminanceMeasurementToleranceCommandParams); - readIlluminanceMeasurementInteractionInfo.put( - "readToleranceAttribute", readIlluminanceMeasurementToleranceAttributeInteractionInfo); - Map readIlluminanceMeasurementLightSensorTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readIlluminanceMeasurementLightSensorTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readLightSensorTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIlluminanceMeasurementLightSensorTypeCommandParams); - readIlluminanceMeasurementInteractionInfo.put( - "readLightSensorTypeAttribute", - readIlluminanceMeasurementLightSensorTypeAttributeInteractionInfo); - Map readIlluminanceMeasurementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readIlluminanceMeasurementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readIlluminanceMeasurementClusterRevisionCommandParams); - readIlluminanceMeasurementInteractionInfo.put( - "readClusterRevisionAttribute", - readIlluminanceMeasurementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("illuminanceMeasurement", readIlluminanceMeasurementInteractionInfo); - Map readKeypadInputInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readKeypadInputClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readKeypadInputClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.KeypadInputCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readKeypadInputClusterRevisionCommandParams); - readKeypadInputInteractionInfo.put( - "readClusterRevisionAttribute", readKeypadInputClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("keypadInput", readKeypadInputInteractionInfo); - Map readLevelControlInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readLevelControlCurrentLevelCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlCurrentLevelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readCurrentLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlCurrentLevelCommandParams); - readLevelControlInteractionInfo.put( - "readCurrentLevelAttribute", readLevelControlCurrentLevelAttributeInteractionInfo); - Map readLevelControlRemainingTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlRemainingTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readRemainingTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlRemainingTimeCommandParams); - readLevelControlInteractionInfo.put( - "readRemainingTimeAttribute", readLevelControlRemainingTimeAttributeInteractionInfo); - Map readLevelControlMinLevelCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlMinLevelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlMinLevelCommandParams); - readLevelControlInteractionInfo.put( - "readMinLevelAttribute", readLevelControlMinLevelAttributeInteractionInfo); - Map readLevelControlMaxLevelCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlMaxLevelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlMaxLevelCommandParams); - readLevelControlInteractionInfo.put( - "readMaxLevelAttribute", readLevelControlMaxLevelAttributeInteractionInfo); - Map readLevelControlCurrentFrequencyCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlCurrentFrequencyAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readCurrentFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlCurrentFrequencyCommandParams); - readLevelControlInteractionInfo.put( - "readCurrentFrequencyAttribute", readLevelControlCurrentFrequencyAttributeInteractionInfo); - Map readLevelControlMinFrequencyCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlMinFrequencyAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readMinFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlMinFrequencyCommandParams); - readLevelControlInteractionInfo.put( - "readMinFrequencyAttribute", readLevelControlMinFrequencyAttributeInteractionInfo); - Map readLevelControlMaxFrequencyCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlMaxFrequencyAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readMaxFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlMaxFrequencyCommandParams); - readLevelControlInteractionInfo.put( - "readMaxFrequencyAttribute", readLevelControlMaxFrequencyAttributeInteractionInfo); - Map readLevelControlOptionsCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlOptionsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readOptionsAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlOptionsCommandParams); - readLevelControlInteractionInfo.put( - "readOptionsAttribute", readLevelControlOptionsAttributeInteractionInfo); - Map readLevelControlOnOffTransitionTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlOnOffTransitionTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readOnOffTransitionTimeAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlOnOffTransitionTimeCommandParams); - readLevelControlInteractionInfo.put( - "readOnOffTransitionTimeAttribute", - readLevelControlOnOffTransitionTimeAttributeInteractionInfo); - Map readLevelControlOnLevelCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlOnLevelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readOnLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlOnLevelCommandParams); - readLevelControlInteractionInfo.put( - "readOnLevelAttribute", readLevelControlOnLevelAttributeInteractionInfo); - Map readLevelControlOnTransitionTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlOnTransitionTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readOnTransitionTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlOnTransitionTimeCommandParams); - readLevelControlInteractionInfo.put( - "readOnTransitionTimeAttribute", readLevelControlOnTransitionTimeAttributeInteractionInfo); - Map readLevelControlOffTransitionTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlOffTransitionTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readOffTransitionTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlOffTransitionTimeCommandParams); - readLevelControlInteractionInfo.put( - "readOffTransitionTimeAttribute", - readLevelControlOffTransitionTimeAttributeInteractionInfo); - Map readLevelControlDefaultMoveRateCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlDefaultMoveRateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readDefaultMoveRateAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlDefaultMoveRateCommandParams); - readLevelControlInteractionInfo.put( - "readDefaultMoveRateAttribute", readLevelControlDefaultMoveRateAttributeInteractionInfo); - Map readLevelControlStartUpCurrentLevelCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlStartUpCurrentLevelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readStartUpCurrentLevelAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlStartUpCurrentLevelCommandParams); - readLevelControlInteractionInfo.put( - "readStartUpCurrentLevelAttribute", - readLevelControlStartUpCurrentLevelAttributeInteractionInfo); - Map readLevelControlClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readLevelControlClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LevelControlCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLevelControlClusterRevisionCommandParams); - readLevelControlInteractionInfo.put( - "readClusterRevisionAttribute", readLevelControlClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("levelControl", readLevelControlInteractionInfo); - Map readLowPowerInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readLowPowerClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readLowPowerClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LowPowerCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readLowPowerClusterRevisionCommandParams); - readLowPowerInteractionInfo.put( - "readClusterRevisionAttribute", readLowPowerClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("lowPower", readLowPowerInteractionInfo); - Map readMediaInputInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readMediaInputMediaInputListCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaInputMediaInputListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .readMediaInputListAttribute( - (ChipClusters.MediaInputCluster.MediaInputListAttributeCallback) callback); - }, - () -> new DelegatedMediaInputListAttributeCallback(), - readMediaInputMediaInputListCommandParams); - readMediaInputInteractionInfo.put( - "readMediaInputListAttribute", readMediaInputMediaInputListAttributeInteractionInfo); - Map readMediaInputCurrentMediaInputCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaInputCurrentMediaInputAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .readCurrentMediaInputAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readMediaInputCurrentMediaInputCommandParams); - readMediaInputInteractionInfo.put( - "readCurrentMediaInputAttribute", readMediaInputCurrentMediaInputAttributeInteractionInfo); - Map readMediaInputClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaInputClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readMediaInputClusterRevisionCommandParams); - readMediaInputInteractionInfo.put( - "readClusterRevisionAttribute", readMediaInputClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("mediaInput", readMediaInputInteractionInfo); - Map readMediaPlaybackInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readMediaPlaybackPlaybackStateCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackPlaybackStateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readPlaybackStateAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readMediaPlaybackPlaybackStateCommandParams); - readMediaPlaybackInteractionInfo.put( - "readPlaybackStateAttribute", readMediaPlaybackPlaybackStateAttributeInteractionInfo); - Map readMediaPlaybackStartTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackStartTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readStartTimeAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackStartTimeCommandParams); - readMediaPlaybackInteractionInfo.put( - "readStartTimeAttribute", readMediaPlaybackStartTimeAttributeInteractionInfo); - Map readMediaPlaybackDurationCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackDurationAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readDurationAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackDurationCommandParams); - readMediaPlaybackInteractionInfo.put( - "readDurationAttribute", readMediaPlaybackDurationAttributeInteractionInfo); - Map readMediaPlaybackPositionUpdatedAtCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackPositionUpdatedAtAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readPositionUpdatedAtAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackPositionUpdatedAtCommandParams); - readMediaPlaybackInteractionInfo.put( - "readPositionUpdatedAtAttribute", - readMediaPlaybackPositionUpdatedAtAttributeInteractionInfo); - Map readMediaPlaybackPositionCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackPositionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readPositionAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackPositionCommandParams); - readMediaPlaybackInteractionInfo.put( - "readPositionAttribute", readMediaPlaybackPositionAttributeInteractionInfo); - Map readMediaPlaybackPlaybackSpeedCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackPlaybackSpeedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readPlaybackSpeedAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackPlaybackSpeedCommandParams); - readMediaPlaybackInteractionInfo.put( - "readPlaybackSpeedAttribute", readMediaPlaybackPlaybackSpeedAttributeInteractionInfo); - Map readMediaPlaybackSeekRangeEndCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackSeekRangeEndAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readSeekRangeEndAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackSeekRangeEndCommandParams); - readMediaPlaybackInteractionInfo.put( - "readSeekRangeEndAttribute", readMediaPlaybackSeekRangeEndAttributeInteractionInfo); - Map readMediaPlaybackSeekRangeStartCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackSeekRangeStartAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readSeekRangeStartAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readMediaPlaybackSeekRangeStartCommandParams); - readMediaPlaybackInteractionInfo.put( - "readSeekRangeStartAttribute", readMediaPlaybackSeekRangeStartAttributeInteractionInfo); - Map readMediaPlaybackClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readMediaPlaybackClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readMediaPlaybackClusterRevisionCommandParams); - readMediaPlaybackInteractionInfo.put( - "readClusterRevisionAttribute", readMediaPlaybackClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("mediaPlayback", readMediaPlaybackInteractionInfo); - Map readModeSelectInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readModeSelectCurrentModeCommandParams = - new LinkedHashMap(); - InteractionInfo readModeSelectCurrentModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .readCurrentModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readModeSelectCurrentModeCommandParams); - readModeSelectInteractionInfo.put( - "readCurrentModeAttribute", readModeSelectCurrentModeAttributeInteractionInfo); - Map readModeSelectSupportedModesCommandParams = - new LinkedHashMap(); - InteractionInfo readModeSelectSupportedModesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .readSupportedModesAttribute( - (ChipClusters.ModeSelectCluster.SupportedModesAttributeCallback) callback); - }, - () -> new DelegatedSupportedModesAttributeCallback(), - readModeSelectSupportedModesCommandParams); - readModeSelectInteractionInfo.put( - "readSupportedModesAttribute", readModeSelectSupportedModesAttributeInteractionInfo); - Map readModeSelectOnModeCommandParams = - new LinkedHashMap(); - InteractionInfo readModeSelectOnModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .readOnModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readModeSelectOnModeCommandParams); - readModeSelectInteractionInfo.put( - "readOnModeAttribute", readModeSelectOnModeAttributeInteractionInfo); - Map readModeSelectStartUpModeCommandParams = - new LinkedHashMap(); - InteractionInfo readModeSelectStartUpModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .readStartUpModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readModeSelectStartUpModeCommandParams); - readModeSelectInteractionInfo.put( - "readStartUpModeAttribute", readModeSelectStartUpModeAttributeInteractionInfo); - Map readModeSelectDescriptionCommandParams = - new LinkedHashMap(); - InteractionInfo readModeSelectDescriptionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readModeSelectDescriptionCommandParams); - readModeSelectInteractionInfo.put( - "readDescriptionAttribute", readModeSelectDescriptionAttributeInteractionInfo); - Map readModeSelectClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readModeSelectClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readModeSelectClusterRevisionCommandParams); - readModeSelectInteractionInfo.put( - "readClusterRevisionAttribute", readModeSelectClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("modeSelect", readModeSelectInteractionInfo); - Map readNetworkCommissioningInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readNetworkCommissioningFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readNetworkCommissioningFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.NetworkCommissioningCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readNetworkCommissioningFeatureMapCommandParams); - readNetworkCommissioningInteractionInfo.put( - "readFeatureMapAttribute", readNetworkCommissioningFeatureMapAttributeInteractionInfo); - Map readNetworkCommissioningClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readNetworkCommissioningClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.NetworkCommissioningCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readNetworkCommissioningClusterRevisionCommandParams); - readNetworkCommissioningInteractionInfo.put( - "readClusterRevisionAttribute", - readNetworkCommissioningClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("networkCommissioning", readNetworkCommissioningInteractionInfo); - Map readOtaSoftwareUpdateProviderInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readOtaSoftwareUpdateProviderClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readOtaSoftwareUpdateProviderClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OtaSoftwareUpdateProviderCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOtaSoftwareUpdateProviderClusterRevisionCommandParams); - readOtaSoftwareUpdateProviderInteractionInfo.put( - "readClusterRevisionAttribute", - readOtaSoftwareUpdateProviderClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("otaSoftwareUpdateProvider", readOtaSoftwareUpdateProviderInteractionInfo); - Map readOtaSoftwareUpdateRequestorInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map - readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams = - new LinkedHashMap(); - InteractionInfo readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) - .readDefaultOtaProviderAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams); - readOtaSoftwareUpdateRequestorInteractionInfo.put( - "readDefaultOtaProviderAttribute", - readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo); - Map readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams = - new LinkedHashMap(); - InteractionInfo readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) - .readUpdatePossibleAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams); - readOtaSoftwareUpdateRequestorInteractionInfo.put( - "readUpdatePossibleAttribute", - readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo); - Map readOtaSoftwareUpdateRequestorClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readOtaSoftwareUpdateRequestorClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOtaSoftwareUpdateRequestorClusterRevisionCommandParams); - readOtaSoftwareUpdateRequestorInteractionInfo.put( - "readClusterRevisionAttribute", - readOtaSoftwareUpdateRequestorClusterRevisionAttributeInteractionInfo); - readAttributeMap.put( - "otaSoftwareUpdateRequestor", readOtaSoftwareUpdateRequestorInteractionInfo); - Map readOccupancySensingInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readOccupancySensingOccupancyCommandParams = - new LinkedHashMap(); - InteractionInfo readOccupancySensingOccupancyAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OccupancySensingCluster) cluster) - .readOccupancyAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOccupancySensingOccupancyCommandParams); - readOccupancySensingInteractionInfo.put( - "readOccupancyAttribute", readOccupancySensingOccupancyAttributeInteractionInfo); - Map readOccupancySensingOccupancySensorTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readOccupancySensingOccupancySensorTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OccupancySensingCluster) cluster) - .readOccupancySensorTypeAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOccupancySensingOccupancySensorTypeCommandParams); - readOccupancySensingInteractionInfo.put( - "readOccupancySensorTypeAttribute", - readOccupancySensingOccupancySensorTypeAttributeInteractionInfo); - Map readOccupancySensingOccupancySensorTypeBitmapCommandParams = - new LinkedHashMap(); - InteractionInfo readOccupancySensingOccupancySensorTypeBitmapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OccupancySensingCluster) cluster) - .readOccupancySensorTypeBitmapAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOccupancySensingOccupancySensorTypeBitmapCommandParams); - readOccupancySensingInteractionInfo.put( - "readOccupancySensorTypeBitmapAttribute", - readOccupancySensingOccupancySensorTypeBitmapAttributeInteractionInfo); - Map readOccupancySensingClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readOccupancySensingClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OccupancySensingCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOccupancySensingClusterRevisionCommandParams); - readOccupancySensingInteractionInfo.put( - "readClusterRevisionAttribute", - readOccupancySensingClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("occupancySensing", readOccupancySensingInteractionInfo); - Map readOnOffInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readOnOffOnOffCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffOnOffAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readOnOffAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readOnOffOnOffCommandParams); - readOnOffInteractionInfo.put("readOnOffAttribute", readOnOffOnOffAttributeInteractionInfo); - Map readOnOffGlobalSceneControlCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffGlobalSceneControlAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readGlobalSceneControlAttribute( - (ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readOnOffGlobalSceneControlCommandParams); - readOnOffInteractionInfo.put( - "readGlobalSceneControlAttribute", readOnOffGlobalSceneControlAttributeInteractionInfo); - Map readOnOffOnTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffOnTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readOnTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffOnTimeCommandParams); - readOnOffInteractionInfo.put("readOnTimeAttribute", readOnOffOnTimeAttributeInteractionInfo); - Map readOnOffOffWaitTimeCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffOffWaitTimeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readOffWaitTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffOffWaitTimeCommandParams); - readOnOffInteractionInfo.put( - "readOffWaitTimeAttribute", readOnOffOffWaitTimeAttributeInteractionInfo); - Map readOnOffStartUpOnOffCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffStartUpOnOffAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readStartUpOnOffAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffStartUpOnOffCommandParams); - readOnOffInteractionInfo.put( - "readStartUpOnOffAttribute", readOnOffStartUpOnOffAttributeInteractionInfo); - Map readOnOffFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readOnOffFeatureMapCommandParams); - readOnOffInteractionInfo.put( - "readFeatureMapAttribute", readOnOffFeatureMapAttributeInteractionInfo); - Map readOnOffClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffClusterRevisionCommandParams); - readOnOffInteractionInfo.put( - "readClusterRevisionAttribute", readOnOffClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("onOff", readOnOffInteractionInfo); - Map readOnOffSwitchConfigurationInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readOnOffSwitchConfigurationSwitchTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) - .readSwitchTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffSwitchConfigurationSwitchTypeCommandParams); - readOnOffSwitchConfigurationInteractionInfo.put( - "readSwitchTypeAttribute", readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo); - Map readOnOffSwitchConfigurationSwitchActionsCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) - .readSwitchActionsAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffSwitchConfigurationSwitchActionsCommandParams); - readOnOffSwitchConfigurationInteractionInfo.put( - "readSwitchActionsAttribute", - readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo); - Map readOnOffSwitchConfigurationClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOnOffSwitchConfigurationClusterRevisionCommandParams); - readOnOffSwitchConfigurationInteractionInfo.put( - "readClusterRevisionAttribute", - readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo); - Map readOperationalCredentialsInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readOperationalCredentialsFabricsListCommandParams = - new LinkedHashMap(); - InteractionInfo readOperationalCredentialsFabricsListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .readFabricsListAttribute( - (ChipClusters.OperationalCredentialsCluster.FabricsListAttributeCallback) - callback); - }, - () -> new DelegatedFabricsListAttributeCallback(), - readOperationalCredentialsFabricsListCommandParams); - readOperationalCredentialsInteractionInfo.put( - "readFabricsListAttribute", readOperationalCredentialsFabricsListAttributeInteractionInfo); - Map readOperationalCredentialsSupportedFabricsCommandParams = - new LinkedHashMap(); - InteractionInfo readOperationalCredentialsSupportedFabricsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .readSupportedFabricsAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOperationalCredentialsSupportedFabricsCommandParams); - readOperationalCredentialsInteractionInfo.put( - "readSupportedFabricsAttribute", - readOperationalCredentialsSupportedFabricsAttributeInteractionInfo); - Map readOperationalCredentialsCommissionedFabricsCommandParams = - new LinkedHashMap(); - InteractionInfo readOperationalCredentialsCommissionedFabricsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .readCommissionedFabricsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOperationalCredentialsCommissionedFabricsCommandParams); - readOperationalCredentialsInteractionInfo.put( - "readCommissionedFabricsAttribute", - readOperationalCredentialsCommissionedFabricsAttributeInteractionInfo); - Map - readOperationalCredentialsTrustedRootCertificatesCommandParams = - new LinkedHashMap(); - InteractionInfo readOperationalCredentialsTrustedRootCertificatesAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .readTrustedRootCertificatesAttribute( - (ChipClusters.OperationalCredentialsCluster - .TrustedRootCertificatesAttributeCallback) - callback); - }, - () -> new DelegatedTrustedRootCertificatesAttributeCallback(), - readOperationalCredentialsTrustedRootCertificatesCommandParams); - readOperationalCredentialsInteractionInfo.put( - "readTrustedRootCertificatesAttribute", - readOperationalCredentialsTrustedRootCertificatesAttributeInteractionInfo); - Map readOperationalCredentialsCurrentFabricIndexCommandParams = - new LinkedHashMap(); - InteractionInfo readOperationalCredentialsCurrentFabricIndexAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .readCurrentFabricIndexAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOperationalCredentialsCurrentFabricIndexCommandParams); - readOperationalCredentialsInteractionInfo.put( - "readCurrentFabricIndexAttribute", - readOperationalCredentialsCurrentFabricIndexAttributeInteractionInfo); - Map readOperationalCredentialsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readOperationalCredentialsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readOperationalCredentialsClusterRevisionCommandParams); - readOperationalCredentialsInteractionInfo.put( - "readClusterRevisionAttribute", - readOperationalCredentialsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("operationalCredentials", readOperationalCredentialsInteractionInfo); - Map readPowerSourceInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readPowerSourceStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPowerSourceStatusCommandParams); - readPowerSourceInteractionInfo.put( - "readStatusAttribute", readPowerSourceStatusAttributeInteractionInfo); - Map readPowerSourceOrderCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceOrderAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readOrderAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPowerSourceOrderCommandParams); - readPowerSourceInteractionInfo.put( - "readOrderAttribute", readPowerSourceOrderAttributeInteractionInfo); - Map readPowerSourceDescriptionCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceDescriptionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readPowerSourceDescriptionCommandParams); - readPowerSourceInteractionInfo.put( - "readDescriptionAttribute", readPowerSourceDescriptionAttributeInteractionInfo); - Map readPowerSourceBatteryVoltageCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceBatteryVoltageAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readBatteryVoltageAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readPowerSourceBatteryVoltageCommandParams); - readPowerSourceInteractionInfo.put( - "readBatteryVoltageAttribute", readPowerSourceBatteryVoltageAttributeInteractionInfo); - Map readPowerSourceBatteryPercentRemainingCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceBatteryPercentRemainingAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readBatteryPercentRemainingAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPowerSourceBatteryPercentRemainingCommandParams); - readPowerSourceInteractionInfo.put( - "readBatteryPercentRemainingAttribute", - readPowerSourceBatteryPercentRemainingAttributeInteractionInfo); - Map readPowerSourceBatteryTimeRemainingCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceBatteryTimeRemainingAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readBatteryTimeRemainingAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readPowerSourceBatteryTimeRemainingCommandParams); - readPowerSourceInteractionInfo.put( - "readBatteryTimeRemainingAttribute", - readPowerSourceBatteryTimeRemainingAttributeInteractionInfo); - Map readPowerSourceBatteryChargeLevelCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceBatteryChargeLevelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readBatteryChargeLevelAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPowerSourceBatteryChargeLevelCommandParams); - readPowerSourceInteractionInfo.put( - "readBatteryChargeLevelAttribute", - readPowerSourceBatteryChargeLevelAttributeInteractionInfo); - Map readPowerSourceActiveBatteryFaultsCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceActiveBatteryFaultsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readActiveBatteryFaultsAttribute( - (ChipClusters.PowerSourceCluster.ActiveBatteryFaultsAttributeCallback) - callback); - }, - () -> new DelegatedActiveBatteryFaultsAttributeCallback(), - readPowerSourceActiveBatteryFaultsCommandParams); - readPowerSourceInteractionInfo.put( - "readActiveBatteryFaultsAttribute", - readPowerSourceActiveBatteryFaultsAttributeInteractionInfo); - Map readPowerSourceBatteryChargeStateCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceBatteryChargeStateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readBatteryChargeStateAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPowerSourceBatteryChargeStateCommandParams); - readPowerSourceInteractionInfo.put( - "readBatteryChargeStateAttribute", - readPowerSourceBatteryChargeStateAttributeInteractionInfo); - Map readPowerSourceFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readPowerSourceFeatureMapCommandParams); - readPowerSourceInteractionInfo.put( - "readFeatureMapAttribute", readPowerSourceFeatureMapAttributeInteractionInfo); - Map readPowerSourceClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readPowerSourceClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PowerSourceCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPowerSourceClusterRevisionCommandParams); - readPowerSourceInteractionInfo.put( - "readClusterRevisionAttribute", readPowerSourceClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("powerSource", readPowerSourceInteractionInfo); - Map readPressureMeasurementInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readPressureMeasurementMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readPressureMeasurementMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PressureMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPressureMeasurementMeasuredValueCommandParams); - readPressureMeasurementInteractionInfo.put( - "readMeasuredValueAttribute", readPressureMeasurementMeasuredValueAttributeInteractionInfo); - Map readPressureMeasurementMinMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readPressureMeasurementMinMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PressureMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPressureMeasurementMinMeasuredValueCommandParams); - readPressureMeasurementInteractionInfo.put( - "readMinMeasuredValueAttribute", - readPressureMeasurementMinMeasuredValueAttributeInteractionInfo); - Map readPressureMeasurementMaxMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readPressureMeasurementMaxMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PressureMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPressureMeasurementMaxMeasuredValueCommandParams); - readPressureMeasurementInteractionInfo.put( - "readMaxMeasuredValueAttribute", - readPressureMeasurementMaxMeasuredValueAttributeInteractionInfo); - Map readPressureMeasurementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readPressureMeasurementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PressureMeasurementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPressureMeasurementClusterRevisionCommandParams); - readPressureMeasurementInteractionInfo.put( - "readClusterRevisionAttribute", - readPressureMeasurementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("pressureMeasurement", readPressureMeasurementInteractionInfo); - Map readPumpConfigurationAndControlInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readPumpConfigurationAndControlMaxPressureCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxPressureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxPressureCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxPressureAttribute", - readPumpConfigurationAndControlMaxPressureAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxSpeedCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxSpeedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxSpeedCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxSpeedAttribute", readPumpConfigurationAndControlMaxSpeedAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxFlowCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxFlowAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxFlowCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxFlowAttribute", readPumpConfigurationAndControlMaxFlowAttributeInteractionInfo); - Map readPumpConfigurationAndControlMinConstPressureCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMinConstPressureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMinConstPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMinConstPressureCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMinConstPressureAttribute", - readPumpConfigurationAndControlMinConstPressureAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxConstPressureCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxConstPressureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxConstPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxConstPressureCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxConstPressureAttribute", - readPumpConfigurationAndControlMaxConstPressureAttributeInteractionInfo); - Map readPumpConfigurationAndControlMinCompPressureCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMinCompPressureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMinCompPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMinCompPressureCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMinCompPressureAttribute", - readPumpConfigurationAndControlMinCompPressureAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxCompPressureCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxCompPressureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxCompPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxCompPressureCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxCompPressureAttribute", - readPumpConfigurationAndControlMaxCompPressureAttributeInteractionInfo); - Map readPumpConfigurationAndControlMinConstSpeedCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMinConstSpeedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMinConstSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMinConstSpeedCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMinConstSpeedAttribute", - readPumpConfigurationAndControlMinConstSpeedAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxConstSpeedCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxConstSpeedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxConstSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxConstSpeedCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxConstSpeedAttribute", - readPumpConfigurationAndControlMaxConstSpeedAttributeInteractionInfo); - Map readPumpConfigurationAndControlMinConstFlowCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMinConstFlowAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMinConstFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMinConstFlowCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMinConstFlowAttribute", - readPumpConfigurationAndControlMinConstFlowAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxConstFlowCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxConstFlowAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxConstFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxConstFlowCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxConstFlowAttribute", - readPumpConfigurationAndControlMaxConstFlowAttributeInteractionInfo); - Map readPumpConfigurationAndControlMinConstTempCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMinConstTempAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMinConstTempAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMinConstTempCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMinConstTempAttribute", - readPumpConfigurationAndControlMinConstTempAttributeInteractionInfo); - Map readPumpConfigurationAndControlMaxConstTempCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlMaxConstTempAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readMaxConstTempAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlMaxConstTempCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readMaxConstTempAttribute", - readPumpConfigurationAndControlMaxConstTempAttributeInteractionInfo); - Map readPumpConfigurationAndControlPumpStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlPumpStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readPumpStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlPumpStatusCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readPumpStatusAttribute", - readPumpConfigurationAndControlPumpStatusAttributeInteractionInfo); - Map - readPumpConfigurationAndControlEffectiveOperationModeCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlEffectiveOperationModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readEffectiveOperationModeAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlEffectiveOperationModeCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readEffectiveOperationModeAttribute", - readPumpConfigurationAndControlEffectiveOperationModeAttributeInteractionInfo); - Map - readPumpConfigurationAndControlEffectiveControlModeCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlEffectiveControlModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readEffectiveControlModeAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlEffectiveControlModeCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readEffectiveControlModeAttribute", - readPumpConfigurationAndControlEffectiveControlModeAttributeInteractionInfo); - Map readPumpConfigurationAndControlCapacityCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlCapacityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readCapacityAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlCapacityCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readCapacityAttribute", readPumpConfigurationAndControlCapacityAttributeInteractionInfo); - Map readPumpConfigurationAndControlSpeedCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlSpeedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlSpeedCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readSpeedAttribute", readPumpConfigurationAndControlSpeedAttributeInteractionInfo); - Map - readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readLifetimeEnergyConsumedAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readLifetimeEnergyConsumedAttribute", - readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeInteractionInfo); - Map readPumpConfigurationAndControlOperationModeCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlOperationModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readOperationModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlOperationModeCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readOperationModeAttribute", - readPumpConfigurationAndControlOperationModeAttributeInteractionInfo); - Map readPumpConfigurationAndControlControlModeCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlControlModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readControlModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlControlModeCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readControlModeAttribute", - readPumpConfigurationAndControlControlModeAttributeInteractionInfo); - Map readPumpConfigurationAndControlAlarmMaskCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlAlarmMaskAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readAlarmMaskAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlAlarmMaskCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readAlarmMaskAttribute", readPumpConfigurationAndControlAlarmMaskAttributeInteractionInfo); - Map readPumpConfigurationAndControlFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readPumpConfigurationAndControlFeatureMapCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readFeatureMapAttribute", - readPumpConfigurationAndControlFeatureMapAttributeInteractionInfo); - Map readPumpConfigurationAndControlClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readPumpConfigurationAndControlClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.PumpConfigurationAndControlCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readPumpConfigurationAndControlClusterRevisionCommandParams); - readPumpConfigurationAndControlInteractionInfo.put( - "readClusterRevisionAttribute", - readPumpConfigurationAndControlClusterRevisionAttributeInteractionInfo); - readAttributeMap.put( - "pumpConfigurationAndControl", readPumpConfigurationAndControlInteractionInfo); - Map readRelativeHumidityMeasurementInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readRelativeHumidityMeasurementMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readRelativeHumidityMeasurementMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readRelativeHumidityMeasurementMeasuredValueCommandParams); - readRelativeHumidityMeasurementInteractionInfo.put( - "readMeasuredValueAttribute", - readRelativeHumidityMeasurementMeasuredValueAttributeInteractionInfo); - Map readRelativeHumidityMeasurementMinMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readRelativeHumidityMeasurementMinMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readRelativeHumidityMeasurementMinMeasuredValueCommandParams); - readRelativeHumidityMeasurementInteractionInfo.put( - "readMinMeasuredValueAttribute", - readRelativeHumidityMeasurementMinMeasuredValueAttributeInteractionInfo); - Map readRelativeHumidityMeasurementMaxMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readRelativeHumidityMeasurementMaxMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readRelativeHumidityMeasurementMaxMeasuredValueCommandParams); - readRelativeHumidityMeasurementInteractionInfo.put( - "readMaxMeasuredValueAttribute", - readRelativeHumidityMeasurementMaxMeasuredValueAttributeInteractionInfo); - Map readRelativeHumidityMeasurementToleranceCommandParams = - new LinkedHashMap(); - InteractionInfo readRelativeHumidityMeasurementToleranceAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readRelativeHumidityMeasurementToleranceCommandParams); - readRelativeHumidityMeasurementInteractionInfo.put( - "readToleranceAttribute", readRelativeHumidityMeasurementToleranceAttributeInteractionInfo); - Map readRelativeHumidityMeasurementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readRelativeHumidityMeasurementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readRelativeHumidityMeasurementClusterRevisionCommandParams); - readRelativeHumidityMeasurementInteractionInfo.put( - "readClusterRevisionAttribute", - readRelativeHumidityMeasurementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put( - "relativeHumidityMeasurement", readRelativeHumidityMeasurementInteractionInfo); - Map readScenesInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readScenesSceneCountCommandParams = - new LinkedHashMap(); - InteractionInfo readScenesSceneCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ScenesCluster) cluster) - .readSceneCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readScenesSceneCountCommandParams); - readScenesInteractionInfo.put( - "readSceneCountAttribute", readScenesSceneCountAttributeInteractionInfo); - Map readScenesCurrentSceneCommandParams = - new LinkedHashMap(); - InteractionInfo readScenesCurrentSceneAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ScenesCluster) cluster) - .readCurrentSceneAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readScenesCurrentSceneCommandParams); - readScenesInteractionInfo.put( - "readCurrentSceneAttribute", readScenesCurrentSceneAttributeInteractionInfo); - Map readScenesCurrentGroupCommandParams = - new LinkedHashMap(); - InteractionInfo readScenesCurrentGroupAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ScenesCluster) cluster) - .readCurrentGroupAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readScenesCurrentGroupCommandParams); - readScenesInteractionInfo.put( - "readCurrentGroupAttribute", readScenesCurrentGroupAttributeInteractionInfo); - Map readScenesSceneValidCommandParams = - new LinkedHashMap(); - InteractionInfo readScenesSceneValidAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ScenesCluster) cluster) - .readSceneValidAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readScenesSceneValidCommandParams); - readScenesInteractionInfo.put( - "readSceneValidAttribute", readScenesSceneValidAttributeInteractionInfo); - Map readScenesNameSupportCommandParams = - new LinkedHashMap(); - InteractionInfo readScenesNameSupportAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ScenesCluster) cluster) - .readNameSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readScenesNameSupportCommandParams); - readScenesInteractionInfo.put( - "readNameSupportAttribute", readScenesNameSupportAttributeInteractionInfo); - Map readScenesClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readScenesClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ScenesCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readScenesClusterRevisionCommandParams); - readScenesInteractionInfo.put( - "readClusterRevisionAttribute", readScenesClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("scenes", readScenesInteractionInfo); - Map readSoftwareDiagnosticsInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readSoftwareDiagnosticsThreadMetricsCommandParams = - new LinkedHashMap(); - InteractionInfo readSoftwareDiagnosticsThreadMetricsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SoftwareDiagnosticsCluster) cluster) - .readThreadMetricsAttribute( - (ChipClusters.SoftwareDiagnosticsCluster.ThreadMetricsAttributeCallback) - callback); - }, - () -> new DelegatedThreadMetricsAttributeCallback(), - readSoftwareDiagnosticsThreadMetricsCommandParams); - readSoftwareDiagnosticsInteractionInfo.put( - "readThreadMetricsAttribute", readSoftwareDiagnosticsThreadMetricsAttributeInteractionInfo); - Map readSoftwareDiagnosticsCurrentHeapFreeCommandParams = - new LinkedHashMap(); - InteractionInfo readSoftwareDiagnosticsCurrentHeapFreeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SoftwareDiagnosticsCluster) cluster) - .readCurrentHeapFreeAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readSoftwareDiagnosticsCurrentHeapFreeCommandParams); - readSoftwareDiagnosticsInteractionInfo.put( - "readCurrentHeapFreeAttribute", - readSoftwareDiagnosticsCurrentHeapFreeAttributeInteractionInfo); - Map readSoftwareDiagnosticsCurrentHeapUsedCommandParams = - new LinkedHashMap(); - InteractionInfo readSoftwareDiagnosticsCurrentHeapUsedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SoftwareDiagnosticsCluster) cluster) - .readCurrentHeapUsedAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readSoftwareDiagnosticsCurrentHeapUsedCommandParams); - readSoftwareDiagnosticsInteractionInfo.put( - "readCurrentHeapUsedAttribute", - readSoftwareDiagnosticsCurrentHeapUsedAttributeInteractionInfo); - Map readSoftwareDiagnosticsCurrentHeapHighWatermarkCommandParams = - new LinkedHashMap(); - InteractionInfo readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SoftwareDiagnosticsCluster) cluster) - .readCurrentHeapHighWatermarkAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readSoftwareDiagnosticsCurrentHeapHighWatermarkCommandParams); - readSoftwareDiagnosticsInteractionInfo.put( - "readCurrentHeapHighWatermarkAttribute", - readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeInteractionInfo); - Map readSoftwareDiagnosticsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readSoftwareDiagnosticsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SoftwareDiagnosticsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readSoftwareDiagnosticsClusterRevisionCommandParams); - readSoftwareDiagnosticsInteractionInfo.put( - "readClusterRevisionAttribute", - readSoftwareDiagnosticsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("softwareDiagnostics", readSoftwareDiagnosticsInteractionInfo); - Map readSwitchInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readSwitchNumberOfPositionsCommandParams = - new LinkedHashMap(); - InteractionInfo readSwitchNumberOfPositionsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SwitchCluster) cluster) - .readNumberOfPositionsAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readSwitchNumberOfPositionsCommandParams); - readSwitchInteractionInfo.put( - "readNumberOfPositionsAttribute", readSwitchNumberOfPositionsAttributeInteractionInfo); - Map readSwitchCurrentPositionCommandParams = - new LinkedHashMap(); - InteractionInfo readSwitchCurrentPositionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SwitchCluster) cluster) - .readCurrentPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readSwitchCurrentPositionCommandParams); - readSwitchInteractionInfo.put( - "readCurrentPositionAttribute", readSwitchCurrentPositionAttributeInteractionInfo); - Map readSwitchMultiPressMaxCommandParams = - new LinkedHashMap(); - InteractionInfo readSwitchMultiPressMaxAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SwitchCluster) cluster) - .readMultiPressMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readSwitchMultiPressMaxCommandParams); - readSwitchInteractionInfo.put( - "readMultiPressMaxAttribute", readSwitchMultiPressMaxAttributeInteractionInfo); - Map readSwitchFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readSwitchFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SwitchCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readSwitchFeatureMapCommandParams); - readSwitchInteractionInfo.put( - "readFeatureMapAttribute", readSwitchFeatureMapAttributeInteractionInfo); - Map readSwitchClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readSwitchClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.SwitchCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readSwitchClusterRevisionCommandParams); - readSwitchInteractionInfo.put( - "readClusterRevisionAttribute", readSwitchClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("switch", readSwitchInteractionInfo); - Map readTvChannelInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readTvChannelTvChannelListCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelTvChannelListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readTvChannelListAttribute( - (ChipClusters.TvChannelCluster.TvChannelListAttributeCallback) callback); - }, - () -> new DelegatedTvChannelListAttributeCallback(), - readTvChannelTvChannelListCommandParams); - readTvChannelInteractionInfo.put( - "readTvChannelListAttribute", readTvChannelTvChannelListAttributeInteractionInfo); - Map readTvChannelTvChannelLineupCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelTvChannelLineupAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readTvChannelLineupAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readTvChannelTvChannelLineupCommandParams); - readTvChannelInteractionInfo.put( - "readTvChannelLineupAttribute", readTvChannelTvChannelLineupAttributeInteractionInfo); - Map readTvChannelCurrentTvChannelCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelCurrentTvChannelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readCurrentTvChannelAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readTvChannelCurrentTvChannelCommandParams); - readTvChannelInteractionInfo.put( - "readCurrentTvChannelAttribute", readTvChannelCurrentTvChannelAttributeInteractionInfo); - Map readTvChannelClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTvChannelClusterRevisionCommandParams); - readTvChannelInteractionInfo.put( - "readClusterRevisionAttribute", readTvChannelClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("tvChannel", readTvChannelInteractionInfo); - Map readTargetNavigatorInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readTargetNavigatorTargetNavigatorListCommandParams = - new LinkedHashMap(); - InteractionInfo readTargetNavigatorTargetNavigatorListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TargetNavigatorCluster) cluster) - .readTargetNavigatorListAttribute( - (ChipClusters.TargetNavigatorCluster.TargetNavigatorListAttributeCallback) - callback); - }, - () -> new DelegatedTargetNavigatorListAttributeCallback(), - readTargetNavigatorTargetNavigatorListCommandParams); - readTargetNavigatorInteractionInfo.put( - "readTargetNavigatorListAttribute", - readTargetNavigatorTargetNavigatorListAttributeInteractionInfo); - Map readTargetNavigatorClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readTargetNavigatorClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TargetNavigatorCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTargetNavigatorClusterRevisionCommandParams); - readTargetNavigatorInteractionInfo.put( - "readClusterRevisionAttribute", readTargetNavigatorClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("targetNavigator", readTargetNavigatorInteractionInfo); - Map readTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readTemperatureMeasurementMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readTemperatureMeasurementMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TemperatureMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTemperatureMeasurementMeasuredValueCommandParams); - readTemperatureMeasurementInteractionInfo.put( - "readMeasuredValueAttribute", - readTemperatureMeasurementMeasuredValueAttributeInteractionInfo); - Map readTemperatureMeasurementMinMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readTemperatureMeasurementMinMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TemperatureMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTemperatureMeasurementMinMeasuredValueCommandParams); - readTemperatureMeasurementInteractionInfo.put( - "readMinMeasuredValueAttribute", - readTemperatureMeasurementMinMeasuredValueAttributeInteractionInfo); - Map readTemperatureMeasurementMaxMeasuredValueCommandParams = - new LinkedHashMap(); - InteractionInfo readTemperatureMeasurementMaxMeasuredValueAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TemperatureMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTemperatureMeasurementMaxMeasuredValueCommandParams); - readTemperatureMeasurementInteractionInfo.put( - "readMaxMeasuredValueAttribute", - readTemperatureMeasurementMaxMeasuredValueAttributeInteractionInfo); - Map readTemperatureMeasurementToleranceCommandParams = - new LinkedHashMap(); - InteractionInfo readTemperatureMeasurementToleranceAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TemperatureMeasurementCluster) cluster) - .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTemperatureMeasurementToleranceCommandParams); - readTemperatureMeasurementInteractionInfo.put( - "readToleranceAttribute", readTemperatureMeasurementToleranceAttributeInteractionInfo); - Map readTemperatureMeasurementClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readTemperatureMeasurementClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TemperatureMeasurementCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTemperatureMeasurementClusterRevisionCommandParams); - readTemperatureMeasurementInteractionInfo.put( - "readClusterRevisionAttribute", - readTemperatureMeasurementClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("temperatureMeasurement", readTemperatureMeasurementInteractionInfo); - Map readTestClusterInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readTestClusterBooleanCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterBooleanAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readTestClusterBooleanCommandParams); - readTestClusterInteractionInfo.put( - "readBooleanAttribute", readTestClusterBooleanAttributeInteractionInfo); - Map readTestClusterBitmap8CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterBitmap8AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterBitmap8CommandParams); - readTestClusterInteractionInfo.put( - "readBitmap8Attribute", readTestClusterBitmap8AttributeInteractionInfo); - Map readTestClusterBitmap16CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterBitmap16AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterBitmap16CommandParams); - readTestClusterInteractionInfo.put( - "readBitmap16Attribute", readTestClusterBitmap16AttributeInteractionInfo); - Map readTestClusterBitmap32CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterBitmap32AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterBitmap32CommandParams); - readTestClusterInteractionInfo.put( - "readBitmap32Attribute", readTestClusterBitmap32AttributeInteractionInfo); - Map readTestClusterBitmap64CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterBitmap64AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterBitmap64CommandParams); - readTestClusterInteractionInfo.put( - "readBitmap64Attribute", readTestClusterBitmap64AttributeInteractionInfo); - Map readTestClusterInt8uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt8uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterInt8uCommandParams); - readTestClusterInteractionInfo.put( - "readInt8uAttribute", readTestClusterInt8uAttributeInteractionInfo); - Map readTestClusterInt16uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt16uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterInt16uCommandParams); - readTestClusterInteractionInfo.put( - "readInt16uAttribute", readTestClusterInt16uAttributeInteractionInfo); - Map readTestClusterInt32uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt32uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt32uAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterInt32uCommandParams); - readTestClusterInteractionInfo.put( - "readInt32uAttribute", readTestClusterInt32uAttributeInteractionInfo); - Map readTestClusterInt64uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt64uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt64uAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterInt64uCommandParams); - readTestClusterInteractionInfo.put( - "readInt64uAttribute", readTestClusterInt64uAttributeInteractionInfo); - Map readTestClusterInt8sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt8sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterInt8sCommandParams); - readTestClusterInteractionInfo.put( - "readInt8sAttribute", readTestClusterInt8sAttributeInteractionInfo); - Map readTestClusterInt16sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt16sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterInt16sCommandParams); - readTestClusterInteractionInfo.put( - "readInt16sAttribute", readTestClusterInt16sAttributeInteractionInfo); - Map readTestClusterInt32sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt32sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt32sAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterInt32sCommandParams); - readTestClusterInteractionInfo.put( - "readInt32sAttribute", readTestClusterInt32sAttributeInteractionInfo); - Map readTestClusterInt64sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterInt64sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readInt64sAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterInt64sCommandParams); - readTestClusterInteractionInfo.put( - "readInt64sAttribute", readTestClusterInt64sAttributeInteractionInfo); - Map readTestClusterEnum8CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterEnum8AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterEnum8CommandParams); - readTestClusterInteractionInfo.put( - "readEnum8Attribute", readTestClusterEnum8AttributeInteractionInfo); - Map readTestClusterEnum16CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterEnum16AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterEnum16CommandParams); - readTestClusterInteractionInfo.put( - "readEnum16Attribute", readTestClusterEnum16AttributeInteractionInfo); - Map readTestClusterOctetStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterOctetStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readOctetStringAttribute((ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readTestClusterOctetStringCommandParams); - readTestClusterInteractionInfo.put( - "readOctetStringAttribute", readTestClusterOctetStringAttributeInteractionInfo); - Map readTestClusterListInt8uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterListInt8uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readListInt8uAttribute( - (ChipClusters.TestClusterCluster.ListInt8uAttributeCallback) callback); - }, - () -> new DelegatedListInt8uAttributeCallback(), - readTestClusterListInt8uCommandParams); - readTestClusterInteractionInfo.put( - "readListInt8uAttribute", readTestClusterListInt8uAttributeInteractionInfo); - Map readTestClusterListOctetStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterListOctetStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readListOctetStringAttribute( - (ChipClusters.TestClusterCluster.ListOctetStringAttributeCallback) callback); - }, - () -> new DelegatedListOctetStringAttributeCallback(), - readTestClusterListOctetStringCommandParams); - readTestClusterInteractionInfo.put( - "readListOctetStringAttribute", readTestClusterListOctetStringAttributeInteractionInfo); - Map readTestClusterListStructOctetStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterListStructOctetStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readListStructOctetStringAttribute( - (ChipClusters.TestClusterCluster.ListStructOctetStringAttributeCallback) - callback); - }, - () -> new DelegatedListStructOctetStringAttributeCallback(), - readTestClusterListStructOctetStringCommandParams); - readTestClusterInteractionInfo.put( - "readListStructOctetStringAttribute", - readTestClusterListStructOctetStringAttributeInteractionInfo); - Map readTestClusterLongOctetStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterLongOctetStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readLongOctetStringAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readTestClusterLongOctetStringCommandParams); - readTestClusterInteractionInfo.put( - "readLongOctetStringAttribute", readTestClusterLongOctetStringAttributeInteractionInfo); - Map readTestClusterCharStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterCharStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readCharStringAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readTestClusterCharStringCommandParams); - readTestClusterInteractionInfo.put( - "readCharStringAttribute", readTestClusterCharStringAttributeInteractionInfo); - Map readTestClusterLongCharStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterLongCharStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readLongCharStringAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readTestClusterLongCharStringCommandParams); - readTestClusterInteractionInfo.put( - "readLongCharStringAttribute", readTestClusterLongCharStringAttributeInteractionInfo); - Map readTestClusterEpochUsCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterEpochUsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readEpochUsAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterEpochUsCommandParams); - readTestClusterInteractionInfo.put( - "readEpochUsAttribute", readTestClusterEpochUsAttributeInteractionInfo); - Map readTestClusterEpochSCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterEpochSAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readEpochSAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterEpochSCommandParams); - readTestClusterInteractionInfo.put( - "readEpochSAttribute", readTestClusterEpochSAttributeInteractionInfo); - Map readTestClusterVendorIdCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterVendorIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterVendorIdCommandParams); - readTestClusterInteractionInfo.put( - "readVendorIdAttribute", readTestClusterVendorIdAttributeInteractionInfo); - Map readTestClusterListNullablesAndOptionalsStructCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterListNullablesAndOptionalsStructAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readListNullablesAndOptionalsStructAttribute( - (ChipClusters.TestClusterCluster - .ListNullablesAndOptionalsStructAttributeCallback) - callback); - }, - () -> new DelegatedListNullablesAndOptionalsStructAttributeCallback(), - readTestClusterListNullablesAndOptionalsStructCommandParams); - readTestClusterInteractionInfo.put( - "readListNullablesAndOptionalsStructAttribute", - readTestClusterListNullablesAndOptionalsStructAttributeInteractionInfo); - Map readTestClusterUnsupportedCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterUnsupportedAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readUnsupportedAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readTestClusterUnsupportedCommandParams); - readTestClusterInteractionInfo.put( - "readUnsupportedAttribute", readTestClusterUnsupportedAttributeInteractionInfo); - Map readTestClusterNullableBooleanCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableBooleanAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new DelegatedBooleanAttributeCallback(), - readTestClusterNullableBooleanCommandParams); - readTestClusterInteractionInfo.put( - "readNullableBooleanAttribute", readTestClusterNullableBooleanAttributeInteractionInfo); - Map readTestClusterNullableBitmap8CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableBitmap8AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableBitmap8CommandParams); - readTestClusterInteractionInfo.put( - "readNullableBitmap8Attribute", readTestClusterNullableBitmap8AttributeInteractionInfo); - Map readTestClusterNullableBitmap16CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableBitmap16AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableBitmap16CommandParams); - readTestClusterInteractionInfo.put( - "readNullableBitmap16Attribute", readTestClusterNullableBitmap16AttributeInteractionInfo); - Map readTestClusterNullableBitmap32CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableBitmap32AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterNullableBitmap32CommandParams); - readTestClusterInteractionInfo.put( - "readNullableBitmap32Attribute", readTestClusterNullableBitmap32AttributeInteractionInfo); - Map readTestClusterNullableBitmap64CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableBitmap64AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterNullableBitmap64CommandParams); - readTestClusterInteractionInfo.put( - "readNullableBitmap64Attribute", readTestClusterNullableBitmap64AttributeInteractionInfo); - Map readTestClusterNullableInt8uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt8uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableInt8uCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt8uAttribute", readTestClusterNullableInt8uAttributeInteractionInfo); - Map readTestClusterNullableInt16uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt16uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableInt16uCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt16uAttribute", readTestClusterNullableInt16uAttributeInteractionInfo); - Map readTestClusterNullableInt32uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt32uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt32uAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterNullableInt32uCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt32uAttribute", readTestClusterNullableInt32uAttributeInteractionInfo); - Map readTestClusterNullableInt64uCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt64uAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt64uAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterNullableInt64uCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt64uAttribute", readTestClusterNullableInt64uAttributeInteractionInfo); - Map readTestClusterNullableInt8sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt8sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableInt8sCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt8sAttribute", readTestClusterNullableInt8sAttributeInteractionInfo); - Map readTestClusterNullableInt16sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt16sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableInt16sCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt16sAttribute", readTestClusterNullableInt16sAttributeInteractionInfo); - Map readTestClusterNullableInt32sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt32sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt32sAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterNullableInt32sCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt32sAttribute", readTestClusterNullableInt32sAttributeInteractionInfo); - Map readTestClusterNullableInt64sCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableInt64sAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt64sAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readTestClusterNullableInt64sCommandParams); - readTestClusterInteractionInfo.put( - "readNullableInt64sAttribute", readTestClusterNullableInt64sAttributeInteractionInfo); - Map readTestClusterNullableEnum8CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableEnum8AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableEnum8CommandParams); - readTestClusterInteractionInfo.put( - "readNullableEnum8Attribute", readTestClusterNullableEnum8AttributeInteractionInfo); - Map readTestClusterNullableEnum16CommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableEnum16AttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterNullableEnum16CommandParams); - readTestClusterInteractionInfo.put( - "readNullableEnum16Attribute", readTestClusterNullableEnum16AttributeInteractionInfo); - Map readTestClusterNullableOctetStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableOctetStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableOctetStringAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readTestClusterNullableOctetStringCommandParams); - readTestClusterInteractionInfo.put( - "readNullableOctetStringAttribute", - readTestClusterNullableOctetStringAttributeInteractionInfo); - Map readTestClusterNullableCharStringCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterNullableCharStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readNullableCharStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readTestClusterNullableCharStringCommandParams); - readTestClusterInteractionInfo.put( - "readNullableCharStringAttribute", - readTestClusterNullableCharStringAttributeInteractionInfo); - Map readTestClusterClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readTestClusterClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TestClusterCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readTestClusterClusterRevisionCommandParams); - readTestClusterInteractionInfo.put( - "readClusterRevisionAttribute", readTestClusterClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("testCluster", readTestClusterInteractionInfo); - Map readThermostatInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readThermostatLocalTemperatureCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatLocalTemperatureAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readLocalTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatLocalTemperatureCommandParams); - readThermostatInteractionInfo.put( - "readLocalTemperatureAttribute", readThermostatLocalTemperatureAttributeInteractionInfo); - Map readThermostatAbsMinHeatSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readAbsMinHeatSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatAbsMinHeatSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readAbsMinHeatSetpointLimitAttribute", - readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo); - Map readThermostatAbsMaxHeatSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatAbsMaxHeatSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readAbsMaxHeatSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatAbsMaxHeatSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readAbsMaxHeatSetpointLimitAttribute", - readThermostatAbsMaxHeatSetpointLimitAttributeInteractionInfo); - Map readThermostatAbsMinCoolSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatAbsMinCoolSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readAbsMinCoolSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatAbsMinCoolSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readAbsMinCoolSetpointLimitAttribute", - readThermostatAbsMinCoolSetpointLimitAttributeInteractionInfo); - Map readThermostatAbsMaxCoolSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readAbsMaxCoolSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatAbsMaxCoolSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readAbsMaxCoolSetpointLimitAttribute", - readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo); - Map readThermostatOccupiedCoolingSetpointCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatOccupiedCoolingSetpointAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readOccupiedCoolingSetpointAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatOccupiedCoolingSetpointCommandParams); - readThermostatInteractionInfo.put( - "readOccupiedCoolingSetpointAttribute", - readThermostatOccupiedCoolingSetpointAttributeInteractionInfo); - Map readThermostatOccupiedHeatingSetpointCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatOccupiedHeatingSetpointAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readOccupiedHeatingSetpointAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatOccupiedHeatingSetpointCommandParams); - readThermostatInteractionInfo.put( - "readOccupiedHeatingSetpointAttribute", - readThermostatOccupiedHeatingSetpointAttributeInteractionInfo); - Map readThermostatMinHeatSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatMinHeatSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readMinHeatSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatMinHeatSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readMinHeatSetpointLimitAttribute", - readThermostatMinHeatSetpointLimitAttributeInteractionInfo); - Map readThermostatMaxHeatSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatMaxHeatSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readMaxHeatSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatMaxHeatSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readMaxHeatSetpointLimitAttribute", - readThermostatMaxHeatSetpointLimitAttributeInteractionInfo); - Map readThermostatMinCoolSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatMinCoolSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readMinCoolSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatMinCoolSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readMinCoolSetpointLimitAttribute", - readThermostatMinCoolSetpointLimitAttributeInteractionInfo); - Map readThermostatMaxCoolSetpointLimitCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatMaxCoolSetpointLimitAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readMaxCoolSetpointLimitAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatMaxCoolSetpointLimitCommandParams); - readThermostatInteractionInfo.put( - "readMaxCoolSetpointLimitAttribute", - readThermostatMaxCoolSetpointLimitAttributeInteractionInfo); - Map readThermostatMinSetpointDeadBandCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatMinSetpointDeadBandAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readMinSetpointDeadBandAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatMinSetpointDeadBandCommandParams); - readThermostatInteractionInfo.put( - "readMinSetpointDeadBandAttribute", - readThermostatMinSetpointDeadBandAttributeInteractionInfo); - Map readThermostatControlSequenceOfOperationCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatControlSequenceOfOperationAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readControlSequenceOfOperationAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatControlSequenceOfOperationCommandParams); - readThermostatInteractionInfo.put( - "readControlSequenceOfOperationAttribute", - readThermostatControlSequenceOfOperationAttributeInteractionInfo); - Map readThermostatSystemModeCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatSystemModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readSystemModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatSystemModeCommandParams); - readThermostatInteractionInfo.put( - "readSystemModeAttribute", readThermostatSystemModeAttributeInteractionInfo); - Map readThermostatStartOfWeekCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatStartOfWeekAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readStartOfWeekAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatStartOfWeekCommandParams); - readThermostatInteractionInfo.put( - "readStartOfWeekAttribute", readThermostatStartOfWeekAttributeInteractionInfo); - Map readThermostatNumberOfWeeklyTransitionsCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatNumberOfWeeklyTransitionsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readNumberOfWeeklyTransitionsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatNumberOfWeeklyTransitionsCommandParams); - readThermostatInteractionInfo.put( - "readNumberOfWeeklyTransitionsAttribute", - readThermostatNumberOfWeeklyTransitionsAttributeInteractionInfo); - Map readThermostatNumberOfDailyTransitionsCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatNumberOfDailyTransitionsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readNumberOfDailyTransitionsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatNumberOfDailyTransitionsCommandParams); - readThermostatInteractionInfo.put( - "readNumberOfDailyTransitionsAttribute", - readThermostatNumberOfDailyTransitionsAttributeInteractionInfo); - Map readThermostatFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThermostatFeatureMapCommandParams); - readThermostatInteractionInfo.put( - "readFeatureMapAttribute", readThermostatFeatureMapAttributeInteractionInfo); - Map readThermostatClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatClusterRevisionCommandParams); - readThermostatInteractionInfo.put( - "readClusterRevisionAttribute", readThermostatClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("thermostat", readThermostatInteractionInfo); - Map readThermostatUserInterfaceConfigurationInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map - readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams = - new LinkedHashMap(); - InteractionInfo - readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) - .readTemperatureDisplayModeAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams); - readThermostatUserInterfaceConfigurationInteractionInfo.put( - "readTemperatureDisplayModeAttribute", - readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo); - Map - readThermostatUserInterfaceConfigurationKeypadLockoutCommandParams = - new LinkedHashMap(); - InteractionInfo readThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) - .readKeypadLockoutAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatUserInterfaceConfigurationKeypadLockoutCommandParams); - readThermostatUserInterfaceConfigurationInteractionInfo.put( - "readKeypadLockoutAttribute", - readThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo); - Map - readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams = - new LinkedHashMap(); - InteractionInfo - readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) - .readScheduleProgrammingVisibilityAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams); - readThermostatUserInterfaceConfigurationInteractionInfo.put( - "readScheduleProgrammingVisibilityAttribute", - readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo); - Map - readThermostatUserInterfaceConfigurationClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo - readThermostatUserInterfaceConfigurationClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) - .readClusterRevisionAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatUserInterfaceConfigurationClusterRevisionCommandParams); - readThermostatUserInterfaceConfigurationInteractionInfo.put( - "readClusterRevisionAttribute", - readThermostatUserInterfaceConfigurationClusterRevisionAttributeInteractionInfo); - readAttributeMap.put( - "thermostatUserInterfaceConfiguration", - readThermostatUserInterfaceConfigurationInteractionInfo); - Map readThreadNetworkDiagnosticsInteractionInfo = - new LinkedHashMap<>(); - // read attribute - Map readThreadNetworkDiagnosticsChannelCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsChannelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readChannelAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsChannelCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readChannelAttribute", readThreadNetworkDiagnosticsChannelAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRoutingRoleCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRoutingRoleAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRoutingRoleAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsRoutingRoleCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRoutingRoleAttribute", - readThreadNetworkDiagnosticsRoutingRoleAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsNetworkNameCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsNetworkNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readNetworkNameAttribute((ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readThreadNetworkDiagnosticsNetworkNameCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readNetworkNameAttribute", - readThreadNetworkDiagnosticsNetworkNameAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsPanIdCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsPanIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readPanIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsPanIdCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readPanIdAttribute", readThreadNetworkDiagnosticsPanIdAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsExtendedPanIdCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsExtendedPanIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readExtendedPanIdAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsExtendedPanIdCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readExtendedPanIdAttribute", - readThreadNetworkDiagnosticsExtendedPanIdAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsMeshLocalPrefixCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsMeshLocalPrefixAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readMeshLocalPrefixAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readThreadNetworkDiagnosticsMeshLocalPrefixCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readMeshLocalPrefixAttribute", - readThreadNetworkDiagnosticsMeshLocalPrefixAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsOverrunCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsOverrunCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsOverrunCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readOverrunCountAttribute", - readThreadNetworkDiagnosticsOverrunCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsNeighborTableListCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsNeighborTableListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readNeighborTableListAttribute( - (ChipClusters.ThreadNetworkDiagnosticsCluster - .NeighborTableListAttributeCallback) - callback); - }, - () -> new DelegatedNeighborTableListAttributeCallback(), - readThreadNetworkDiagnosticsNeighborTableListCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readNeighborTableListAttribute", - readThreadNetworkDiagnosticsNeighborTableListAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRouteTableListCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRouteTableListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRouteTableListAttribute( - (ChipClusters.ThreadNetworkDiagnosticsCluster.RouteTableListAttributeCallback) - callback); - }, - () -> new DelegatedRouteTableListAttributeCallback(), - readThreadNetworkDiagnosticsRouteTableListCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRouteTableListAttribute", - readThreadNetworkDiagnosticsRouteTableListAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsPartitionIdCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsPartitionIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readPartitionIdAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsPartitionIdCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readPartitionIdAttribute", - readThreadNetworkDiagnosticsPartitionIdAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsWeightingCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsWeightingAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readWeightingAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsWeightingCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readWeightingAttribute", readThreadNetworkDiagnosticsWeightingAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsDataVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsDataVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readDataVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsDataVersionCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readDataVersionAttribute", - readThreadNetworkDiagnosticsDataVersionAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsStableDataVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsStableDataVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readStableDataVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsStableDataVersionCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readStableDataVersionAttribute", - readThreadNetworkDiagnosticsStableDataVersionAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsLeaderRouterIdCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsLeaderRouterIdAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readLeaderRouterIdAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsLeaderRouterIdCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readLeaderRouterIdAttribute", - readThreadNetworkDiagnosticsLeaderRouterIdAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsDetachedRoleCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsDetachedRoleCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readDetachedRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsDetachedRoleCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readDetachedRoleCountAttribute", - readThreadNetworkDiagnosticsDetachedRoleCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsChildRoleCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsChildRoleCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readChildRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsChildRoleCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readChildRoleCountAttribute", - readThreadNetworkDiagnosticsChildRoleCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRouterRoleCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRouterRoleCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRouterRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsRouterRoleCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRouterRoleCountAttribute", - readThreadNetworkDiagnosticsRouterRoleCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsLeaderRoleCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsLeaderRoleCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readLeaderRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsLeaderRoleCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readLeaderRoleCountAttribute", - readThreadNetworkDiagnosticsLeaderRoleCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsAttachAttemptCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsAttachAttemptCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readAttachAttemptCountAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsAttachAttemptCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readAttachAttemptCountAttribute", - readThreadNetworkDiagnosticsAttachAttemptCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsPartitionIdChangeCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readPartitionIdChangeCountAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsPartitionIdChangeCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readPartitionIdChangeCountAttribute", - readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams = - new LinkedHashMap(); - InteractionInfo - readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readBetterPartitionAttachAttemptCountAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readBetterPartitionAttachAttemptCountAttribute", - readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsParentChangeCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsParentChangeCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readParentChangeCountAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsParentChangeCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readParentChangeCountAttribute", - readThreadNetworkDiagnosticsParentChangeCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxTotalCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxTotalCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxTotalCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxTotalCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxTotalCountAttribute", - readThreadNetworkDiagnosticsTxTotalCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxUnicastCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxUnicastCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxUnicastCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxUnicastCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxUnicastCountAttribute", - readThreadNetworkDiagnosticsTxUnicastCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxBroadcastCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxBroadcastCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxBroadcastCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxBroadcastCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxBroadcastCountAttribute", - readThreadNetworkDiagnosticsTxBroadcastCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxAckRequestedCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxAckRequestedCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxAckRequestedCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxAckRequestedCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxAckRequestedCountAttribute", - readThreadNetworkDiagnosticsTxAckRequestedCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxAckedCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxAckedCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxAckedCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxAckedCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxAckedCountAttribute", - readThreadNetworkDiagnosticsTxAckedCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsTxNoAckRequestedCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxNoAckRequestedCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxNoAckRequestedCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxNoAckRequestedCountAttribute", - readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxDataCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxDataCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxDataCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxDataCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxDataCountAttribute", - readThreadNetworkDiagnosticsTxDataCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxDataPollCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxDataPollCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxDataPollCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxDataPollCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxDataPollCountAttribute", - readThreadNetworkDiagnosticsTxDataPollCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxBeaconCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxBeaconCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxBeaconCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxBeaconCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxBeaconCountAttribute", - readThreadNetworkDiagnosticsTxBeaconCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsTxBeaconRequestCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxBeaconRequestCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxBeaconRequestCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxBeaconRequestCountAttribute", - readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxOtherCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxOtherCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxOtherCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxOtherCountAttribute", - readThreadNetworkDiagnosticsTxOtherCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxRetryCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxRetryCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxRetryCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxRetryCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxRetryCountAttribute", - readThreadNetworkDiagnosticsTxRetryCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams = - new LinkedHashMap(); - InteractionInfo - readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxDirectMaxRetryExpiryCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxDirectMaxRetryExpiryCountAttribute", - readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams = - new LinkedHashMap(); - InteractionInfo - readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxIndirectMaxRetryExpiryCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxIndirectMaxRetryExpiryCountAttribute", - readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxErrCcaCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxErrCcaCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxErrCcaCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxErrCcaCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxErrCcaCountAttribute", - readThreadNetworkDiagnosticsTxErrCcaCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsTxErrAbortCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxErrAbortCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxErrAbortCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxErrAbortCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxErrAbortCountAttribute", - readThreadNetworkDiagnosticsTxErrAbortCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsTxErrBusyChannelCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxErrBusyChannelCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxErrBusyChannelCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readTxErrBusyChannelCountAttribute", - readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxTotalCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxTotalCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxTotalCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxTotalCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxTotalCountAttribute", - readThreadNetworkDiagnosticsRxTotalCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxUnicastCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxUnicastCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxUnicastCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxUnicastCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxUnicastCountAttribute", - readThreadNetworkDiagnosticsRxUnicastCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxBroadcastCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxBroadcastCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxBroadcastCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxBroadcastCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxBroadcastCountAttribute", - readThreadNetworkDiagnosticsRxBroadcastCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxDataCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxDataCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxDataCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxDataCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxDataCountAttribute", - readThreadNetworkDiagnosticsRxDataCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxDataPollCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxDataPollCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxDataPollCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxDataPollCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxDataPollCountAttribute", - readThreadNetworkDiagnosticsRxDataPollCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxBeaconCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxBeaconCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxBeaconCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxBeaconCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxBeaconCountAttribute", - readThreadNetworkDiagnosticsRxBeaconCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsRxBeaconRequestCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxBeaconRequestCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxBeaconRequestCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxBeaconRequestCountAttribute", - readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxOtherCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxOtherCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxOtherCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxOtherCountAttribute", - readThreadNetworkDiagnosticsRxOtherCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsRxAddressFilteredCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxAddressFilteredCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxAddressFilteredCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxAddressFilteredCountAttribute", - readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsRxDestAddrFilteredCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxDestAddrFilteredCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxDestAddrFilteredCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxDestAddrFilteredCountAttribute", - readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxDuplicatedCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxDuplicatedCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxDuplicatedCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxDuplicatedCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxDuplicatedCountAttribute", - readThreadNetworkDiagnosticsRxDuplicatedCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxErrNoFrameCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxErrNoFrameCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxErrNoFrameCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxErrNoFrameCountAttribute", - readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsRxErrUnknownNeighborCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxErrUnknownNeighborCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxErrUnknownNeighborCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxErrUnknownNeighborCountAttribute", - readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxErrInvalidSrcAddrCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxErrInvalidSrcAddrCountAttribute", - readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxErrSecCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxErrSecCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxErrSecCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxErrSecCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxErrSecCountAttribute", - readThreadNetworkDiagnosticsRxErrSecCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxErrFcsCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxErrFcsCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxErrFcsCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxErrFcsCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxErrFcsCountAttribute", - readThreadNetworkDiagnosticsRxErrFcsCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsRxErrOtherCountCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsRxErrOtherCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readRxErrOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsRxErrOtherCountCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readRxErrOtherCountAttribute", - readThreadNetworkDiagnosticsRxErrOtherCountAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsActiveTimestampCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsActiveTimestampAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readActiveTimestampAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsActiveTimestampCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readActiveTimestampAttribute", - readThreadNetworkDiagnosticsActiveTimestampAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsPendingTimestampCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsPendingTimestampAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readPendingTimestampAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsPendingTimestampCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readPendingTimestampAttribute", - readThreadNetworkDiagnosticsPendingTimestampAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsDelayCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsDelayAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readDelayAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsDelayCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readDelayAttribute", readThreadNetworkDiagnosticsDelayAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsSecurityPolicyCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsSecurityPolicyAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readSecurityPolicyAttribute( - (ChipClusters.ThreadNetworkDiagnosticsCluster.SecurityPolicyAttributeCallback) - callback); - }, - () -> new DelegatedSecurityPolicyAttributeCallback(), - readThreadNetworkDiagnosticsSecurityPolicyCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readSecurityPolicyAttribute", - readThreadNetworkDiagnosticsSecurityPolicyAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsChannelMaskCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsChannelMaskAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readChannelMaskAttribute((ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readThreadNetworkDiagnosticsChannelMaskCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readChannelMaskAttribute", - readThreadNetworkDiagnosticsChannelMaskAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams = - new LinkedHashMap(); - InteractionInfo - readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readOperationalDatasetComponentsAttribute( - (ChipClusters.ThreadNetworkDiagnosticsCluster - .OperationalDatasetComponentsAttributeCallback) - callback); - }, - () -> new DelegatedOperationalDatasetComponentsAttributeCallback(), - readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readOperationalDatasetComponentsAttribute", - readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeInteractionInfo); - Map - readThreadNetworkDiagnosticsActiveNetworkFaultsListCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readActiveNetworkFaultsListAttribute( - (ChipClusters.ThreadNetworkDiagnosticsCluster - .ActiveNetworkFaultsListAttributeCallback) - callback); - }, - () -> new DelegatedActiveNetworkFaultsListAttributeCallback(), - readThreadNetworkDiagnosticsActiveNetworkFaultsListCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readActiveNetworkFaultsListAttribute", - readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeInteractionInfo); - Map readThreadNetworkDiagnosticsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readThreadNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsClusterRevisionCommandParams); - readThreadNetworkDiagnosticsInteractionInfo.put( - "readClusterRevisionAttribute", - readThreadNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("threadNetworkDiagnostics", readThreadNetworkDiagnosticsInteractionInfo); - Map readWakeOnLanInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readWakeOnLanWakeOnLanMacAddressCommandParams = - new LinkedHashMap(); - InteractionInfo readWakeOnLanWakeOnLanMacAddressAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WakeOnLanCluster) cluster) - .readWakeOnLanMacAddressAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new DelegatedCharStringAttributeCallback(), - readWakeOnLanWakeOnLanMacAddressCommandParams); - readWakeOnLanInteractionInfo.put( - "readWakeOnLanMacAddressAttribute", - readWakeOnLanWakeOnLanMacAddressAttributeInteractionInfo); - Map readWakeOnLanClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readWakeOnLanClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WakeOnLanCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWakeOnLanClusterRevisionCommandParams); - readWakeOnLanInteractionInfo.put( - "readClusterRevisionAttribute", readWakeOnLanClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("wakeOnLan", readWakeOnLanInteractionInfo); - Map readWiFiNetworkDiagnosticsInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readWiFiNetworkDiagnosticsBssidCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsBssidAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readBssidAttribute((ChipClusters.OctetStringAttributeCallback) callback); - }, - () -> new DelegatedOctetStringAttributeCallback(), - readWiFiNetworkDiagnosticsBssidCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readBssidAttribute", readWiFiNetworkDiagnosticsBssidAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsSecurityTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsSecurityTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readSecurityTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWiFiNetworkDiagnosticsSecurityTypeCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readSecurityTypeAttribute", - readWiFiNetworkDiagnosticsSecurityTypeAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsWiFiVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsWiFiVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readWiFiVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWiFiNetworkDiagnosticsWiFiVersionCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readWiFiVersionAttribute", readWiFiNetworkDiagnosticsWiFiVersionAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsChannelNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsChannelNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readChannelNumberAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWiFiNetworkDiagnosticsChannelNumberCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readChannelNumberAttribute", - readWiFiNetworkDiagnosticsChannelNumberAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsRssiCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsRssiAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readRssiAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWiFiNetworkDiagnosticsRssiCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readRssiAttribute", readWiFiNetworkDiagnosticsRssiAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsBeaconLostCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsBeaconLostCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readBeaconLostCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsBeaconLostCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readBeaconLostCountAttribute", - readWiFiNetworkDiagnosticsBeaconLostCountAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsBeaconRxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsBeaconRxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readBeaconRxCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsBeaconRxCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readBeaconRxCountAttribute", - readWiFiNetworkDiagnosticsBeaconRxCountAttributeInteractionInfo); - Map - readWiFiNetworkDiagnosticsPacketMulticastRxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readPacketMulticastRxCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsPacketMulticastRxCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readPacketMulticastRxCountAttribute", - readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeInteractionInfo); - Map - readWiFiNetworkDiagnosticsPacketMulticastTxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readPacketMulticastTxCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsPacketMulticastTxCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readPacketMulticastTxCountAttribute", - readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsPacketUnicastRxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readPacketUnicastRxCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsPacketUnicastRxCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readPacketUnicastRxCountAttribute", - readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsPacketUnicastTxCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readPacketUnicastTxCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsPacketUnicastTxCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readPacketUnicastTxCountAttribute", - readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsCurrentMaxRateCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsCurrentMaxRateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readCurrentMaxRateAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsCurrentMaxRateCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readCurrentMaxRateAttribute", - readWiFiNetworkDiagnosticsCurrentMaxRateAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsOverrunCountCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsOverrunCountAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWiFiNetworkDiagnosticsOverrunCountCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readOverrunCountAttribute", - readWiFiNetworkDiagnosticsOverrunCountAttributeInteractionInfo); - Map readWiFiNetworkDiagnosticsClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readWiFiNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWiFiNetworkDiagnosticsClusterRevisionCommandParams); - readWiFiNetworkDiagnosticsInteractionInfo.put( - "readClusterRevisionAttribute", - readWiFiNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("wiFiNetworkDiagnostics", readWiFiNetworkDiagnosticsInteractionInfo); - Map readWindowCoveringInteractionInfo = new LinkedHashMap<>(); - // read attribute - Map readWindowCoveringTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringTypeCommandParams); - readWindowCoveringInteractionInfo.put( - "readTypeAttribute", readWindowCoveringTypeAttributeInteractionInfo); - Map readWindowCoveringCurrentPositionLiftCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringCurrentPositionLiftAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readCurrentPositionLiftAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringCurrentPositionLiftCommandParams); - readWindowCoveringInteractionInfo.put( - "readCurrentPositionLiftAttribute", - readWindowCoveringCurrentPositionLiftAttributeInteractionInfo); - Map readWindowCoveringCurrentPositionTiltCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringCurrentPositionTiltAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readCurrentPositionTiltAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringCurrentPositionTiltCommandParams); - readWindowCoveringInteractionInfo.put( - "readCurrentPositionTiltAttribute", - readWindowCoveringCurrentPositionTiltAttributeInteractionInfo); - Map readWindowCoveringConfigStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringConfigStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readConfigStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringConfigStatusCommandParams); - readWindowCoveringInteractionInfo.put( - "readConfigStatusAttribute", readWindowCoveringConfigStatusAttributeInteractionInfo); - Map readWindowCoveringCurrentPositionLiftPercentageCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringCurrentPositionLiftPercentageAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readCurrentPositionLiftPercentageAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringCurrentPositionLiftPercentageCommandParams); - readWindowCoveringInteractionInfo.put( - "readCurrentPositionLiftPercentageAttribute", - readWindowCoveringCurrentPositionLiftPercentageAttributeInteractionInfo); - Map readWindowCoveringCurrentPositionTiltPercentageCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringCurrentPositionTiltPercentageAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readCurrentPositionTiltPercentageAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringCurrentPositionTiltPercentageCommandParams); - readWindowCoveringInteractionInfo.put( - "readCurrentPositionTiltPercentageAttribute", - readWindowCoveringCurrentPositionTiltPercentageAttributeInteractionInfo); - Map readWindowCoveringOperationalStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringOperationalStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readOperationalStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringOperationalStatusCommandParams); - readWindowCoveringInteractionInfo.put( - "readOperationalStatusAttribute", - readWindowCoveringOperationalStatusAttributeInteractionInfo); - Map - readWindowCoveringTargetPositionLiftPercent100thsCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringTargetPositionLiftPercent100thsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readTargetPositionLiftPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringTargetPositionLiftPercent100thsCommandParams); - readWindowCoveringInteractionInfo.put( - "readTargetPositionLiftPercent100thsAttribute", - readWindowCoveringTargetPositionLiftPercent100thsAttributeInteractionInfo); - Map - readWindowCoveringTargetPositionTiltPercent100thsCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringTargetPositionTiltPercent100thsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readTargetPositionTiltPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringTargetPositionTiltPercent100thsCommandParams); - readWindowCoveringInteractionInfo.put( - "readTargetPositionTiltPercent100thsAttribute", - readWindowCoveringTargetPositionTiltPercent100thsAttributeInteractionInfo); - Map readWindowCoveringEndProductTypeCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringEndProductTypeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readEndProductTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringEndProductTypeCommandParams); - readWindowCoveringInteractionInfo.put( - "readEndProductTypeAttribute", readWindowCoveringEndProductTypeAttributeInteractionInfo); - Map - readWindowCoveringCurrentPositionLiftPercent100thsCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringCurrentPositionLiftPercent100thsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readCurrentPositionLiftPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringCurrentPositionLiftPercent100thsCommandParams); - readWindowCoveringInteractionInfo.put( - "readCurrentPositionLiftPercent100thsAttribute", - readWindowCoveringCurrentPositionLiftPercent100thsAttributeInteractionInfo); - Map - readWindowCoveringCurrentPositionTiltPercent100thsCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringCurrentPositionTiltPercent100thsAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readCurrentPositionTiltPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringCurrentPositionTiltPercent100thsCommandParams); - readWindowCoveringInteractionInfo.put( - "readCurrentPositionTiltPercent100thsAttribute", - readWindowCoveringCurrentPositionTiltPercent100thsAttributeInteractionInfo); - Map readWindowCoveringInstalledOpenLimitLiftCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringInstalledOpenLimitLiftAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readInstalledOpenLimitLiftAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringInstalledOpenLimitLiftCommandParams); - readWindowCoveringInteractionInfo.put( - "readInstalledOpenLimitLiftAttribute", - readWindowCoveringInstalledOpenLimitLiftAttributeInteractionInfo); - Map readWindowCoveringInstalledClosedLimitLiftCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringInstalledClosedLimitLiftAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readInstalledClosedLimitLiftAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringInstalledClosedLimitLiftCommandParams); - readWindowCoveringInteractionInfo.put( - "readInstalledClosedLimitLiftAttribute", - readWindowCoveringInstalledClosedLimitLiftAttributeInteractionInfo); - Map readWindowCoveringInstalledOpenLimitTiltCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringInstalledOpenLimitTiltAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readInstalledOpenLimitTiltAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringInstalledOpenLimitTiltCommandParams); - readWindowCoveringInteractionInfo.put( - "readInstalledOpenLimitTiltAttribute", - readWindowCoveringInstalledOpenLimitTiltAttributeInteractionInfo); - Map readWindowCoveringInstalledClosedLimitTiltCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringInstalledClosedLimitTiltAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readInstalledClosedLimitTiltAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringInstalledClosedLimitTiltCommandParams); - readWindowCoveringInteractionInfo.put( - "readInstalledClosedLimitTiltAttribute", - readWindowCoveringInstalledClosedLimitTiltAttributeInteractionInfo); - Map readWindowCoveringModeCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringModeAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readModeAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringModeCommandParams); - readWindowCoveringInteractionInfo.put( - "readModeAttribute", readWindowCoveringModeAttributeInteractionInfo); - Map readWindowCoveringSafetyStatusCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringSafetyStatusAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readSafetyStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringSafetyStatusCommandParams); - readWindowCoveringInteractionInfo.put( - "readSafetyStatusAttribute", readWindowCoveringSafetyStatusAttributeInteractionInfo); - Map readWindowCoveringFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readWindowCoveringFeatureMapCommandParams); - readWindowCoveringInteractionInfo.put( - "readFeatureMapAttribute", readWindowCoveringFeatureMapAttributeInteractionInfo); - Map readWindowCoveringClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readWindowCoveringClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WindowCoveringCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readWindowCoveringClusterRevisionCommandParams); - readWindowCoveringInteractionInfo.put( - "readClusterRevisionAttribute", readWindowCoveringClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("windowCovering", readWindowCoveringInteractionInfo); - return readAttributeMap; - } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java new file mode 100644 index 00000000000000..50c7436501e648 --- /dev/null +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -0,0 +1,6445 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +package chip.devicecontroller; + +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.InteractionInfo; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ClusterReadMapping { + + public Map> getReadAttributeMap() { + Map> readAttributeMap = new HashMap<>(); + Map readAccountLoginInteractionInfo = new LinkedHashMap<>(); + Map readAccountLoginClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readAccountLoginClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AccountLoginCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readAccountLoginClusterRevisionCommandParams); + readAccountLoginInteractionInfo.put( + "readClusterRevisionAttribute", readAccountLoginClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("accountLogin", readAccountLoginInteractionInfo); + Map readAdministratorCommissioningInteractionInfo = + new LinkedHashMap<>(); + Map readAdministratorCommissioningClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readAdministratorCommissioningClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AdministratorCommissioningCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readAdministratorCommissioningClusterRevisionCommandParams); + readAdministratorCommissioningInteractionInfo.put( + "readClusterRevisionAttribute", + readAdministratorCommissioningClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "administratorCommissioning", readAdministratorCommissioningInteractionInfo); + Map readApplicationBasicInteractionInfo = new LinkedHashMap<>(); + Map readApplicationBasicVendorNameCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicVendorNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readApplicationBasicVendorNameCommandParams); + readApplicationBasicInteractionInfo.put( + "readVendorNameAttribute", readApplicationBasicVendorNameAttributeInteractionInfo); + Map readApplicationBasicVendorIdCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicVendorIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationBasicVendorIdCommandParams); + readApplicationBasicInteractionInfo.put( + "readVendorIdAttribute", readApplicationBasicVendorIdAttributeInteractionInfo); + Map readApplicationBasicApplicationNameCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicApplicationNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readApplicationNameAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readApplicationBasicApplicationNameCommandParams); + readApplicationBasicInteractionInfo.put( + "readApplicationNameAttribute", + readApplicationBasicApplicationNameAttributeInteractionInfo); + Map readApplicationBasicProductIdCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicProductIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readProductIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationBasicProductIdCommandParams); + readApplicationBasicInteractionInfo.put( + "readProductIdAttribute", readApplicationBasicProductIdAttributeInteractionInfo); + Map readApplicationBasicApplicationIdCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicApplicationIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readApplicationIdAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readApplicationBasicApplicationIdCommandParams); + readApplicationBasicInteractionInfo.put( + "readApplicationIdAttribute", readApplicationBasicApplicationIdAttributeInteractionInfo); + Map readApplicationBasicCatalogVendorIdCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicCatalogVendorIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readCatalogVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationBasicCatalogVendorIdCommandParams); + readApplicationBasicInteractionInfo.put( + "readCatalogVendorIdAttribute", + readApplicationBasicCatalogVendorIdAttributeInteractionInfo); + Map readApplicationBasicApplicationStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicApplicationStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readApplicationStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationBasicApplicationStatusCommandParams); + readApplicationBasicInteractionInfo.put( + "readApplicationStatusAttribute", + readApplicationBasicApplicationStatusAttributeInteractionInfo); + Map readApplicationBasicClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationBasicClusterRevisionCommandParams); + readApplicationBasicInteractionInfo.put( + "readClusterRevisionAttribute", + readApplicationBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("applicationBasic", readApplicationBasicInteractionInfo); + Map readApplicationLauncherInteractionInfo = new LinkedHashMap<>(); + Map readApplicationLauncherApplicationLauncherListCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationLauncherApplicationLauncherListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationLauncherCluster) cluster) + .readApplicationLauncherListAttribute( + (ChipClusters.ApplicationLauncherCluster + .ApplicationLauncherListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedApplicationLauncherListAttributeCallback(), + readApplicationLauncherApplicationLauncherListCommandParams); + readApplicationLauncherInteractionInfo.put( + "readApplicationLauncherListAttribute", + readApplicationLauncherApplicationLauncherListAttributeInteractionInfo); + Map readApplicationLauncherCatalogVendorIdCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationLauncherCatalogVendorIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationLauncherCluster) cluster) + .readCatalogVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationLauncherCatalogVendorIdCommandParams); + readApplicationLauncherInteractionInfo.put( + "readCatalogVendorIdAttribute", + readApplicationLauncherCatalogVendorIdAttributeInteractionInfo); + Map readApplicationLauncherApplicationIdCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationLauncherApplicationIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationLauncherCluster) cluster) + .readApplicationIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationLauncherApplicationIdCommandParams); + readApplicationLauncherInteractionInfo.put( + "readApplicationIdAttribute", readApplicationLauncherApplicationIdAttributeInteractionInfo); + Map readApplicationLauncherClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationLauncherClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationLauncherCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readApplicationLauncherClusterRevisionCommandParams); + readApplicationLauncherInteractionInfo.put( + "readClusterRevisionAttribute", + readApplicationLauncherClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("applicationLauncher", readApplicationLauncherInteractionInfo); + Map readAudioOutputInteractionInfo = new LinkedHashMap<>(); + Map readAudioOutputAudioOutputListCommandParams = + new LinkedHashMap(); + InteractionInfo readAudioOutputAudioOutputListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AudioOutputCluster) cluster) + .readAudioOutputListAttribute( + (ChipClusters.AudioOutputCluster.AudioOutputListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedAudioOutputListAttributeCallback(), + readAudioOutputAudioOutputListCommandParams); + readAudioOutputInteractionInfo.put( + "readAudioOutputListAttribute", readAudioOutputAudioOutputListAttributeInteractionInfo); + Map readAudioOutputCurrentAudioOutputCommandParams = + new LinkedHashMap(); + InteractionInfo readAudioOutputCurrentAudioOutputAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AudioOutputCluster) cluster) + .readCurrentAudioOutputAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readAudioOutputCurrentAudioOutputCommandParams); + readAudioOutputInteractionInfo.put( + "readCurrentAudioOutputAttribute", + readAudioOutputCurrentAudioOutputAttributeInteractionInfo); + Map readAudioOutputClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readAudioOutputClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AudioOutputCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readAudioOutputClusterRevisionCommandParams); + readAudioOutputInteractionInfo.put( + "readClusterRevisionAttribute", readAudioOutputClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("audioOutput", readAudioOutputInteractionInfo); + Map readBarrierControlInteractionInfo = new LinkedHashMap<>(); + Map readBarrierControlBarrierMovingStateCommandParams = + new LinkedHashMap(); + InteractionInfo readBarrierControlBarrierMovingStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BarrierControlCluster) cluster) + .readBarrierMovingStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBarrierControlBarrierMovingStateCommandParams); + readBarrierControlInteractionInfo.put( + "readBarrierMovingStateAttribute", + readBarrierControlBarrierMovingStateAttributeInteractionInfo); + Map readBarrierControlBarrierSafetyStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readBarrierControlBarrierSafetyStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BarrierControlCluster) cluster) + .readBarrierSafetyStatusAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBarrierControlBarrierSafetyStatusCommandParams); + readBarrierControlInteractionInfo.put( + "readBarrierSafetyStatusAttribute", + readBarrierControlBarrierSafetyStatusAttributeInteractionInfo); + Map readBarrierControlBarrierCapabilitiesCommandParams = + new LinkedHashMap(); + InteractionInfo readBarrierControlBarrierCapabilitiesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BarrierControlCluster) cluster) + .readBarrierCapabilitiesAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBarrierControlBarrierCapabilitiesCommandParams); + readBarrierControlInteractionInfo.put( + "readBarrierCapabilitiesAttribute", + readBarrierControlBarrierCapabilitiesAttributeInteractionInfo); + Map readBarrierControlBarrierPositionCommandParams = + new LinkedHashMap(); + InteractionInfo readBarrierControlBarrierPositionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BarrierControlCluster) cluster) + .readBarrierPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBarrierControlBarrierPositionCommandParams); + readBarrierControlInteractionInfo.put( + "readBarrierPositionAttribute", readBarrierControlBarrierPositionAttributeInteractionInfo); + Map readBarrierControlClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBarrierControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BarrierControlCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBarrierControlClusterRevisionCommandParams); + readBarrierControlInteractionInfo.put( + "readClusterRevisionAttribute", readBarrierControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("barrierControl", readBarrierControlInteractionInfo); + Map readBasicInteractionInfo = new LinkedHashMap<>(); + Map readBasicInteractionModelVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicInteractionModelVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readInteractionModelVersionAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBasicInteractionModelVersionCommandParams); + readBasicInteractionInfo.put( + "readInteractionModelVersionAttribute", + readBasicInteractionModelVersionAttributeInteractionInfo); + Map readBasicVendorNameCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicVendorNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicVendorNameCommandParams); + readBasicInteractionInfo.put( + "readVendorNameAttribute", readBasicVendorNameAttributeInteractionInfo); + Map readBasicVendorIDCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicVendorIDAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBasicVendorIDCommandParams); + readBasicInteractionInfo.put( + "readVendorIDAttribute", readBasicVendorIDAttributeInteractionInfo); + Map readBasicProductNameCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicProductNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicProductNameCommandParams); + readBasicInteractionInfo.put( + "readProductNameAttribute", readBasicProductNameAttributeInteractionInfo); + Map readBasicProductIDCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicProductIDAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readProductIDAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBasicProductIDCommandParams); + readBasicInteractionInfo.put( + "readProductIDAttribute", readBasicProductIDAttributeInteractionInfo); + Map readBasicUserLabelCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicUserLabelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readUserLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicUserLabelCommandParams); + readBasicInteractionInfo.put( + "readUserLabelAttribute", readBasicUserLabelAttributeInteractionInfo); + Map readBasicLocationCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicLocationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readLocationAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicLocationCommandParams); + readBasicInteractionInfo.put( + "readLocationAttribute", readBasicLocationAttributeInteractionInfo); + Map readBasicHardwareVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicHardwareVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBasicHardwareVersionCommandParams); + readBasicInteractionInfo.put( + "readHardwareVersionAttribute", readBasicHardwareVersionAttributeInteractionInfo); + Map readBasicHardwareVersionStringCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicHardwareVersionStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readHardwareVersionStringAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicHardwareVersionStringCommandParams); + readBasicInteractionInfo.put( + "readHardwareVersionStringAttribute", + readBasicHardwareVersionStringAttributeInteractionInfo); + Map readBasicSoftwareVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicSoftwareVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBasicSoftwareVersionCommandParams); + readBasicInteractionInfo.put( + "readSoftwareVersionAttribute", readBasicSoftwareVersionAttributeInteractionInfo); + Map readBasicSoftwareVersionStringCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicSoftwareVersionStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readSoftwareVersionStringAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicSoftwareVersionStringCommandParams); + readBasicInteractionInfo.put( + "readSoftwareVersionStringAttribute", + readBasicSoftwareVersionStringAttributeInteractionInfo); + Map readBasicManufacturingDateCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicManufacturingDateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readManufacturingDateAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicManufacturingDateCommandParams); + readBasicInteractionInfo.put( + "readManufacturingDateAttribute", readBasicManufacturingDateAttributeInteractionInfo); + Map readBasicPartNumberCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicPartNumberAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicPartNumberCommandParams); + readBasicInteractionInfo.put( + "readPartNumberAttribute", readBasicPartNumberAttributeInteractionInfo); + Map readBasicProductURLCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicProductURLAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicProductURLCommandParams); + readBasicInteractionInfo.put( + "readProductURLAttribute", readBasicProductURLAttributeInteractionInfo); + Map readBasicProductLabelCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicProductLabelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicProductLabelCommandParams); + readBasicInteractionInfo.put( + "readProductLabelAttribute", readBasicProductLabelAttributeInteractionInfo); + Map readBasicSerialNumberCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicSerialNumberAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBasicSerialNumberCommandParams); + readBasicInteractionInfo.put( + "readSerialNumberAttribute", readBasicSerialNumberAttributeInteractionInfo); + Map readBasicLocalConfigDisabledCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicLocalConfigDisabledAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readLocalConfigDisabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readBasicLocalConfigDisabledCommandParams); + readBasicInteractionInfo.put( + "readLocalConfigDisabledAttribute", readBasicLocalConfigDisabledAttributeInteractionInfo); + Map readBasicReachableCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicReachableAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readBasicReachableCommandParams); + readBasicInteractionInfo.put( + "readReachableAttribute", readBasicReachableAttributeInteractionInfo); + Map readBasicClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBasicClusterRevisionCommandParams); + readBasicInteractionInfo.put( + "readClusterRevisionAttribute", readBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("basic", readBasicInteractionInfo); + Map readBinaryInputBasicInteractionInfo = new LinkedHashMap<>(); + Map readBinaryInputBasicOutOfServiceCommandParams = + new LinkedHashMap(); + InteractionInfo readBinaryInputBasicOutOfServiceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BinaryInputBasicCluster) cluster) + .readOutOfServiceAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readBinaryInputBasicOutOfServiceCommandParams); + readBinaryInputBasicInteractionInfo.put( + "readOutOfServiceAttribute", readBinaryInputBasicOutOfServiceAttributeInteractionInfo); + Map readBinaryInputBasicPresentValueCommandParams = + new LinkedHashMap(); + InteractionInfo readBinaryInputBasicPresentValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BinaryInputBasicCluster) cluster) + .readPresentValueAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readBinaryInputBasicPresentValueCommandParams); + readBinaryInputBasicInteractionInfo.put( + "readPresentValueAttribute", readBinaryInputBasicPresentValueAttributeInteractionInfo); + Map readBinaryInputBasicStatusFlagsCommandParams = + new LinkedHashMap(); + InteractionInfo readBinaryInputBasicStatusFlagsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BinaryInputBasicCluster) cluster) + .readStatusFlagsAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBinaryInputBasicStatusFlagsCommandParams); + readBinaryInputBasicInteractionInfo.put( + "readStatusFlagsAttribute", readBinaryInputBasicStatusFlagsAttributeInteractionInfo); + Map readBinaryInputBasicClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBinaryInputBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BinaryInputBasicCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBinaryInputBasicClusterRevisionCommandParams); + readBinaryInputBasicInteractionInfo.put( + "readClusterRevisionAttribute", + readBinaryInputBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("binaryInputBasic", readBinaryInputBasicInteractionInfo); + Map readBindingInteractionInfo = new LinkedHashMap<>(); + Map readBindingClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBindingClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BindingCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBindingClusterRevisionCommandParams); + readBindingInteractionInfo.put( + "readClusterRevisionAttribute", readBindingClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("binding", readBindingInteractionInfo); + Map readBooleanStateInteractionInfo = new LinkedHashMap<>(); + Map readBooleanStateStateValueCommandParams = + new LinkedHashMap(); + InteractionInfo readBooleanStateStateValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BooleanStateCluster) cluster) + .readStateValueAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readBooleanStateStateValueCommandParams); + readBooleanStateInteractionInfo.put( + "readStateValueAttribute", readBooleanStateStateValueAttributeInteractionInfo); + Map readBooleanStateClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBooleanStateClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BooleanStateCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBooleanStateClusterRevisionCommandParams); + readBooleanStateInteractionInfo.put( + "readClusterRevisionAttribute", readBooleanStateClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("booleanState", readBooleanStateInteractionInfo); + Map readBridgedActionsInteractionInfo = new LinkedHashMap<>(); + Map readBridgedActionsActionListCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedActionsActionListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedActionsCluster) cluster) + .readActionListAttribute( + (ChipClusters.BridgedActionsCluster.ActionListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedActionListAttributeCallback(), + readBridgedActionsActionListCommandParams); + readBridgedActionsInteractionInfo.put( + "readActionListAttribute", readBridgedActionsActionListAttributeInteractionInfo); + Map readBridgedActionsEndpointListCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedActionsEndpointListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedActionsCluster) cluster) + .readEndpointListAttribute( + (ChipClusters.BridgedActionsCluster.EndpointListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedEndpointListAttributeCallback(), + readBridgedActionsEndpointListCommandParams); + readBridgedActionsInteractionInfo.put( + "readEndpointListAttribute", readBridgedActionsEndpointListAttributeInteractionInfo); + Map readBridgedActionsSetupUrlCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedActionsSetupUrlAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedActionsCluster) cluster) + .readSetupUrlAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedActionsSetupUrlCommandParams); + readBridgedActionsInteractionInfo.put( + "readSetupUrlAttribute", readBridgedActionsSetupUrlAttributeInteractionInfo); + Map readBridgedActionsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedActionsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedActionsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBridgedActionsClusterRevisionCommandParams); + readBridgedActionsInteractionInfo.put( + "readClusterRevisionAttribute", readBridgedActionsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("bridgedActions", readBridgedActionsInteractionInfo); + Map readBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); + Map readBridgedDeviceBasicVendorNameCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicVendorNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicVendorNameCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readVendorNameAttribute", readBridgedDeviceBasicVendorNameAttributeInteractionInfo); + Map readBridgedDeviceBasicVendorIDCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicVendorIDAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBridgedDeviceBasicVendorIDCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readVendorIDAttribute", readBridgedDeviceBasicVendorIDAttributeInteractionInfo); + Map readBridgedDeviceBasicProductNameCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicProductNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicProductNameCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readProductNameAttribute", readBridgedDeviceBasicProductNameAttributeInteractionInfo); + Map readBridgedDeviceBasicUserLabelCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicUserLabelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readUserLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicUserLabelCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readUserLabelAttribute", readBridgedDeviceBasicUserLabelAttributeInteractionInfo); + Map readBridgedDeviceBasicHardwareVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBridgedDeviceBasicHardwareVersionCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readHardwareVersionAttribute", + readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo); + Map readBridgedDeviceBasicHardwareVersionStringCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readHardwareVersionStringAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicHardwareVersionStringCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readHardwareVersionStringAttribute", + readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo); + Map readBridgedDeviceBasicSoftwareVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBridgedDeviceBasicSoftwareVersionCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readSoftwareVersionAttribute", + readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo); + Map readBridgedDeviceBasicSoftwareVersionStringCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readSoftwareVersionStringAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicSoftwareVersionStringCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readSoftwareVersionStringAttribute", + readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo); + Map readBridgedDeviceBasicManufacturingDateCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readManufacturingDateAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicManufacturingDateCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readManufacturingDateAttribute", + readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo); + Map readBridgedDeviceBasicPartNumberCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicPartNumberAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicPartNumberCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readPartNumberAttribute", readBridgedDeviceBasicPartNumberAttributeInteractionInfo); + Map readBridgedDeviceBasicProductURLCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicProductURLAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicProductURLCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readProductURLAttribute", readBridgedDeviceBasicProductURLAttributeInteractionInfo); + Map readBridgedDeviceBasicProductLabelCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicProductLabelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicProductLabelCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readProductLabelAttribute", readBridgedDeviceBasicProductLabelAttributeInteractionInfo); + Map readBridgedDeviceBasicSerialNumberCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicSerialNumberAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBridgedDeviceBasicSerialNumberCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readSerialNumberAttribute", readBridgedDeviceBasicSerialNumberAttributeInteractionInfo); + Map readBridgedDeviceBasicReachableCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicReachableAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readBridgedDeviceBasicReachableCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readReachableAttribute", readBridgedDeviceBasicReachableAttributeInteractionInfo); + Map readBridgedDeviceBasicClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBridgedDeviceBasicClusterRevisionCommandParams); + readBridgedDeviceBasicInteractionInfo.put( + "readClusterRevisionAttribute", + readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("bridgedDeviceBasic", readBridgedDeviceBasicInteractionInfo); + Map readColorControlInteractionInfo = new LinkedHashMap<>(); + Map readColorControlCurrentHueCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlCurrentHueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readCurrentHueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlCurrentHueCommandParams); + readColorControlInteractionInfo.put( + "readCurrentHueAttribute", readColorControlCurrentHueAttributeInteractionInfo); + Map readColorControlCurrentSaturationCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlCurrentSaturationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readCurrentSaturationAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlCurrentSaturationCommandParams); + readColorControlInteractionInfo.put( + "readCurrentSaturationAttribute", + readColorControlCurrentSaturationAttributeInteractionInfo); + Map readColorControlRemainingTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlRemainingTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readRemainingTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlRemainingTimeCommandParams); + readColorControlInteractionInfo.put( + "readRemainingTimeAttribute", readColorControlRemainingTimeAttributeInteractionInfo); + Map readColorControlCurrentXCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlCurrentXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readCurrentXAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlCurrentXCommandParams); + readColorControlInteractionInfo.put( + "readCurrentXAttribute", readColorControlCurrentXAttributeInteractionInfo); + Map readColorControlCurrentYCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlCurrentYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readCurrentYAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlCurrentYCommandParams); + readColorControlInteractionInfo.put( + "readCurrentYAttribute", readColorControlCurrentYAttributeInteractionInfo); + Map readColorControlDriftCompensationCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlDriftCompensationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readDriftCompensationAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlDriftCompensationCommandParams); + readColorControlInteractionInfo.put( + "readDriftCompensationAttribute", + readColorControlDriftCompensationAttributeInteractionInfo); + Map readColorControlCompensationTextCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlCompensationTextAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readCompensationTextAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readColorControlCompensationTextCommandParams); + readColorControlInteractionInfo.put( + "readCompensationTextAttribute", readColorControlCompensationTextAttributeInteractionInfo); + Map readColorControlColorTemperatureCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorTemperatureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorTemperatureCommandParams); + readColorControlInteractionInfo.put( + "readColorTemperatureAttribute", readColorControlColorTemperatureAttributeInteractionInfo); + Map readColorControlColorModeCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorModeCommandParams); + readColorControlInteractionInfo.put( + "readColorModeAttribute", readColorControlColorModeAttributeInteractionInfo); + Map readColorControlColorControlOptionsCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorControlOptionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorControlOptionsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorControlOptionsCommandParams); + readColorControlInteractionInfo.put( + "readColorControlOptionsAttribute", + readColorControlColorControlOptionsAttributeInteractionInfo); + Map readColorControlNumberOfPrimariesCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlNumberOfPrimariesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readNumberOfPrimariesAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlNumberOfPrimariesCommandParams); + readColorControlInteractionInfo.put( + "readNumberOfPrimariesAttribute", + readColorControlNumberOfPrimariesAttributeInteractionInfo); + Map readColorControlPrimary1XCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary1XAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary1XAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary1XCommandParams); + readColorControlInteractionInfo.put( + "readPrimary1XAttribute", readColorControlPrimary1XAttributeInteractionInfo); + Map readColorControlPrimary1YCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary1YAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary1YAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary1YCommandParams); + readColorControlInteractionInfo.put( + "readPrimary1YAttribute", readColorControlPrimary1YAttributeInteractionInfo); + Map readColorControlPrimary1IntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary1IntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary1IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary1IntensityCommandParams); + readColorControlInteractionInfo.put( + "readPrimary1IntensityAttribute", + readColorControlPrimary1IntensityAttributeInteractionInfo); + Map readColorControlPrimary2XCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary2XAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary2XAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary2XCommandParams); + readColorControlInteractionInfo.put( + "readPrimary2XAttribute", readColorControlPrimary2XAttributeInteractionInfo); + Map readColorControlPrimary2YCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary2YAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary2YAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary2YCommandParams); + readColorControlInteractionInfo.put( + "readPrimary2YAttribute", readColorControlPrimary2YAttributeInteractionInfo); + Map readColorControlPrimary2IntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary2IntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary2IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary2IntensityCommandParams); + readColorControlInteractionInfo.put( + "readPrimary2IntensityAttribute", + readColorControlPrimary2IntensityAttributeInteractionInfo); + Map readColorControlPrimary3XCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary3XAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary3XAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary3XCommandParams); + readColorControlInteractionInfo.put( + "readPrimary3XAttribute", readColorControlPrimary3XAttributeInteractionInfo); + Map readColorControlPrimary3YCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary3YAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary3YAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary3YCommandParams); + readColorControlInteractionInfo.put( + "readPrimary3YAttribute", readColorControlPrimary3YAttributeInteractionInfo); + Map readColorControlPrimary3IntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary3IntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary3IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary3IntensityCommandParams); + readColorControlInteractionInfo.put( + "readPrimary3IntensityAttribute", + readColorControlPrimary3IntensityAttributeInteractionInfo); + Map readColorControlPrimary4XCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary4XAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary4XAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary4XCommandParams); + readColorControlInteractionInfo.put( + "readPrimary4XAttribute", readColorControlPrimary4XAttributeInteractionInfo); + Map readColorControlPrimary4YCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary4YAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary4YAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary4YCommandParams); + readColorControlInteractionInfo.put( + "readPrimary4YAttribute", readColorControlPrimary4YAttributeInteractionInfo); + Map readColorControlPrimary4IntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary4IntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary4IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary4IntensityCommandParams); + readColorControlInteractionInfo.put( + "readPrimary4IntensityAttribute", + readColorControlPrimary4IntensityAttributeInteractionInfo); + Map readColorControlPrimary5XCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary5XAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary5XAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary5XCommandParams); + readColorControlInteractionInfo.put( + "readPrimary5XAttribute", readColorControlPrimary5XAttributeInteractionInfo); + Map readColorControlPrimary5YCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary5YAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary5YAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary5YCommandParams); + readColorControlInteractionInfo.put( + "readPrimary5YAttribute", readColorControlPrimary5YAttributeInteractionInfo); + Map readColorControlPrimary5IntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary5IntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary5IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary5IntensityCommandParams); + readColorControlInteractionInfo.put( + "readPrimary5IntensityAttribute", + readColorControlPrimary5IntensityAttributeInteractionInfo); + Map readColorControlPrimary6XCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary6XAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary6XAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary6XCommandParams); + readColorControlInteractionInfo.put( + "readPrimary6XAttribute", readColorControlPrimary6XAttributeInteractionInfo); + Map readColorControlPrimary6YCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary6YAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary6YAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary6YCommandParams); + readColorControlInteractionInfo.put( + "readPrimary6YAttribute", readColorControlPrimary6YAttributeInteractionInfo); + Map readColorControlPrimary6IntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlPrimary6IntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readPrimary6IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlPrimary6IntensityCommandParams); + readColorControlInteractionInfo.put( + "readPrimary6IntensityAttribute", + readColorControlPrimary6IntensityAttributeInteractionInfo); + Map readColorControlWhitePointXCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlWhitePointXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readWhitePointXAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlWhitePointXCommandParams); + readColorControlInteractionInfo.put( + "readWhitePointXAttribute", readColorControlWhitePointXAttributeInteractionInfo); + Map readColorControlWhitePointYCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlWhitePointYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readWhitePointYAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlWhitePointYCommandParams); + readColorControlInteractionInfo.put( + "readWhitePointYAttribute", readColorControlWhitePointYAttributeInteractionInfo); + Map readColorControlColorPointRXCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointRXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointRXAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointRXCommandParams); + readColorControlInteractionInfo.put( + "readColorPointRXAttribute", readColorControlColorPointRXAttributeInteractionInfo); + Map readColorControlColorPointRYCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointRYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointRYAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointRYCommandParams); + readColorControlInteractionInfo.put( + "readColorPointRYAttribute", readColorControlColorPointRYAttributeInteractionInfo); + Map readColorControlColorPointRIntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointRIntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointRIntensityAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointRIntensityCommandParams); + readColorControlInteractionInfo.put( + "readColorPointRIntensityAttribute", + readColorControlColorPointRIntensityAttributeInteractionInfo); + Map readColorControlColorPointGXCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointGXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointGXAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointGXCommandParams); + readColorControlInteractionInfo.put( + "readColorPointGXAttribute", readColorControlColorPointGXAttributeInteractionInfo); + Map readColorControlColorPointGYCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointGYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointGYAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointGYCommandParams); + readColorControlInteractionInfo.put( + "readColorPointGYAttribute", readColorControlColorPointGYAttributeInteractionInfo); + Map readColorControlColorPointGIntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointGIntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointGIntensityAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointGIntensityCommandParams); + readColorControlInteractionInfo.put( + "readColorPointGIntensityAttribute", + readColorControlColorPointGIntensityAttributeInteractionInfo); + Map readColorControlColorPointBXCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointBXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointBXAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointBXCommandParams); + readColorControlInteractionInfo.put( + "readColorPointBXAttribute", readColorControlColorPointBXAttributeInteractionInfo); + Map readColorControlColorPointBYCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointBYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointBYAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointBYCommandParams); + readColorControlInteractionInfo.put( + "readColorPointBYAttribute", readColorControlColorPointBYAttributeInteractionInfo); + Map readColorControlColorPointBIntensityCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorPointBIntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorPointBIntensityAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorPointBIntensityCommandParams); + readColorControlInteractionInfo.put( + "readColorPointBIntensityAttribute", + readColorControlColorPointBIntensityAttributeInteractionInfo); + Map readColorControlEnhancedCurrentHueCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlEnhancedCurrentHueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readEnhancedCurrentHueAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlEnhancedCurrentHueCommandParams); + readColorControlInteractionInfo.put( + "readEnhancedCurrentHueAttribute", + readColorControlEnhancedCurrentHueAttributeInteractionInfo); + Map readColorControlEnhancedColorModeCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlEnhancedColorModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readEnhancedColorModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlEnhancedColorModeCommandParams); + readColorControlInteractionInfo.put( + "readEnhancedColorModeAttribute", + readColorControlEnhancedColorModeAttributeInteractionInfo); + Map readColorControlColorLoopActiveCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorLoopActiveAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorLoopActiveAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorLoopActiveCommandParams); + readColorControlInteractionInfo.put( + "readColorLoopActiveAttribute", readColorControlColorLoopActiveAttributeInteractionInfo); + Map readColorControlColorLoopDirectionCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorLoopDirectionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorLoopDirectionAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorLoopDirectionCommandParams); + readColorControlInteractionInfo.put( + "readColorLoopDirectionAttribute", + readColorControlColorLoopDirectionAttributeInteractionInfo); + Map readColorControlColorLoopTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorLoopTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorLoopTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorLoopTimeCommandParams); + readColorControlInteractionInfo.put( + "readColorLoopTimeAttribute", readColorControlColorLoopTimeAttributeInteractionInfo); + Map readColorControlColorLoopStartEnhancedHueCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorLoopStartEnhancedHueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorLoopStartEnhancedHueAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorLoopStartEnhancedHueCommandParams); + readColorControlInteractionInfo.put( + "readColorLoopStartEnhancedHueAttribute", + readColorControlColorLoopStartEnhancedHueAttributeInteractionInfo); + Map readColorControlColorLoopStoredEnhancedHueCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorLoopStoredEnhancedHueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorLoopStoredEnhancedHueAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorLoopStoredEnhancedHueCommandParams); + readColorControlInteractionInfo.put( + "readColorLoopStoredEnhancedHueAttribute", + readColorControlColorLoopStoredEnhancedHueAttributeInteractionInfo); + Map readColorControlColorCapabilitiesCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorCapabilitiesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorCapabilitiesAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorCapabilitiesCommandParams); + readColorControlInteractionInfo.put( + "readColorCapabilitiesAttribute", + readColorControlColorCapabilitiesAttributeInteractionInfo); + Map readColorControlColorTempPhysicalMinCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorTempPhysicalMinAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorTempPhysicalMinAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorTempPhysicalMinCommandParams); + readColorControlInteractionInfo.put( + "readColorTempPhysicalMinAttribute", + readColorControlColorTempPhysicalMinAttributeInteractionInfo); + Map readColorControlColorTempPhysicalMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlColorTempPhysicalMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readColorTempPhysicalMaxAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlColorTempPhysicalMaxCommandParams); + readColorControlInteractionInfo.put( + "readColorTempPhysicalMaxAttribute", + readColorControlColorTempPhysicalMaxAttributeInteractionInfo); + Map readColorControlCoupleColorTempToLevelMinMiredsCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlCoupleColorTempToLevelMinMiredsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readCoupleColorTempToLevelMinMiredsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlCoupleColorTempToLevelMinMiredsCommandParams); + readColorControlInteractionInfo.put( + "readCoupleColorTempToLevelMinMiredsAttribute", + readColorControlCoupleColorTempToLevelMinMiredsAttributeInteractionInfo); + Map readColorControlStartUpColorTemperatureMiredsCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readStartUpColorTemperatureMiredsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlStartUpColorTemperatureMiredsCommandParams); + readColorControlInteractionInfo.put( + "readStartUpColorTemperatureMiredsAttribute", + readColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo); + Map readColorControlClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readColorControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readColorControlClusterRevisionCommandParams); + readColorControlInteractionInfo.put( + "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("colorControl", readColorControlInteractionInfo); + Map readContentLauncherInteractionInfo = new LinkedHashMap<>(); + Map readContentLauncherAcceptsHeaderListCommandParams = + new LinkedHashMap(); + InteractionInfo readContentLauncherAcceptsHeaderListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentLauncherCluster) cluster) + .readAcceptsHeaderListAttribute( + (ChipClusters.ContentLauncherCluster.AcceptsHeaderListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedAcceptsHeaderListAttributeCallback(), + readContentLauncherAcceptsHeaderListCommandParams); + readContentLauncherInteractionInfo.put( + "readAcceptsHeaderListAttribute", + readContentLauncherAcceptsHeaderListAttributeInteractionInfo); + Map readContentLauncherSupportedStreamingTypesCommandParams = + new LinkedHashMap(); + InteractionInfo readContentLauncherSupportedStreamingTypesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentLauncherCluster) cluster) + .readSupportedStreamingTypesAttribute( + (ChipClusters.ContentLauncherCluster.SupportedStreamingTypesAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedSupportedStreamingTypesAttributeCallback(), + readContentLauncherSupportedStreamingTypesCommandParams); + readContentLauncherInteractionInfo.put( + "readSupportedStreamingTypesAttribute", + readContentLauncherSupportedStreamingTypesAttributeInteractionInfo); + Map readContentLauncherClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readContentLauncherClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentLauncherCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readContentLauncherClusterRevisionCommandParams); + readContentLauncherInteractionInfo.put( + "readClusterRevisionAttribute", readContentLauncherClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("contentLauncher", readContentLauncherInteractionInfo); + Map readDescriptorInteractionInfo = new LinkedHashMap<>(); + Map readDescriptorDeviceListCommandParams = + new LinkedHashMap(); + InteractionInfo readDescriptorDeviceListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DescriptorCluster) cluster) + .readDeviceListAttribute( + (ChipClusters.DescriptorCluster.DeviceListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedDeviceListAttributeCallback(), + readDescriptorDeviceListCommandParams); + readDescriptorInteractionInfo.put( + "readDeviceListAttribute", readDescriptorDeviceListAttributeInteractionInfo); + Map readDescriptorServerListCommandParams = + new LinkedHashMap(); + InteractionInfo readDescriptorServerListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DescriptorCluster) cluster) + .readServerListAttribute( + (ChipClusters.DescriptorCluster.ServerListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedServerListAttributeCallback(), + readDescriptorServerListCommandParams); + readDescriptorInteractionInfo.put( + "readServerListAttribute", readDescriptorServerListAttributeInteractionInfo); + Map readDescriptorClientListCommandParams = + new LinkedHashMap(); + InteractionInfo readDescriptorClientListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DescriptorCluster) cluster) + .readClientListAttribute( + (ChipClusters.DescriptorCluster.ClientListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedClientListAttributeCallback(), + readDescriptorClientListCommandParams); + readDescriptorInteractionInfo.put( + "readClientListAttribute", readDescriptorClientListAttributeInteractionInfo); + Map readDescriptorPartsListCommandParams = + new LinkedHashMap(); + InteractionInfo readDescriptorPartsListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DescriptorCluster) cluster) + .readPartsListAttribute( + (ChipClusters.DescriptorCluster.PartsListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedPartsListAttributeCallback(), + readDescriptorPartsListCommandParams); + readDescriptorInteractionInfo.put( + "readPartsListAttribute", readDescriptorPartsListAttributeInteractionInfo); + Map readDescriptorClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readDescriptorClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DescriptorCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readDescriptorClusterRevisionCommandParams); + readDescriptorInteractionInfo.put( + "readClusterRevisionAttribute", readDescriptorClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("descriptor", readDescriptorInteractionInfo); + Map readDiagnosticLogsInteractionInfo = new LinkedHashMap<>(); + readAttributeMap.put("diagnosticLogs", readDiagnosticLogsInteractionInfo); + Map readDoorLockInteractionInfo = new LinkedHashMap<>(); + Map readDoorLockLockStateCommandParams = + new LinkedHashMap(); + InteractionInfo readDoorLockLockStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DoorLockCluster) cluster) + .readLockStateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readDoorLockLockStateCommandParams); + readDoorLockInteractionInfo.put( + "readLockStateAttribute", readDoorLockLockStateAttributeInteractionInfo); + Map readDoorLockLockTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readDoorLockLockTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DoorLockCluster) cluster) + .readLockTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readDoorLockLockTypeCommandParams); + readDoorLockInteractionInfo.put( + "readLockTypeAttribute", readDoorLockLockTypeAttributeInteractionInfo); + Map readDoorLockActuatorEnabledCommandParams = + new LinkedHashMap(); + InteractionInfo readDoorLockActuatorEnabledAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DoorLockCluster) cluster) + .readActuatorEnabledAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readDoorLockActuatorEnabledCommandParams); + readDoorLockInteractionInfo.put( + "readActuatorEnabledAttribute", readDoorLockActuatorEnabledAttributeInteractionInfo); + Map readDoorLockClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readDoorLockClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.DoorLockCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readDoorLockClusterRevisionCommandParams); + readDoorLockInteractionInfo.put( + "readClusterRevisionAttribute", readDoorLockClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("doorLock", readDoorLockInteractionInfo); + Map readElectricalMeasurementInteractionInfo = new LinkedHashMap<>(); + Map readElectricalMeasurementMeasurementTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementMeasurementTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readMeasurementTypeAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readElectricalMeasurementMeasurementTypeCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readMeasurementTypeAttribute", + readElectricalMeasurementMeasurementTypeAttributeInteractionInfo); + Map readElectricalMeasurementTotalActivePowerCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementTotalActivePowerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readTotalActivePowerAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readElectricalMeasurementTotalActivePowerCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readTotalActivePowerAttribute", + readElectricalMeasurementTotalActivePowerAttributeInteractionInfo); + Map readElectricalMeasurementRmsVoltageCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementRmsVoltageAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readRmsVoltageAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementRmsVoltageCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readRmsVoltageAttribute", readElectricalMeasurementRmsVoltageAttributeInteractionInfo); + Map readElectricalMeasurementRmsVoltageMinCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readRmsVoltageMinAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementRmsVoltageMinCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readRmsVoltageMinAttribute", + readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo); + Map readElectricalMeasurementRmsVoltageMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readRmsVoltageMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementRmsVoltageMaxCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readRmsVoltageMaxAttribute", + readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo); + Map readElectricalMeasurementRmsCurrentCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementRmsCurrentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readRmsCurrentAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementRmsCurrentCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readRmsCurrentAttribute", readElectricalMeasurementRmsCurrentAttributeInteractionInfo); + Map readElectricalMeasurementRmsCurrentMinCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readRmsCurrentMinAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementRmsCurrentMinCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readRmsCurrentMinAttribute", + readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo); + Map readElectricalMeasurementRmsCurrentMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readRmsCurrentMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementRmsCurrentMaxCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readRmsCurrentMaxAttribute", + readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo); + Map readElectricalMeasurementActivePowerCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementActivePowerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readActivePowerAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementActivePowerCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readActivePowerAttribute", readElectricalMeasurementActivePowerAttributeInteractionInfo); + Map readElectricalMeasurementActivePowerMinCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementActivePowerMinAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readActivePowerMinAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementActivePowerMinCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readActivePowerMinAttribute", + readElectricalMeasurementActivePowerMinAttributeInteractionInfo); + Map readElectricalMeasurementActivePowerMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementActivePowerMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readActivePowerMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementActivePowerMaxCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readActivePowerMaxAttribute", + readElectricalMeasurementActivePowerMaxAttributeInteractionInfo); + Map readElectricalMeasurementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readElectricalMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ElectricalMeasurementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readElectricalMeasurementClusterRevisionCommandParams); + readElectricalMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", + readElectricalMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("electricalMeasurement", readElectricalMeasurementInteractionInfo); + Map readEthernetNetworkDiagnosticsInteractionInfo = + new LinkedHashMap<>(); + Map readEthernetNetworkDiagnosticsPHYRateCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsPHYRateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readPHYRateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEthernetNetworkDiagnosticsPHYRateCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readPHYRateAttribute", readEthernetNetworkDiagnosticsPHYRateAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsFullDuplexCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsFullDuplexAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readFullDuplexAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readEthernetNetworkDiagnosticsFullDuplexCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readFullDuplexAttribute", + readEthernetNetworkDiagnosticsFullDuplexAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsPacketRxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsPacketRxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readPacketRxCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEthernetNetworkDiagnosticsPacketRxCountCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readPacketRxCountAttribute", + readEthernetNetworkDiagnosticsPacketRxCountAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsPacketTxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsPacketTxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readPacketTxCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEthernetNetworkDiagnosticsPacketTxCountCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readPacketTxCountAttribute", + readEthernetNetworkDiagnosticsPacketTxCountAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsTxErrCountCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsTxErrCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readTxErrCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEthernetNetworkDiagnosticsTxErrCountCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readTxErrCountAttribute", + readEthernetNetworkDiagnosticsTxErrCountAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsCollisionCountCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsCollisionCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readCollisionCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEthernetNetworkDiagnosticsCollisionCountCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readCollisionCountAttribute", + readEthernetNetworkDiagnosticsCollisionCountAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsOverrunCountCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsOverrunCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEthernetNetworkDiagnosticsOverrunCountCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readOverrunCountAttribute", + readEthernetNetworkDiagnosticsOverrunCountAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsCarrierDetectCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsCarrierDetectAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readCarrierDetectAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readEthernetNetworkDiagnosticsCarrierDetectCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readCarrierDetectAttribute", + readEthernetNetworkDiagnosticsCarrierDetectAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsTimeSinceResetCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsTimeSinceResetAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readTimeSinceResetAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEthernetNetworkDiagnosticsTimeSinceResetCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readTimeSinceResetAttribute", + readEthernetNetworkDiagnosticsTimeSinceResetAttributeInteractionInfo); + Map readEthernetNetworkDiagnosticsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readEthernetNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEthernetNetworkDiagnosticsClusterRevisionCommandParams); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readEthernetNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "ethernetNetworkDiagnostics", readEthernetNetworkDiagnosticsInteractionInfo); + Map readFixedLabelInteractionInfo = new LinkedHashMap<>(); + Map readFixedLabelLabelListCommandParams = + new LinkedHashMap(); + InteractionInfo readFixedLabelLabelListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FixedLabelCluster) cluster) + .readLabelListAttribute( + (ChipClusters.FixedLabelCluster.LabelListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLabelListAttributeCallback(), + readFixedLabelLabelListCommandParams); + readFixedLabelInteractionInfo.put( + "readLabelListAttribute", readFixedLabelLabelListAttributeInteractionInfo); + Map readFixedLabelClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readFixedLabelClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FixedLabelCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFixedLabelClusterRevisionCommandParams); + readFixedLabelInteractionInfo.put( + "readClusterRevisionAttribute", readFixedLabelClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("fixedLabel", readFixedLabelInteractionInfo); + Map readFlowMeasurementInteractionInfo = new LinkedHashMap<>(); + Map readFlowMeasurementMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readFlowMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FlowMeasurementCluster) cluster) + .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFlowMeasurementMeasuredValueCommandParams); + readFlowMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", readFlowMeasurementMeasuredValueAttributeInteractionInfo); + Map readFlowMeasurementMinMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readFlowMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FlowMeasurementCluster) cluster) + .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFlowMeasurementMinMeasuredValueCommandParams); + readFlowMeasurementInteractionInfo.put( + "readMinMeasuredValueAttribute", + readFlowMeasurementMinMeasuredValueAttributeInteractionInfo); + Map readFlowMeasurementMaxMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readFlowMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FlowMeasurementCluster) cluster) + .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFlowMeasurementMaxMeasuredValueCommandParams); + readFlowMeasurementInteractionInfo.put( + "readMaxMeasuredValueAttribute", + readFlowMeasurementMaxMeasuredValueAttributeInteractionInfo); + Map readFlowMeasurementToleranceCommandParams = + new LinkedHashMap(); + InteractionInfo readFlowMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FlowMeasurementCluster) cluster) + .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFlowMeasurementToleranceCommandParams); + readFlowMeasurementInteractionInfo.put( + "readToleranceAttribute", readFlowMeasurementToleranceAttributeInteractionInfo); + Map readFlowMeasurementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readFlowMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FlowMeasurementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFlowMeasurementClusterRevisionCommandParams); + readFlowMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", readFlowMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("flowMeasurement", readFlowMeasurementInteractionInfo); + Map readGeneralCommissioningInteractionInfo = new LinkedHashMap<>(); + Map readGeneralCommissioningBreadcrumbCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralCommissioningBreadcrumbAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralCommissioningCluster) cluster) + .readBreadcrumbAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readGeneralCommissioningBreadcrumbCommandParams); + readGeneralCommissioningInteractionInfo.put( + "readBreadcrumbAttribute", readGeneralCommissioningBreadcrumbAttributeInteractionInfo); + Map + readGeneralCommissioningBasicCommissioningInfoListCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralCommissioningBasicCommissioningInfoListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralCommissioningCluster) cluster) + .readBasicCommissioningInfoListAttribute( + (ChipClusters.GeneralCommissioningCluster + .BasicCommissioningInfoListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedBasicCommissioningInfoListAttributeCallback(), + readGeneralCommissioningBasicCommissioningInfoListCommandParams); + readGeneralCommissioningInteractionInfo.put( + "readBasicCommissioningInfoListAttribute", + readGeneralCommissioningBasicCommissioningInfoListAttributeInteractionInfo); + Map readGeneralCommissioningClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralCommissioningClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralCommissioningCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGeneralCommissioningClusterRevisionCommandParams); + readGeneralCommissioningInteractionInfo.put( + "readClusterRevisionAttribute", + readGeneralCommissioningClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("generalCommissioning", readGeneralCommissioningInteractionInfo); + Map readGeneralDiagnosticsInteractionInfo = new LinkedHashMap<>(); + Map readGeneralDiagnosticsNetworkInterfacesCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsNetworkInterfacesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readNetworkInterfacesAttribute( + (ChipClusters.GeneralDiagnosticsCluster.NetworkInterfacesAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedNetworkInterfacesAttributeCallback(), + readGeneralDiagnosticsNetworkInterfacesCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readNetworkInterfacesAttribute", + readGeneralDiagnosticsNetworkInterfacesAttributeInteractionInfo); + Map readGeneralDiagnosticsRebootCountCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsRebootCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readRebootCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGeneralDiagnosticsRebootCountCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readRebootCountAttribute", readGeneralDiagnosticsRebootCountAttributeInteractionInfo); + Map readGeneralDiagnosticsUpTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsUpTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readUpTimeAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readGeneralDiagnosticsUpTimeCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readUpTimeAttribute", readGeneralDiagnosticsUpTimeAttributeInteractionInfo); + Map readGeneralDiagnosticsTotalOperationalHoursCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsTotalOperationalHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readTotalOperationalHoursAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readGeneralDiagnosticsTotalOperationalHoursCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readTotalOperationalHoursAttribute", + readGeneralDiagnosticsTotalOperationalHoursAttributeInteractionInfo); + Map readGeneralDiagnosticsBootReasonsCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsBootReasonsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readBootReasonsAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGeneralDiagnosticsBootReasonsCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readBootReasonsAttribute", readGeneralDiagnosticsBootReasonsAttributeInteractionInfo); + Map readGeneralDiagnosticsActiveHardwareFaultsCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsActiveHardwareFaultsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readActiveHardwareFaultsAttribute( + (ChipClusters.GeneralDiagnosticsCluster.ActiveHardwareFaultsAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedActiveHardwareFaultsAttributeCallback(), + readGeneralDiagnosticsActiveHardwareFaultsCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readActiveHardwareFaultsAttribute", + readGeneralDiagnosticsActiveHardwareFaultsAttributeInteractionInfo); + Map readGeneralDiagnosticsActiveRadioFaultsCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsActiveRadioFaultsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readActiveRadioFaultsAttribute( + (ChipClusters.GeneralDiagnosticsCluster.ActiveRadioFaultsAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedActiveRadioFaultsAttributeCallback(), + readGeneralDiagnosticsActiveRadioFaultsCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readActiveRadioFaultsAttribute", + readGeneralDiagnosticsActiveRadioFaultsAttributeInteractionInfo); + Map readGeneralDiagnosticsActiveNetworkFaultsCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsActiveNetworkFaultsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readActiveNetworkFaultsAttribute( + (ChipClusters.GeneralDiagnosticsCluster.ActiveNetworkFaultsAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedActiveNetworkFaultsAttributeCallback(), + readGeneralDiagnosticsActiveNetworkFaultsCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readActiveNetworkFaultsAttribute", + readGeneralDiagnosticsActiveNetworkFaultsAttributeInteractionInfo); + Map readGeneralDiagnosticsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGeneralDiagnosticsClusterRevisionCommandParams); + readGeneralDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("generalDiagnostics", readGeneralDiagnosticsInteractionInfo); + Map readGroupKeyManagementInteractionInfo = new LinkedHashMap<>(); + Map readGroupKeyManagementGroupsCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementGroupsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readGroupsAttribute( + (ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedGroupsAttributeCallback(), + readGroupKeyManagementGroupsCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readGroupsAttribute", readGroupKeyManagementGroupsAttributeInteractionInfo); + Map readGroupKeyManagementGroupKeysCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementGroupKeysAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readGroupKeysAttribute( + (ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedGroupKeysAttributeCallback(), + readGroupKeyManagementGroupKeysCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readGroupKeysAttribute", readGroupKeyManagementGroupKeysAttributeInteractionInfo); + Map readGroupKeyManagementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupKeyManagementClusterRevisionCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readClusterRevisionAttribute", + readGroupKeyManagementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("groupKeyManagement", readGroupKeyManagementInteractionInfo); + Map readGroupsInteractionInfo = new LinkedHashMap<>(); + Map readGroupsNameSupportCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupsNameSupportAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupsCluster) cluster) + .readNameSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupsNameSupportCommandParams); + readGroupsInteractionInfo.put( + "readNameSupportAttribute", readGroupsNameSupportAttributeInteractionInfo); + Map readGroupsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupsClusterRevisionCommandParams); + readGroupsInteractionInfo.put( + "readClusterRevisionAttribute", readGroupsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("groups", readGroupsInteractionInfo); + Map readIdentifyInteractionInfo = new LinkedHashMap<>(); + Map readIdentifyIdentifyTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readIdentifyIdentifyTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IdentifyCluster) cluster) + .readIdentifyTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIdentifyIdentifyTimeCommandParams); + readIdentifyInteractionInfo.put( + "readIdentifyTimeAttribute", readIdentifyIdentifyTimeAttributeInteractionInfo); + Map readIdentifyIdentifyTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readIdentifyIdentifyTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IdentifyCluster) cluster) + .readIdentifyTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIdentifyIdentifyTypeCommandParams); + readIdentifyInteractionInfo.put( + "readIdentifyTypeAttribute", readIdentifyIdentifyTypeAttributeInteractionInfo); + Map readIdentifyClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readIdentifyClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IdentifyCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIdentifyClusterRevisionCommandParams); + readIdentifyInteractionInfo.put( + "readClusterRevisionAttribute", readIdentifyClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("identify", readIdentifyInteractionInfo); + Map readIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); + Map readIlluminanceMeasurementMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readIlluminanceMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IlluminanceMeasurementCluster) cluster) + .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIlluminanceMeasurementMeasuredValueCommandParams); + readIlluminanceMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", + readIlluminanceMeasurementMeasuredValueAttributeInteractionInfo); + Map readIlluminanceMeasurementMinMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readIlluminanceMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IlluminanceMeasurementCluster) cluster) + .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIlluminanceMeasurementMinMeasuredValueCommandParams); + readIlluminanceMeasurementInteractionInfo.put( + "readMinMeasuredValueAttribute", + readIlluminanceMeasurementMinMeasuredValueAttributeInteractionInfo); + Map readIlluminanceMeasurementMaxMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readIlluminanceMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IlluminanceMeasurementCluster) cluster) + .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIlluminanceMeasurementMaxMeasuredValueCommandParams); + readIlluminanceMeasurementInteractionInfo.put( + "readMaxMeasuredValueAttribute", + readIlluminanceMeasurementMaxMeasuredValueAttributeInteractionInfo); + Map readIlluminanceMeasurementToleranceCommandParams = + new LinkedHashMap(); + InteractionInfo readIlluminanceMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IlluminanceMeasurementCluster) cluster) + .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIlluminanceMeasurementToleranceCommandParams); + readIlluminanceMeasurementInteractionInfo.put( + "readToleranceAttribute", readIlluminanceMeasurementToleranceAttributeInteractionInfo); + Map readIlluminanceMeasurementLightSensorTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readIlluminanceMeasurementLightSensorTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IlluminanceMeasurementCluster) cluster) + .readLightSensorTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIlluminanceMeasurementLightSensorTypeCommandParams); + readIlluminanceMeasurementInteractionInfo.put( + "readLightSensorTypeAttribute", + readIlluminanceMeasurementLightSensorTypeAttributeInteractionInfo); + Map readIlluminanceMeasurementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readIlluminanceMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IlluminanceMeasurementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIlluminanceMeasurementClusterRevisionCommandParams); + readIlluminanceMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", + readIlluminanceMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("illuminanceMeasurement", readIlluminanceMeasurementInteractionInfo); + Map readKeypadInputInteractionInfo = new LinkedHashMap<>(); + Map readKeypadInputClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readKeypadInputClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.KeypadInputCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readKeypadInputClusterRevisionCommandParams); + readKeypadInputInteractionInfo.put( + "readClusterRevisionAttribute", readKeypadInputClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("keypadInput", readKeypadInputInteractionInfo); + Map readLevelControlInteractionInfo = new LinkedHashMap<>(); + Map readLevelControlCurrentLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlCurrentLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readCurrentLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlCurrentLevelCommandParams); + readLevelControlInteractionInfo.put( + "readCurrentLevelAttribute", readLevelControlCurrentLevelAttributeInteractionInfo); + Map readLevelControlRemainingTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlRemainingTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readRemainingTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlRemainingTimeCommandParams); + readLevelControlInteractionInfo.put( + "readRemainingTimeAttribute", readLevelControlRemainingTimeAttributeInteractionInfo); + Map readLevelControlMinLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlMinLevelCommandParams); + readLevelControlInteractionInfo.put( + "readMinLevelAttribute", readLevelControlMinLevelAttributeInteractionInfo); + Map readLevelControlMaxLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlMaxLevelCommandParams); + readLevelControlInteractionInfo.put( + "readMaxLevelAttribute", readLevelControlMaxLevelAttributeInteractionInfo); + Map readLevelControlCurrentFrequencyCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlCurrentFrequencyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readCurrentFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlCurrentFrequencyCommandParams); + readLevelControlInteractionInfo.put( + "readCurrentFrequencyAttribute", readLevelControlCurrentFrequencyAttributeInteractionInfo); + Map readLevelControlMinFrequencyCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlMinFrequencyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readMinFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlMinFrequencyCommandParams); + readLevelControlInteractionInfo.put( + "readMinFrequencyAttribute", readLevelControlMinFrequencyAttributeInteractionInfo); + Map readLevelControlMaxFrequencyCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlMaxFrequencyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readMaxFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlMaxFrequencyCommandParams); + readLevelControlInteractionInfo.put( + "readMaxFrequencyAttribute", readLevelControlMaxFrequencyAttributeInteractionInfo); + Map readLevelControlOptionsCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlOptionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readOptionsAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlOptionsCommandParams); + readLevelControlInteractionInfo.put( + "readOptionsAttribute", readLevelControlOptionsAttributeInteractionInfo); + Map readLevelControlOnOffTransitionTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlOnOffTransitionTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readOnOffTransitionTimeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlOnOffTransitionTimeCommandParams); + readLevelControlInteractionInfo.put( + "readOnOffTransitionTimeAttribute", + readLevelControlOnOffTransitionTimeAttributeInteractionInfo); + Map readLevelControlOnLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlOnLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readOnLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlOnLevelCommandParams); + readLevelControlInteractionInfo.put( + "readOnLevelAttribute", readLevelControlOnLevelAttributeInteractionInfo); + Map readLevelControlOnTransitionTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlOnTransitionTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readOnTransitionTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlOnTransitionTimeCommandParams); + readLevelControlInteractionInfo.put( + "readOnTransitionTimeAttribute", readLevelControlOnTransitionTimeAttributeInteractionInfo); + Map readLevelControlOffTransitionTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlOffTransitionTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readOffTransitionTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlOffTransitionTimeCommandParams); + readLevelControlInteractionInfo.put( + "readOffTransitionTimeAttribute", + readLevelControlOffTransitionTimeAttributeInteractionInfo); + Map readLevelControlDefaultMoveRateCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlDefaultMoveRateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readDefaultMoveRateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlDefaultMoveRateCommandParams); + readLevelControlInteractionInfo.put( + "readDefaultMoveRateAttribute", readLevelControlDefaultMoveRateAttributeInteractionInfo); + Map readLevelControlStartUpCurrentLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlStartUpCurrentLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readStartUpCurrentLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlStartUpCurrentLevelCommandParams); + readLevelControlInteractionInfo.put( + "readStartUpCurrentLevelAttribute", + readLevelControlStartUpCurrentLevelAttributeInteractionInfo); + Map readLevelControlClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readLevelControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLevelControlClusterRevisionCommandParams); + readLevelControlInteractionInfo.put( + "readClusterRevisionAttribute", readLevelControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("levelControl", readLevelControlInteractionInfo); + Map readLowPowerInteractionInfo = new LinkedHashMap<>(); + Map readLowPowerClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readLowPowerClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LowPowerCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readLowPowerClusterRevisionCommandParams); + readLowPowerInteractionInfo.put( + "readClusterRevisionAttribute", readLowPowerClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("lowPower", readLowPowerInteractionInfo); + Map readMediaInputInteractionInfo = new LinkedHashMap<>(); + Map readMediaInputMediaInputListCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaInputMediaInputListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaInputCluster) cluster) + .readMediaInputListAttribute( + (ChipClusters.MediaInputCluster.MediaInputListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedMediaInputListAttributeCallback(), + readMediaInputMediaInputListCommandParams); + readMediaInputInteractionInfo.put( + "readMediaInputListAttribute", readMediaInputMediaInputListAttributeInteractionInfo); + Map readMediaInputCurrentMediaInputCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaInputCurrentMediaInputAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaInputCluster) cluster) + .readCurrentMediaInputAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMediaInputCurrentMediaInputCommandParams); + readMediaInputInteractionInfo.put( + "readCurrentMediaInputAttribute", readMediaInputCurrentMediaInputAttributeInteractionInfo); + Map readMediaInputClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaInputClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaInputCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMediaInputClusterRevisionCommandParams); + readMediaInputInteractionInfo.put( + "readClusterRevisionAttribute", readMediaInputClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("mediaInput", readMediaInputInteractionInfo); + Map readMediaPlaybackInteractionInfo = new LinkedHashMap<>(); + Map readMediaPlaybackPlaybackStateCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackPlaybackStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readPlaybackStateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMediaPlaybackPlaybackStateCommandParams); + readMediaPlaybackInteractionInfo.put( + "readPlaybackStateAttribute", readMediaPlaybackPlaybackStateAttributeInteractionInfo); + Map readMediaPlaybackStartTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackStartTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readStartTimeAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackStartTimeCommandParams); + readMediaPlaybackInteractionInfo.put( + "readStartTimeAttribute", readMediaPlaybackStartTimeAttributeInteractionInfo); + Map readMediaPlaybackDurationCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackDurationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readDurationAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackDurationCommandParams); + readMediaPlaybackInteractionInfo.put( + "readDurationAttribute", readMediaPlaybackDurationAttributeInteractionInfo); + Map readMediaPlaybackPositionUpdatedAtCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackPositionUpdatedAtAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readPositionUpdatedAtAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackPositionUpdatedAtCommandParams); + readMediaPlaybackInteractionInfo.put( + "readPositionUpdatedAtAttribute", + readMediaPlaybackPositionUpdatedAtAttributeInteractionInfo); + Map readMediaPlaybackPositionCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackPositionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readPositionAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackPositionCommandParams); + readMediaPlaybackInteractionInfo.put( + "readPositionAttribute", readMediaPlaybackPositionAttributeInteractionInfo); + Map readMediaPlaybackPlaybackSpeedCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackPlaybackSpeedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readPlaybackSpeedAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackPlaybackSpeedCommandParams); + readMediaPlaybackInteractionInfo.put( + "readPlaybackSpeedAttribute", readMediaPlaybackPlaybackSpeedAttributeInteractionInfo); + Map readMediaPlaybackSeekRangeEndCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackSeekRangeEndAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readSeekRangeEndAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackSeekRangeEndCommandParams); + readMediaPlaybackInteractionInfo.put( + "readSeekRangeEndAttribute", readMediaPlaybackSeekRangeEndAttributeInteractionInfo); + Map readMediaPlaybackSeekRangeStartCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackSeekRangeStartAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readSeekRangeStartAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMediaPlaybackSeekRangeStartCommandParams); + readMediaPlaybackInteractionInfo.put( + "readSeekRangeStartAttribute", readMediaPlaybackSeekRangeStartAttributeInteractionInfo); + Map readMediaPlaybackClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readMediaPlaybackClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMediaPlaybackClusterRevisionCommandParams); + readMediaPlaybackInteractionInfo.put( + "readClusterRevisionAttribute", readMediaPlaybackClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("mediaPlayback", readMediaPlaybackInteractionInfo); + Map readModeSelectInteractionInfo = new LinkedHashMap<>(); + Map readModeSelectCurrentModeCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectCurrentModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readCurrentModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readModeSelectCurrentModeCommandParams); + readModeSelectInteractionInfo.put( + "readCurrentModeAttribute", readModeSelectCurrentModeAttributeInteractionInfo); + Map readModeSelectSupportedModesCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectSupportedModesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readSupportedModesAttribute( + (ChipClusters.ModeSelectCluster.SupportedModesAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedSupportedModesAttributeCallback(), + readModeSelectSupportedModesCommandParams); + readModeSelectInteractionInfo.put( + "readSupportedModesAttribute", readModeSelectSupportedModesAttributeInteractionInfo); + Map readModeSelectOnModeCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectOnModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readOnModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readModeSelectOnModeCommandParams); + readModeSelectInteractionInfo.put( + "readOnModeAttribute", readModeSelectOnModeAttributeInteractionInfo); + Map readModeSelectStartUpModeCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectStartUpModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readStartUpModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readModeSelectStartUpModeCommandParams); + readModeSelectInteractionInfo.put( + "readStartUpModeAttribute", readModeSelectStartUpModeAttributeInteractionInfo); + Map readModeSelectDescriptionCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectDescriptionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readModeSelectDescriptionCommandParams); + readModeSelectInteractionInfo.put( + "readDescriptionAttribute", readModeSelectDescriptionAttributeInteractionInfo); + Map readModeSelectClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readModeSelectClusterRevisionCommandParams); + readModeSelectInteractionInfo.put( + "readClusterRevisionAttribute", readModeSelectClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("modeSelect", readModeSelectInteractionInfo); + Map readNetworkCommissioningInteractionInfo = new LinkedHashMap<>(); + Map readNetworkCommissioningFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readNetworkCommissioningFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.NetworkCommissioningCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readNetworkCommissioningFeatureMapCommandParams); + readNetworkCommissioningInteractionInfo.put( + "readFeatureMapAttribute", readNetworkCommissioningFeatureMapAttributeInteractionInfo); + Map readNetworkCommissioningClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readNetworkCommissioningClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.NetworkCommissioningCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readNetworkCommissioningClusterRevisionCommandParams); + readNetworkCommissioningInteractionInfo.put( + "readClusterRevisionAttribute", + readNetworkCommissioningClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("networkCommissioning", readNetworkCommissioningInteractionInfo); + Map readOtaSoftwareUpdateProviderInteractionInfo = + new LinkedHashMap<>(); + Map readOtaSoftwareUpdateProviderClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readOtaSoftwareUpdateProviderClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateProviderCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOtaSoftwareUpdateProviderClusterRevisionCommandParams); + readOtaSoftwareUpdateProviderInteractionInfo.put( + "readClusterRevisionAttribute", + readOtaSoftwareUpdateProviderClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("otaSoftwareUpdateProvider", readOtaSoftwareUpdateProviderInteractionInfo); + Map readOtaSoftwareUpdateRequestorInteractionInfo = + new LinkedHashMap<>(); + Map + readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams = + new LinkedHashMap(); + InteractionInfo readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) + .readDefaultOtaProviderAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams); + readOtaSoftwareUpdateRequestorInteractionInfo.put( + "readDefaultOtaProviderAttribute", + readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo); + Map readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams = + new LinkedHashMap(); + InteractionInfo readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) + .readUpdatePossibleAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams); + readOtaSoftwareUpdateRequestorInteractionInfo.put( + "readUpdatePossibleAttribute", + readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo); + Map readOtaSoftwareUpdateRequestorClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readOtaSoftwareUpdateRequestorClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOtaSoftwareUpdateRequestorClusterRevisionCommandParams); + readOtaSoftwareUpdateRequestorInteractionInfo.put( + "readClusterRevisionAttribute", + readOtaSoftwareUpdateRequestorClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "otaSoftwareUpdateRequestor", readOtaSoftwareUpdateRequestorInteractionInfo); + Map readOccupancySensingInteractionInfo = new LinkedHashMap<>(); + Map readOccupancySensingOccupancyCommandParams = + new LinkedHashMap(); + InteractionInfo readOccupancySensingOccupancyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OccupancySensingCluster) cluster) + .readOccupancyAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOccupancySensingOccupancyCommandParams); + readOccupancySensingInteractionInfo.put( + "readOccupancyAttribute", readOccupancySensingOccupancyAttributeInteractionInfo); + Map readOccupancySensingOccupancySensorTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readOccupancySensingOccupancySensorTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OccupancySensingCluster) cluster) + .readOccupancySensorTypeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOccupancySensingOccupancySensorTypeCommandParams); + readOccupancySensingInteractionInfo.put( + "readOccupancySensorTypeAttribute", + readOccupancySensingOccupancySensorTypeAttributeInteractionInfo); + Map readOccupancySensingOccupancySensorTypeBitmapCommandParams = + new LinkedHashMap(); + InteractionInfo readOccupancySensingOccupancySensorTypeBitmapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OccupancySensingCluster) cluster) + .readOccupancySensorTypeBitmapAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOccupancySensingOccupancySensorTypeBitmapCommandParams); + readOccupancySensingInteractionInfo.put( + "readOccupancySensorTypeBitmapAttribute", + readOccupancySensingOccupancySensorTypeBitmapAttributeInteractionInfo); + Map readOccupancySensingClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readOccupancySensingClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OccupancySensingCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOccupancySensingClusterRevisionCommandParams); + readOccupancySensingInteractionInfo.put( + "readClusterRevisionAttribute", + readOccupancySensingClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("occupancySensing", readOccupancySensingInteractionInfo); + Map readOnOffInteractionInfo = new LinkedHashMap<>(); + Map readOnOffOnOffCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffOnOffAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readOnOffAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readOnOffOnOffCommandParams); + readOnOffInteractionInfo.put("readOnOffAttribute", readOnOffOnOffAttributeInteractionInfo); + Map readOnOffGlobalSceneControlCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffGlobalSceneControlAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readGlobalSceneControlAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readOnOffGlobalSceneControlCommandParams); + readOnOffInteractionInfo.put( + "readGlobalSceneControlAttribute", readOnOffGlobalSceneControlAttributeInteractionInfo); + Map readOnOffOnTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffOnTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readOnTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffOnTimeCommandParams); + readOnOffInteractionInfo.put("readOnTimeAttribute", readOnOffOnTimeAttributeInteractionInfo); + Map readOnOffOffWaitTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffOffWaitTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readOffWaitTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffOffWaitTimeCommandParams); + readOnOffInteractionInfo.put( + "readOffWaitTimeAttribute", readOnOffOffWaitTimeAttributeInteractionInfo); + Map readOnOffStartUpOnOffCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffStartUpOnOffAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readStartUpOnOffAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffStartUpOnOffCommandParams); + readOnOffInteractionInfo.put( + "readStartUpOnOffAttribute", readOnOffStartUpOnOffAttributeInteractionInfo); + Map readOnOffFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readOnOffFeatureMapCommandParams); + readOnOffInteractionInfo.put( + "readFeatureMapAttribute", readOnOffFeatureMapAttributeInteractionInfo); + Map readOnOffClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffClusterRevisionCommandParams); + readOnOffInteractionInfo.put( + "readClusterRevisionAttribute", readOnOffClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("onOff", readOnOffInteractionInfo); + Map readOnOffSwitchConfigurationInteractionInfo = + new LinkedHashMap<>(); + Map readOnOffSwitchConfigurationSwitchTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) + .readSwitchTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffSwitchConfigurationSwitchTypeCommandParams); + readOnOffSwitchConfigurationInteractionInfo.put( + "readSwitchTypeAttribute", readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo); + Map readOnOffSwitchConfigurationSwitchActionsCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) + .readSwitchActionsAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffSwitchConfigurationSwitchActionsCommandParams); + readOnOffSwitchConfigurationInteractionInfo.put( + "readSwitchActionsAttribute", + readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo); + Map readOnOffSwitchConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOnOffSwitchConfigurationClusterRevisionCommandParams); + readOnOffSwitchConfigurationInteractionInfo.put( + "readClusterRevisionAttribute", + readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo); + Map readOperationalCredentialsInteractionInfo = new LinkedHashMap<>(); + Map readOperationalCredentialsFabricsListCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsFabricsListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readFabricsListAttribute( + (ChipClusters.OperationalCredentialsCluster.FabricsListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedFabricsListAttributeCallback(), + readOperationalCredentialsFabricsListCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readFabricsListAttribute", readOperationalCredentialsFabricsListAttributeInteractionInfo); + Map readOperationalCredentialsSupportedFabricsCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsSupportedFabricsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readSupportedFabricsAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOperationalCredentialsSupportedFabricsCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readSupportedFabricsAttribute", + readOperationalCredentialsSupportedFabricsAttributeInteractionInfo); + Map readOperationalCredentialsCommissionedFabricsCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsCommissionedFabricsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readCommissionedFabricsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOperationalCredentialsCommissionedFabricsCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readCommissionedFabricsAttribute", + readOperationalCredentialsCommissionedFabricsAttributeInteractionInfo); + Map + readOperationalCredentialsTrustedRootCertificatesCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsTrustedRootCertificatesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readTrustedRootCertificatesAttribute( + (ChipClusters.OperationalCredentialsCluster + .TrustedRootCertificatesAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedTrustedRootCertificatesAttributeCallback(), + readOperationalCredentialsTrustedRootCertificatesCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readTrustedRootCertificatesAttribute", + readOperationalCredentialsTrustedRootCertificatesAttributeInteractionInfo); + Map readOperationalCredentialsCurrentFabricIndexCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsCurrentFabricIndexAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readCurrentFabricIndexAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOperationalCredentialsCurrentFabricIndexCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readCurrentFabricIndexAttribute", + readOperationalCredentialsCurrentFabricIndexAttributeInteractionInfo); + Map readOperationalCredentialsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOperationalCredentialsClusterRevisionCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readClusterRevisionAttribute", + readOperationalCredentialsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("operationalCredentials", readOperationalCredentialsInteractionInfo); + Map readPowerSourceInteractionInfo = new LinkedHashMap<>(); + Map readPowerSourceStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceStatusCommandParams); + readPowerSourceInteractionInfo.put( + "readStatusAttribute", readPowerSourceStatusAttributeInteractionInfo); + Map readPowerSourceOrderCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceOrderAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readOrderAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceOrderCommandParams); + readPowerSourceInteractionInfo.put( + "readOrderAttribute", readPowerSourceOrderAttributeInteractionInfo); + Map readPowerSourceDescriptionCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceDescriptionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readPowerSourceDescriptionCommandParams); + readPowerSourceInteractionInfo.put( + "readDescriptionAttribute", readPowerSourceDescriptionAttributeInteractionInfo); + Map readPowerSourceBatteryVoltageCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryVoltageAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryVoltageAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryVoltageCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryVoltageAttribute", readPowerSourceBatteryVoltageAttributeInteractionInfo); + Map readPowerSourceBatteryPercentRemainingCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryPercentRemainingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryPercentRemainingAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceBatteryPercentRemainingCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryPercentRemainingAttribute", + readPowerSourceBatteryPercentRemainingAttributeInteractionInfo); + Map readPowerSourceBatteryTimeRemainingCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryTimeRemainingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryTimeRemainingAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryTimeRemainingCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryTimeRemainingAttribute", + readPowerSourceBatteryTimeRemainingAttributeInteractionInfo); + Map readPowerSourceBatteryChargeLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryChargeLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryChargeLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceBatteryChargeLevelCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryChargeLevelAttribute", + readPowerSourceBatteryChargeLevelAttributeInteractionInfo); + Map readPowerSourceActiveBatteryFaultsCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceActiveBatteryFaultsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readActiveBatteryFaultsAttribute( + (ChipClusters.PowerSourceCluster.ActiveBatteryFaultsAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedActiveBatteryFaultsAttributeCallback(), + readPowerSourceActiveBatteryFaultsCommandParams); + readPowerSourceInteractionInfo.put( + "readActiveBatteryFaultsAttribute", + readPowerSourceActiveBatteryFaultsAttributeInteractionInfo); + Map readPowerSourceBatteryChargeStateCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryChargeStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryChargeStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceBatteryChargeStateCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryChargeStateAttribute", + readPowerSourceBatteryChargeStateAttributeInteractionInfo); + Map readPowerSourceFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceFeatureMapCommandParams); + readPowerSourceInteractionInfo.put( + "readFeatureMapAttribute", readPowerSourceFeatureMapAttributeInteractionInfo); + Map readPowerSourceClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceClusterRevisionCommandParams); + readPowerSourceInteractionInfo.put( + "readClusterRevisionAttribute", readPowerSourceClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("powerSource", readPowerSourceInteractionInfo); + Map readPressureMeasurementInteractionInfo = new LinkedHashMap<>(); + Map readPressureMeasurementMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readPressureMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PressureMeasurementCluster) cluster) + .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPressureMeasurementMeasuredValueCommandParams); + readPressureMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", readPressureMeasurementMeasuredValueAttributeInteractionInfo); + Map readPressureMeasurementMinMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readPressureMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PressureMeasurementCluster) cluster) + .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPressureMeasurementMinMeasuredValueCommandParams); + readPressureMeasurementInteractionInfo.put( + "readMinMeasuredValueAttribute", + readPressureMeasurementMinMeasuredValueAttributeInteractionInfo); + Map readPressureMeasurementMaxMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readPressureMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PressureMeasurementCluster) cluster) + .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPressureMeasurementMaxMeasuredValueCommandParams); + readPressureMeasurementInteractionInfo.put( + "readMaxMeasuredValueAttribute", + readPressureMeasurementMaxMeasuredValueAttributeInteractionInfo); + Map readPressureMeasurementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readPressureMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PressureMeasurementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPressureMeasurementClusterRevisionCommandParams); + readPressureMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", + readPressureMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("pressureMeasurement", readPressureMeasurementInteractionInfo); + Map readPumpConfigurationAndControlInteractionInfo = + new LinkedHashMap<>(); + Map readPumpConfigurationAndControlMaxPressureCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxPressureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxPressureCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxPressureAttribute", + readPumpConfigurationAndControlMaxPressureAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxSpeedCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxSpeedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxSpeedCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxSpeedAttribute", readPumpConfigurationAndControlMaxSpeedAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxFlowCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxFlowAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxFlowCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxFlowAttribute", readPumpConfigurationAndControlMaxFlowAttributeInteractionInfo); + Map readPumpConfigurationAndControlMinConstPressureCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMinConstPressureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMinConstPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMinConstPressureCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMinConstPressureAttribute", + readPumpConfigurationAndControlMinConstPressureAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxConstPressureCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxConstPressureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxConstPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxConstPressureCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxConstPressureAttribute", + readPumpConfigurationAndControlMaxConstPressureAttributeInteractionInfo); + Map readPumpConfigurationAndControlMinCompPressureCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMinCompPressureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMinCompPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMinCompPressureCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMinCompPressureAttribute", + readPumpConfigurationAndControlMinCompPressureAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxCompPressureCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxCompPressureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxCompPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxCompPressureCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxCompPressureAttribute", + readPumpConfigurationAndControlMaxCompPressureAttributeInteractionInfo); + Map readPumpConfigurationAndControlMinConstSpeedCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMinConstSpeedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMinConstSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMinConstSpeedCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMinConstSpeedAttribute", + readPumpConfigurationAndControlMinConstSpeedAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxConstSpeedCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxConstSpeedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxConstSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxConstSpeedCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxConstSpeedAttribute", + readPumpConfigurationAndControlMaxConstSpeedAttributeInteractionInfo); + Map readPumpConfigurationAndControlMinConstFlowCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMinConstFlowAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMinConstFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMinConstFlowCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMinConstFlowAttribute", + readPumpConfigurationAndControlMinConstFlowAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxConstFlowCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxConstFlowAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxConstFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxConstFlowCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxConstFlowAttribute", + readPumpConfigurationAndControlMaxConstFlowAttributeInteractionInfo); + Map readPumpConfigurationAndControlMinConstTempCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMinConstTempAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMinConstTempAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMinConstTempCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMinConstTempAttribute", + readPumpConfigurationAndControlMinConstTempAttributeInteractionInfo); + Map readPumpConfigurationAndControlMaxConstTempCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlMaxConstTempAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readMaxConstTempAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlMaxConstTempCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxConstTempAttribute", + readPumpConfigurationAndControlMaxConstTempAttributeInteractionInfo); + Map readPumpConfigurationAndControlPumpStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlPumpStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readPumpStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlPumpStatusCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readPumpStatusAttribute", + readPumpConfigurationAndControlPumpStatusAttributeInteractionInfo); + Map + readPumpConfigurationAndControlEffectiveOperationModeCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlEffectiveOperationModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readEffectiveOperationModeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlEffectiveOperationModeCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readEffectiveOperationModeAttribute", + readPumpConfigurationAndControlEffectiveOperationModeAttributeInteractionInfo); + Map + readPumpConfigurationAndControlEffectiveControlModeCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlEffectiveControlModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readEffectiveControlModeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlEffectiveControlModeCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readEffectiveControlModeAttribute", + readPumpConfigurationAndControlEffectiveControlModeAttributeInteractionInfo); + Map readPumpConfigurationAndControlCapacityCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlCapacityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readCapacityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlCapacityCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readCapacityAttribute", readPumpConfigurationAndControlCapacityAttributeInteractionInfo); + Map readPumpConfigurationAndControlSpeedCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlSpeedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlSpeedCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readSpeedAttribute", readPumpConfigurationAndControlSpeedAttributeInteractionInfo); + Map + readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readLifetimeEnergyConsumedAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readLifetimeEnergyConsumedAttribute", + readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeInteractionInfo); + Map readPumpConfigurationAndControlOperationModeCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlOperationModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readOperationModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlOperationModeCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readOperationModeAttribute", + readPumpConfigurationAndControlOperationModeAttributeInteractionInfo); + Map readPumpConfigurationAndControlControlModeCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlControlModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readControlModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlControlModeCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readControlModeAttribute", + readPumpConfigurationAndControlControlModeAttributeInteractionInfo); + Map readPumpConfigurationAndControlAlarmMaskCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlAlarmMaskAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readAlarmMaskAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlAlarmMaskCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readAlarmMaskAttribute", readPumpConfigurationAndControlAlarmMaskAttributeInteractionInfo); + Map readPumpConfigurationAndControlFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPumpConfigurationAndControlFeatureMapCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readFeatureMapAttribute", + readPumpConfigurationAndControlFeatureMapAttributeInteractionInfo); + Map readPumpConfigurationAndControlClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readPumpConfigurationAndControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPumpConfigurationAndControlClusterRevisionCommandParams); + readPumpConfigurationAndControlInteractionInfo.put( + "readClusterRevisionAttribute", + readPumpConfigurationAndControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "pumpConfigurationAndControl", readPumpConfigurationAndControlInteractionInfo); + Map readRelativeHumidityMeasurementInteractionInfo = + new LinkedHashMap<>(); + Map readRelativeHumidityMeasurementMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readRelativeHumidityMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) + .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRelativeHumidityMeasurementMeasuredValueCommandParams); + readRelativeHumidityMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", + readRelativeHumidityMeasurementMeasuredValueAttributeInteractionInfo); + Map readRelativeHumidityMeasurementMinMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readRelativeHumidityMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) + .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRelativeHumidityMeasurementMinMeasuredValueCommandParams); + readRelativeHumidityMeasurementInteractionInfo.put( + "readMinMeasuredValueAttribute", + readRelativeHumidityMeasurementMinMeasuredValueAttributeInteractionInfo); + Map readRelativeHumidityMeasurementMaxMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readRelativeHumidityMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) + .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRelativeHumidityMeasurementMaxMeasuredValueCommandParams); + readRelativeHumidityMeasurementInteractionInfo.put( + "readMaxMeasuredValueAttribute", + readRelativeHumidityMeasurementMaxMeasuredValueAttributeInteractionInfo); + Map readRelativeHumidityMeasurementToleranceCommandParams = + new LinkedHashMap(); + InteractionInfo readRelativeHumidityMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) + .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRelativeHumidityMeasurementToleranceCommandParams); + readRelativeHumidityMeasurementInteractionInfo.put( + "readToleranceAttribute", readRelativeHumidityMeasurementToleranceAttributeInteractionInfo); + Map readRelativeHumidityMeasurementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readRelativeHumidityMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRelativeHumidityMeasurementClusterRevisionCommandParams); + readRelativeHumidityMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", + readRelativeHumidityMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "relativeHumidityMeasurement", readRelativeHumidityMeasurementInteractionInfo); + Map readScenesInteractionInfo = new LinkedHashMap<>(); + Map readScenesSceneCountCommandParams = + new LinkedHashMap(); + InteractionInfo readScenesSceneCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ScenesCluster) cluster) + .readSceneCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readScenesSceneCountCommandParams); + readScenesInteractionInfo.put( + "readSceneCountAttribute", readScenesSceneCountAttributeInteractionInfo); + Map readScenesCurrentSceneCommandParams = + new LinkedHashMap(); + InteractionInfo readScenesCurrentSceneAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ScenesCluster) cluster) + .readCurrentSceneAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readScenesCurrentSceneCommandParams); + readScenesInteractionInfo.put( + "readCurrentSceneAttribute", readScenesCurrentSceneAttributeInteractionInfo); + Map readScenesCurrentGroupCommandParams = + new LinkedHashMap(); + InteractionInfo readScenesCurrentGroupAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ScenesCluster) cluster) + .readCurrentGroupAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readScenesCurrentGroupCommandParams); + readScenesInteractionInfo.put( + "readCurrentGroupAttribute", readScenesCurrentGroupAttributeInteractionInfo); + Map readScenesSceneValidCommandParams = + new LinkedHashMap(); + InteractionInfo readScenesSceneValidAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ScenesCluster) cluster) + .readSceneValidAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readScenesSceneValidCommandParams); + readScenesInteractionInfo.put( + "readSceneValidAttribute", readScenesSceneValidAttributeInteractionInfo); + Map readScenesNameSupportCommandParams = + new LinkedHashMap(); + InteractionInfo readScenesNameSupportAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ScenesCluster) cluster) + .readNameSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readScenesNameSupportCommandParams); + readScenesInteractionInfo.put( + "readNameSupportAttribute", readScenesNameSupportAttributeInteractionInfo); + Map readScenesClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readScenesClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ScenesCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readScenesClusterRevisionCommandParams); + readScenesInteractionInfo.put( + "readClusterRevisionAttribute", readScenesClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("scenes", readScenesInteractionInfo); + Map readSoftwareDiagnosticsInteractionInfo = new LinkedHashMap<>(); + Map readSoftwareDiagnosticsThreadMetricsCommandParams = + new LinkedHashMap(); + InteractionInfo readSoftwareDiagnosticsThreadMetricsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SoftwareDiagnosticsCluster) cluster) + .readThreadMetricsAttribute( + (ChipClusters.SoftwareDiagnosticsCluster.ThreadMetricsAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedThreadMetricsAttributeCallback(), + readSoftwareDiagnosticsThreadMetricsCommandParams); + readSoftwareDiagnosticsInteractionInfo.put( + "readThreadMetricsAttribute", readSoftwareDiagnosticsThreadMetricsAttributeInteractionInfo); + Map readSoftwareDiagnosticsCurrentHeapFreeCommandParams = + new LinkedHashMap(); + InteractionInfo readSoftwareDiagnosticsCurrentHeapFreeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SoftwareDiagnosticsCluster) cluster) + .readCurrentHeapFreeAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readSoftwareDiagnosticsCurrentHeapFreeCommandParams); + readSoftwareDiagnosticsInteractionInfo.put( + "readCurrentHeapFreeAttribute", + readSoftwareDiagnosticsCurrentHeapFreeAttributeInteractionInfo); + Map readSoftwareDiagnosticsCurrentHeapUsedCommandParams = + new LinkedHashMap(); + InteractionInfo readSoftwareDiagnosticsCurrentHeapUsedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SoftwareDiagnosticsCluster) cluster) + .readCurrentHeapUsedAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readSoftwareDiagnosticsCurrentHeapUsedCommandParams); + readSoftwareDiagnosticsInteractionInfo.put( + "readCurrentHeapUsedAttribute", + readSoftwareDiagnosticsCurrentHeapUsedAttributeInteractionInfo); + Map readSoftwareDiagnosticsCurrentHeapHighWatermarkCommandParams = + new LinkedHashMap(); + InteractionInfo readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SoftwareDiagnosticsCluster) cluster) + .readCurrentHeapHighWatermarkAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readSoftwareDiagnosticsCurrentHeapHighWatermarkCommandParams); + readSoftwareDiagnosticsInteractionInfo.put( + "readCurrentHeapHighWatermarkAttribute", + readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeInteractionInfo); + Map readSoftwareDiagnosticsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readSoftwareDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SoftwareDiagnosticsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSoftwareDiagnosticsClusterRevisionCommandParams); + readSoftwareDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readSoftwareDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("softwareDiagnostics", readSoftwareDiagnosticsInteractionInfo); + Map readSwitchInteractionInfo = new LinkedHashMap<>(); + Map readSwitchNumberOfPositionsCommandParams = + new LinkedHashMap(); + InteractionInfo readSwitchNumberOfPositionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SwitchCluster) cluster) + .readNumberOfPositionsAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSwitchNumberOfPositionsCommandParams); + readSwitchInteractionInfo.put( + "readNumberOfPositionsAttribute", readSwitchNumberOfPositionsAttributeInteractionInfo); + Map readSwitchCurrentPositionCommandParams = + new LinkedHashMap(); + InteractionInfo readSwitchCurrentPositionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SwitchCluster) cluster) + .readCurrentPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSwitchCurrentPositionCommandParams); + readSwitchInteractionInfo.put( + "readCurrentPositionAttribute", readSwitchCurrentPositionAttributeInteractionInfo); + Map readSwitchMultiPressMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readSwitchMultiPressMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SwitchCluster) cluster) + .readMultiPressMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSwitchMultiPressMaxCommandParams); + readSwitchInteractionInfo.put( + "readMultiPressMaxAttribute", readSwitchMultiPressMaxAttributeInteractionInfo); + Map readSwitchFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readSwitchFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SwitchCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readSwitchFeatureMapCommandParams); + readSwitchInteractionInfo.put( + "readFeatureMapAttribute", readSwitchFeatureMapAttributeInteractionInfo); + Map readSwitchClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readSwitchClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SwitchCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSwitchClusterRevisionCommandParams); + readSwitchInteractionInfo.put( + "readClusterRevisionAttribute", readSwitchClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("switch", readSwitchInteractionInfo); + Map readTvChannelInteractionInfo = new LinkedHashMap<>(); + Map readTvChannelTvChannelListCommandParams = + new LinkedHashMap(); + InteractionInfo readTvChannelTvChannelListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TvChannelCluster) cluster) + .readTvChannelListAttribute( + (ChipClusters.TvChannelCluster.TvChannelListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedTvChannelListAttributeCallback(), + readTvChannelTvChannelListCommandParams); + readTvChannelInteractionInfo.put( + "readTvChannelListAttribute", readTvChannelTvChannelListAttributeInteractionInfo); + Map readTvChannelTvChannelLineupCommandParams = + new LinkedHashMap(); + InteractionInfo readTvChannelTvChannelLineupAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TvChannelCluster) cluster) + .readTvChannelLineupAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readTvChannelTvChannelLineupCommandParams); + readTvChannelInteractionInfo.put( + "readTvChannelLineupAttribute", readTvChannelTvChannelLineupAttributeInteractionInfo); + Map readTvChannelCurrentTvChannelCommandParams = + new LinkedHashMap(); + InteractionInfo readTvChannelCurrentTvChannelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TvChannelCluster) cluster) + .readCurrentTvChannelAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readTvChannelCurrentTvChannelCommandParams); + readTvChannelInteractionInfo.put( + "readCurrentTvChannelAttribute", readTvChannelCurrentTvChannelAttributeInteractionInfo); + Map readTvChannelClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readTvChannelClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TvChannelCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTvChannelClusterRevisionCommandParams); + readTvChannelInteractionInfo.put( + "readClusterRevisionAttribute", readTvChannelClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("tvChannel", readTvChannelInteractionInfo); + Map readTargetNavigatorInteractionInfo = new LinkedHashMap<>(); + Map readTargetNavigatorTargetNavigatorListCommandParams = + new LinkedHashMap(); + InteractionInfo readTargetNavigatorTargetNavigatorListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TargetNavigatorCluster) cluster) + .readTargetNavigatorListAttribute( + (ChipClusters.TargetNavigatorCluster.TargetNavigatorListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedTargetNavigatorListAttributeCallback(), + readTargetNavigatorTargetNavigatorListCommandParams); + readTargetNavigatorInteractionInfo.put( + "readTargetNavigatorListAttribute", + readTargetNavigatorTargetNavigatorListAttributeInteractionInfo); + Map readTargetNavigatorClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readTargetNavigatorClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TargetNavigatorCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTargetNavigatorClusterRevisionCommandParams); + readTargetNavigatorInteractionInfo.put( + "readClusterRevisionAttribute", readTargetNavigatorClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("targetNavigator", readTargetNavigatorInteractionInfo); + Map readTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); + Map readTemperatureMeasurementMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readTemperatureMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TemperatureMeasurementCluster) cluster) + .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTemperatureMeasurementMeasuredValueCommandParams); + readTemperatureMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", + readTemperatureMeasurementMeasuredValueAttributeInteractionInfo); + Map readTemperatureMeasurementMinMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readTemperatureMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TemperatureMeasurementCluster) cluster) + .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTemperatureMeasurementMinMeasuredValueCommandParams); + readTemperatureMeasurementInteractionInfo.put( + "readMinMeasuredValueAttribute", + readTemperatureMeasurementMinMeasuredValueAttributeInteractionInfo); + Map readTemperatureMeasurementMaxMeasuredValueCommandParams = + new LinkedHashMap(); + InteractionInfo readTemperatureMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TemperatureMeasurementCluster) cluster) + .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTemperatureMeasurementMaxMeasuredValueCommandParams); + readTemperatureMeasurementInteractionInfo.put( + "readMaxMeasuredValueAttribute", + readTemperatureMeasurementMaxMeasuredValueAttributeInteractionInfo); + Map readTemperatureMeasurementToleranceCommandParams = + new LinkedHashMap(); + InteractionInfo readTemperatureMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TemperatureMeasurementCluster) cluster) + .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTemperatureMeasurementToleranceCommandParams); + readTemperatureMeasurementInteractionInfo.put( + "readToleranceAttribute", readTemperatureMeasurementToleranceAttributeInteractionInfo); + Map readTemperatureMeasurementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readTemperatureMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TemperatureMeasurementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTemperatureMeasurementClusterRevisionCommandParams); + readTemperatureMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", + readTemperatureMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("temperatureMeasurement", readTemperatureMeasurementInteractionInfo); + Map readTestClusterInteractionInfo = new LinkedHashMap<>(); + Map readTestClusterBooleanCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterBooleanAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTestClusterBooleanCommandParams); + readTestClusterInteractionInfo.put( + "readBooleanAttribute", readTestClusterBooleanAttributeInteractionInfo); + Map readTestClusterBitmap8CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterBitmap8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterBitmap8CommandParams); + readTestClusterInteractionInfo.put( + "readBitmap8Attribute", readTestClusterBitmap8AttributeInteractionInfo); + Map readTestClusterBitmap16CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterBitmap16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterBitmap16CommandParams); + readTestClusterInteractionInfo.put( + "readBitmap16Attribute", readTestClusterBitmap16AttributeInteractionInfo); + Map readTestClusterBitmap32CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterBitmap32AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterBitmap32CommandParams); + readTestClusterInteractionInfo.put( + "readBitmap32Attribute", readTestClusterBitmap32AttributeInteractionInfo); + Map readTestClusterBitmap64CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterBitmap64AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterBitmap64CommandParams); + readTestClusterInteractionInfo.put( + "readBitmap64Attribute", readTestClusterBitmap64AttributeInteractionInfo); + Map readTestClusterInt8uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt8uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterInt8uCommandParams); + readTestClusterInteractionInfo.put( + "readInt8uAttribute", readTestClusterInt8uAttributeInteractionInfo); + Map readTestClusterInt16uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt16uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterInt16uCommandParams); + readTestClusterInteractionInfo.put( + "readInt16uAttribute", readTestClusterInt16uAttributeInteractionInfo); + Map readTestClusterInt32uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt32uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt32uAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterInt32uCommandParams); + readTestClusterInteractionInfo.put( + "readInt32uAttribute", readTestClusterInt32uAttributeInteractionInfo); + Map readTestClusterInt64uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt64uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt64uAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterInt64uCommandParams); + readTestClusterInteractionInfo.put( + "readInt64uAttribute", readTestClusterInt64uAttributeInteractionInfo); + Map readTestClusterInt8sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt8sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterInt8sCommandParams); + readTestClusterInteractionInfo.put( + "readInt8sAttribute", readTestClusterInt8sAttributeInteractionInfo); + Map readTestClusterInt16sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt16sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterInt16sCommandParams); + readTestClusterInteractionInfo.put( + "readInt16sAttribute", readTestClusterInt16sAttributeInteractionInfo); + Map readTestClusterInt32sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt32sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt32sAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterInt32sCommandParams); + readTestClusterInteractionInfo.put( + "readInt32sAttribute", readTestClusterInt32sAttributeInteractionInfo); + Map readTestClusterInt64sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterInt64sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readInt64sAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterInt64sCommandParams); + readTestClusterInteractionInfo.put( + "readInt64sAttribute", readTestClusterInt64sAttributeInteractionInfo); + Map readTestClusterEnum8CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterEnum8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterEnum8CommandParams); + readTestClusterInteractionInfo.put( + "readEnum8Attribute", readTestClusterEnum8AttributeInteractionInfo); + Map readTestClusterEnum16CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterEnum16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterEnum16CommandParams); + readTestClusterInteractionInfo.put( + "readEnum16Attribute", readTestClusterEnum16AttributeInteractionInfo); + Map readTestClusterOctetStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readOctetStringAttribute((ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readTestClusterOctetStringCommandParams); + readTestClusterInteractionInfo.put( + "readOctetStringAttribute", readTestClusterOctetStringAttributeInteractionInfo); + Map readTestClusterListInt8uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterListInt8uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readListInt8uAttribute( + (ChipClusters.TestClusterCluster.ListInt8uAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedListInt8uAttributeCallback(), + readTestClusterListInt8uCommandParams); + readTestClusterInteractionInfo.put( + "readListInt8uAttribute", readTestClusterListInt8uAttributeInteractionInfo); + Map readTestClusterListOctetStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterListOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readListOctetStringAttribute( + (ChipClusters.TestClusterCluster.ListOctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedListOctetStringAttributeCallback(), + readTestClusterListOctetStringCommandParams); + readTestClusterInteractionInfo.put( + "readListOctetStringAttribute", readTestClusterListOctetStringAttributeInteractionInfo); + Map readTestClusterListStructOctetStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterListStructOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readListStructOctetStringAttribute( + (ChipClusters.TestClusterCluster.ListStructOctetStringAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedListStructOctetStringAttributeCallback(), + readTestClusterListStructOctetStringCommandParams); + readTestClusterInteractionInfo.put( + "readListStructOctetStringAttribute", + readTestClusterListStructOctetStringAttributeInteractionInfo); + Map readTestClusterLongOctetStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterLongOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readLongOctetStringAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readTestClusterLongOctetStringCommandParams); + readTestClusterInteractionInfo.put( + "readLongOctetStringAttribute", readTestClusterLongOctetStringAttributeInteractionInfo); + Map readTestClusterCharStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readCharStringAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readTestClusterCharStringCommandParams); + readTestClusterInteractionInfo.put( + "readCharStringAttribute", readTestClusterCharStringAttributeInteractionInfo); + Map readTestClusterLongCharStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterLongCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readLongCharStringAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readTestClusterLongCharStringCommandParams); + readTestClusterInteractionInfo.put( + "readLongCharStringAttribute", readTestClusterLongCharStringAttributeInteractionInfo); + Map readTestClusterEpochUsCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterEpochUsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readEpochUsAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterEpochUsCommandParams); + readTestClusterInteractionInfo.put( + "readEpochUsAttribute", readTestClusterEpochUsAttributeInteractionInfo); + Map readTestClusterEpochSCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterEpochSAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readEpochSAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterEpochSCommandParams); + readTestClusterInteractionInfo.put( + "readEpochSAttribute", readTestClusterEpochSAttributeInteractionInfo); + Map readTestClusterVendorIdCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterVendorIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterVendorIdCommandParams); + readTestClusterInteractionInfo.put( + "readVendorIdAttribute", readTestClusterVendorIdAttributeInteractionInfo); + Map readTestClusterListNullablesAndOptionalsStructCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterListNullablesAndOptionalsStructAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readListNullablesAndOptionalsStructAttribute( + (ChipClusters.TestClusterCluster + .ListNullablesAndOptionalsStructAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping.DelegatedListNullablesAndOptionalsStructAttributeCallback(), + readTestClusterListNullablesAndOptionalsStructCommandParams); + readTestClusterInteractionInfo.put( + "readListNullablesAndOptionalsStructAttribute", + readTestClusterListNullablesAndOptionalsStructAttributeInteractionInfo); + Map readTestClusterUnsupportedCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterUnsupportedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readUnsupportedAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTestClusterUnsupportedCommandParams); + readTestClusterInteractionInfo.put( + "readUnsupportedAttribute", readTestClusterUnsupportedAttributeInteractionInfo); + Map readTestClusterNullableBooleanCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBooleanAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTestClusterNullableBooleanCommandParams); + readTestClusterInteractionInfo.put( + "readNullableBooleanAttribute", readTestClusterNullableBooleanAttributeInteractionInfo); + Map readTestClusterNullableBitmap8CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableBitmap8CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap8Attribute", readTestClusterNullableBitmap8AttributeInteractionInfo); + Map readTestClusterNullableBitmap16CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableBitmap16CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap16Attribute", readTestClusterNullableBitmap16AttributeInteractionInfo); + Map readTestClusterNullableBitmap32CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap32AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterNullableBitmap32CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap32Attribute", readTestClusterNullableBitmap32AttributeInteractionInfo); + Map readTestClusterNullableBitmap64CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap64AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterNullableBitmap64CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap64Attribute", readTestClusterNullableBitmap64AttributeInteractionInfo); + Map readTestClusterNullableInt8uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt8uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt8uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt8uAttribute", readTestClusterNullableInt8uAttributeInteractionInfo); + Map readTestClusterNullableInt16uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt16uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt16uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt16uAttribute", readTestClusterNullableInt16uAttributeInteractionInfo); + Map readTestClusterNullableInt32uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt32uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt32uAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterNullableInt32uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt32uAttribute", readTestClusterNullableInt32uAttributeInteractionInfo); + Map readTestClusterNullableInt64uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt64uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt64uAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterNullableInt64uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt64uAttribute", readTestClusterNullableInt64uAttributeInteractionInfo); + Map readTestClusterNullableInt8sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt8sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt8sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt8sAttribute", readTestClusterNullableInt8sAttributeInteractionInfo); + Map readTestClusterNullableInt16sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt16sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt16sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt16sAttribute", readTestClusterNullableInt16sAttributeInteractionInfo); + Map readTestClusterNullableInt32sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt32sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt32sAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterNullableInt32sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt32sAttribute", readTestClusterNullableInt32sAttributeInteractionInfo); + Map readTestClusterNullableInt64sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt64sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt64sAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTestClusterNullableInt64sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt64sAttribute", readTestClusterNullableInt64sAttributeInteractionInfo); + Map readTestClusterNullableEnum8CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableEnum8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableEnum8CommandParams); + readTestClusterInteractionInfo.put( + "readNullableEnum8Attribute", readTestClusterNullableEnum8AttributeInteractionInfo); + Map readTestClusterNullableEnum16CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableEnum16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterNullableEnum16CommandParams); + readTestClusterInteractionInfo.put( + "readNullableEnum16Attribute", readTestClusterNullableEnum16AttributeInteractionInfo); + Map readTestClusterNullableOctetStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableOctetStringAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readTestClusterNullableOctetStringCommandParams); + readTestClusterInteractionInfo.put( + "readNullableOctetStringAttribute", + readTestClusterNullableOctetStringAttributeInteractionInfo); + Map readTestClusterNullableCharStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableCharStringAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readTestClusterNullableCharStringCommandParams); + readTestClusterInteractionInfo.put( + "readNullableCharStringAttribute", + readTestClusterNullableCharStringAttributeInteractionInfo); + Map readTestClusterClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTestClusterClusterRevisionCommandParams); + readTestClusterInteractionInfo.put( + "readClusterRevisionAttribute", readTestClusterClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("testCluster", readTestClusterInteractionInfo); + Map readThermostatInteractionInfo = new LinkedHashMap<>(); + Map readThermostatLocalTemperatureCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatLocalTemperatureAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readLocalTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatLocalTemperatureCommandParams); + readThermostatInteractionInfo.put( + "readLocalTemperatureAttribute", readThermostatLocalTemperatureAttributeInteractionInfo); + Map readThermostatAbsMinHeatSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readAbsMinHeatSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatAbsMinHeatSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readAbsMinHeatSetpointLimitAttribute", + readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo); + Map readThermostatAbsMaxHeatSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatAbsMaxHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readAbsMaxHeatSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatAbsMaxHeatSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readAbsMaxHeatSetpointLimitAttribute", + readThermostatAbsMaxHeatSetpointLimitAttributeInteractionInfo); + Map readThermostatAbsMinCoolSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatAbsMinCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readAbsMinCoolSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatAbsMinCoolSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readAbsMinCoolSetpointLimitAttribute", + readThermostatAbsMinCoolSetpointLimitAttributeInteractionInfo); + Map readThermostatAbsMaxCoolSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readAbsMaxCoolSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatAbsMaxCoolSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readAbsMaxCoolSetpointLimitAttribute", + readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo); + Map readThermostatOccupiedCoolingSetpointCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOccupiedCoolingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOccupiedCoolingSetpointAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatOccupiedCoolingSetpointCommandParams); + readThermostatInteractionInfo.put( + "readOccupiedCoolingSetpointAttribute", + readThermostatOccupiedCoolingSetpointAttributeInteractionInfo); + Map readThermostatOccupiedHeatingSetpointCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatOccupiedHeatingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readOccupiedHeatingSetpointAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatOccupiedHeatingSetpointCommandParams); + readThermostatInteractionInfo.put( + "readOccupiedHeatingSetpointAttribute", + readThermostatOccupiedHeatingSetpointAttributeInteractionInfo); + Map readThermostatMinHeatSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatMinHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readMinHeatSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatMinHeatSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readMinHeatSetpointLimitAttribute", + readThermostatMinHeatSetpointLimitAttributeInteractionInfo); + Map readThermostatMaxHeatSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatMaxHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readMaxHeatSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatMaxHeatSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readMaxHeatSetpointLimitAttribute", + readThermostatMaxHeatSetpointLimitAttributeInteractionInfo); + Map readThermostatMinCoolSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatMinCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readMinCoolSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatMinCoolSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readMinCoolSetpointLimitAttribute", + readThermostatMinCoolSetpointLimitAttributeInteractionInfo); + Map readThermostatMaxCoolSetpointLimitCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatMaxCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readMaxCoolSetpointLimitAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatMaxCoolSetpointLimitCommandParams); + readThermostatInteractionInfo.put( + "readMaxCoolSetpointLimitAttribute", + readThermostatMaxCoolSetpointLimitAttributeInteractionInfo); + Map readThermostatMinSetpointDeadBandCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatMinSetpointDeadBandAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readMinSetpointDeadBandAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatMinSetpointDeadBandCommandParams); + readThermostatInteractionInfo.put( + "readMinSetpointDeadBandAttribute", + readThermostatMinSetpointDeadBandAttributeInteractionInfo); + Map readThermostatControlSequenceOfOperationCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatControlSequenceOfOperationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readControlSequenceOfOperationAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatControlSequenceOfOperationCommandParams); + readThermostatInteractionInfo.put( + "readControlSequenceOfOperationAttribute", + readThermostatControlSequenceOfOperationAttributeInteractionInfo); + Map readThermostatSystemModeCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatSystemModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readSystemModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatSystemModeCommandParams); + readThermostatInteractionInfo.put( + "readSystemModeAttribute", readThermostatSystemModeAttributeInteractionInfo); + Map readThermostatStartOfWeekCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatStartOfWeekAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readStartOfWeekAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatStartOfWeekCommandParams); + readThermostatInteractionInfo.put( + "readStartOfWeekAttribute", readThermostatStartOfWeekAttributeInteractionInfo); + Map readThermostatNumberOfWeeklyTransitionsCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatNumberOfWeeklyTransitionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readNumberOfWeeklyTransitionsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatNumberOfWeeklyTransitionsCommandParams); + readThermostatInteractionInfo.put( + "readNumberOfWeeklyTransitionsAttribute", + readThermostatNumberOfWeeklyTransitionsAttributeInteractionInfo); + Map readThermostatNumberOfDailyTransitionsCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatNumberOfDailyTransitionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readNumberOfDailyTransitionsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatNumberOfDailyTransitionsCommandParams); + readThermostatInteractionInfo.put( + "readNumberOfDailyTransitionsAttribute", + readThermostatNumberOfDailyTransitionsAttributeInteractionInfo); + Map readThermostatFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThermostatFeatureMapCommandParams); + readThermostatInteractionInfo.put( + "readFeatureMapAttribute", readThermostatFeatureMapAttributeInteractionInfo); + Map readThermostatClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatClusterRevisionCommandParams); + readThermostatInteractionInfo.put( + "readClusterRevisionAttribute", readThermostatClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("thermostat", readThermostatInteractionInfo); + Map readThermostatUserInterfaceConfigurationInteractionInfo = + new LinkedHashMap<>(); + Map + readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams = + new LinkedHashMap(); + InteractionInfo + readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .readTemperatureDisplayModeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams); + readThermostatUserInterfaceConfigurationInteractionInfo.put( + "readTemperatureDisplayModeAttribute", + readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo); + Map + readThermostatUserInterfaceConfigurationKeypadLockoutCommandParams = + new LinkedHashMap(); + InteractionInfo readThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .readKeypadLockoutAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatUserInterfaceConfigurationKeypadLockoutCommandParams); + readThermostatUserInterfaceConfigurationInteractionInfo.put( + "readKeypadLockoutAttribute", + readThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo); + Map + readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams = + new LinkedHashMap(); + InteractionInfo + readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .readScheduleProgrammingVisibilityAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams); + readThermostatUserInterfaceConfigurationInteractionInfo.put( + "readScheduleProgrammingVisibilityAttribute", + readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo); + Map + readThermostatUserInterfaceConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo + readThermostatUserInterfaceConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatUserInterfaceConfigurationClusterRevisionCommandParams); + readThermostatUserInterfaceConfigurationInteractionInfo.put( + "readClusterRevisionAttribute", + readThermostatUserInterfaceConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "thermostatUserInterfaceConfiguration", + readThermostatUserInterfaceConfigurationInteractionInfo); + Map readThreadNetworkDiagnosticsInteractionInfo = + new LinkedHashMap<>(); + Map readThreadNetworkDiagnosticsChannelCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsChannelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readChannelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsChannelCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readChannelAttribute", readThreadNetworkDiagnosticsChannelAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRoutingRoleCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRoutingRoleAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRoutingRoleAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsRoutingRoleCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRoutingRoleAttribute", + readThreadNetworkDiagnosticsRoutingRoleAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsNetworkNameCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsNetworkNameAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readNetworkNameAttribute((ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readThreadNetworkDiagnosticsNetworkNameCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readNetworkNameAttribute", + readThreadNetworkDiagnosticsNetworkNameAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsPanIdCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsPanIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readPanIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsPanIdCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readPanIdAttribute", readThreadNetworkDiagnosticsPanIdAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsExtendedPanIdCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsExtendedPanIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readExtendedPanIdAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsExtendedPanIdCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readExtendedPanIdAttribute", + readThreadNetworkDiagnosticsExtendedPanIdAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsMeshLocalPrefixCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsMeshLocalPrefixAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readMeshLocalPrefixAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readThreadNetworkDiagnosticsMeshLocalPrefixCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readMeshLocalPrefixAttribute", + readThreadNetworkDiagnosticsMeshLocalPrefixAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsOverrunCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsOverrunCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsOverrunCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readOverrunCountAttribute", + readThreadNetworkDiagnosticsOverrunCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsNeighborTableListCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsNeighborTableListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readNeighborTableListAttribute( + (ChipClusters.ThreadNetworkDiagnosticsCluster + .NeighborTableListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedNeighborTableListAttributeCallback(), + readThreadNetworkDiagnosticsNeighborTableListCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readNeighborTableListAttribute", + readThreadNetworkDiagnosticsNeighborTableListAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRouteTableListCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRouteTableListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRouteTableListAttribute( + (ChipClusters.ThreadNetworkDiagnosticsCluster.RouteTableListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedRouteTableListAttributeCallback(), + readThreadNetworkDiagnosticsRouteTableListCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRouteTableListAttribute", + readThreadNetworkDiagnosticsRouteTableListAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsPartitionIdCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsPartitionIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readPartitionIdAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsPartitionIdCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readPartitionIdAttribute", + readThreadNetworkDiagnosticsPartitionIdAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsWeightingCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsWeightingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readWeightingAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsWeightingCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readWeightingAttribute", readThreadNetworkDiagnosticsWeightingAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsDataVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsDataVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readDataVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsDataVersionCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readDataVersionAttribute", + readThreadNetworkDiagnosticsDataVersionAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsStableDataVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsStableDataVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readStableDataVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsStableDataVersionCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readStableDataVersionAttribute", + readThreadNetworkDiagnosticsStableDataVersionAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsLeaderRouterIdCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsLeaderRouterIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readLeaderRouterIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsLeaderRouterIdCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readLeaderRouterIdAttribute", + readThreadNetworkDiagnosticsLeaderRouterIdAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsDetachedRoleCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsDetachedRoleCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readDetachedRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsDetachedRoleCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readDetachedRoleCountAttribute", + readThreadNetworkDiagnosticsDetachedRoleCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsChildRoleCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsChildRoleCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readChildRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsChildRoleCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readChildRoleCountAttribute", + readThreadNetworkDiagnosticsChildRoleCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRouterRoleCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRouterRoleCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRouterRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsRouterRoleCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRouterRoleCountAttribute", + readThreadNetworkDiagnosticsRouterRoleCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsLeaderRoleCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsLeaderRoleCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readLeaderRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsLeaderRoleCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readLeaderRoleCountAttribute", + readThreadNetworkDiagnosticsLeaderRoleCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsAttachAttemptCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsAttachAttemptCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readAttachAttemptCountAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsAttachAttemptCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readAttachAttemptCountAttribute", + readThreadNetworkDiagnosticsAttachAttemptCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsPartitionIdChangeCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readPartitionIdChangeCountAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsPartitionIdChangeCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readPartitionIdChangeCountAttribute", + readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams = + new LinkedHashMap(); + InteractionInfo + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readBetterPartitionAttachAttemptCountAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readBetterPartitionAttachAttemptCountAttribute", + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsParentChangeCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsParentChangeCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readParentChangeCountAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsParentChangeCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readParentChangeCountAttribute", + readThreadNetworkDiagnosticsParentChangeCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxTotalCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxTotalCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxTotalCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxTotalCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxTotalCountAttribute", + readThreadNetworkDiagnosticsTxTotalCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxUnicastCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxUnicastCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxUnicastCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxUnicastCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxUnicastCountAttribute", + readThreadNetworkDiagnosticsTxUnicastCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxBroadcastCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxBroadcastCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxBroadcastCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxBroadcastCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxBroadcastCountAttribute", + readThreadNetworkDiagnosticsTxBroadcastCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxAckRequestedCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxAckRequestedCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxAckRequestedCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxAckRequestedCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxAckRequestedCountAttribute", + readThreadNetworkDiagnosticsTxAckRequestedCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxAckedCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxAckedCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxAckedCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxAckedCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxAckedCountAttribute", + readThreadNetworkDiagnosticsTxAckedCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsTxNoAckRequestedCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxNoAckRequestedCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxNoAckRequestedCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxNoAckRequestedCountAttribute", + readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxDataCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxDataCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxDataCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxDataCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxDataCountAttribute", + readThreadNetworkDiagnosticsTxDataCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxDataPollCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxDataPollCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxDataPollCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxDataPollCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxDataPollCountAttribute", + readThreadNetworkDiagnosticsTxDataPollCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxBeaconCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxBeaconCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxBeaconCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxBeaconCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxBeaconCountAttribute", + readThreadNetworkDiagnosticsTxBeaconCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsTxBeaconRequestCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxBeaconRequestCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxBeaconRequestCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxBeaconRequestCountAttribute", + readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxOtherCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxOtherCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxOtherCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxOtherCountAttribute", + readThreadNetworkDiagnosticsTxOtherCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxRetryCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxRetryCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxRetryCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxRetryCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxRetryCountAttribute", + readThreadNetworkDiagnosticsTxRetryCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams = + new LinkedHashMap(); + InteractionInfo + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxDirectMaxRetryExpiryCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxDirectMaxRetryExpiryCountAttribute", + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams = + new LinkedHashMap(); + InteractionInfo + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxIndirectMaxRetryExpiryCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxIndirectMaxRetryExpiryCountAttribute", + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxErrCcaCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxErrCcaCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxErrCcaCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxErrCcaCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxErrCcaCountAttribute", + readThreadNetworkDiagnosticsTxErrCcaCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsTxErrAbortCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxErrAbortCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxErrAbortCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxErrAbortCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxErrAbortCountAttribute", + readThreadNetworkDiagnosticsTxErrAbortCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsTxErrBusyChannelCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxErrBusyChannelCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxErrBusyChannelCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxErrBusyChannelCountAttribute", + readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxTotalCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxTotalCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxTotalCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxTotalCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxTotalCountAttribute", + readThreadNetworkDiagnosticsRxTotalCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxUnicastCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxUnicastCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxUnicastCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxUnicastCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxUnicastCountAttribute", + readThreadNetworkDiagnosticsRxUnicastCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxBroadcastCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxBroadcastCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxBroadcastCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxBroadcastCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxBroadcastCountAttribute", + readThreadNetworkDiagnosticsRxBroadcastCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxDataCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxDataCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxDataCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxDataCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxDataCountAttribute", + readThreadNetworkDiagnosticsRxDataCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxDataPollCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxDataPollCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxDataPollCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxDataPollCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxDataPollCountAttribute", + readThreadNetworkDiagnosticsRxDataPollCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxBeaconCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxBeaconCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxBeaconCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxBeaconCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxBeaconCountAttribute", + readThreadNetworkDiagnosticsRxBeaconCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsRxBeaconRequestCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxBeaconRequestCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxBeaconRequestCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxBeaconRequestCountAttribute", + readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxOtherCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxOtherCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxOtherCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxOtherCountAttribute", + readThreadNetworkDiagnosticsRxOtherCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsRxAddressFilteredCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxAddressFilteredCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxAddressFilteredCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxAddressFilteredCountAttribute", + readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsRxDestAddrFilteredCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxDestAddrFilteredCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxDestAddrFilteredCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxDestAddrFilteredCountAttribute", + readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxDuplicatedCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxDuplicatedCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxDuplicatedCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxDuplicatedCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxDuplicatedCountAttribute", + readThreadNetworkDiagnosticsRxDuplicatedCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxErrNoFrameCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxErrNoFrameCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxErrNoFrameCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxErrNoFrameCountAttribute", + readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsRxErrUnknownNeighborCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxErrUnknownNeighborCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxErrUnknownNeighborCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxErrUnknownNeighborCountAttribute", + readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxErrInvalidSrcAddrCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxErrInvalidSrcAddrCountAttribute", + readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxErrSecCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxErrSecCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxErrSecCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxErrSecCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxErrSecCountAttribute", + readThreadNetworkDiagnosticsRxErrSecCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxErrFcsCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxErrFcsCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxErrFcsCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxErrFcsCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxErrFcsCountAttribute", + readThreadNetworkDiagnosticsRxErrFcsCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsRxErrOtherCountCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsRxErrOtherCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readRxErrOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsRxErrOtherCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxErrOtherCountAttribute", + readThreadNetworkDiagnosticsRxErrOtherCountAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsActiveTimestampCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsActiveTimestampAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readActiveTimestampAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsActiveTimestampCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readActiveTimestampAttribute", + readThreadNetworkDiagnosticsActiveTimestampAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsPendingTimestampCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsPendingTimestampAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readPendingTimestampAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsPendingTimestampCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readPendingTimestampAttribute", + readThreadNetworkDiagnosticsPendingTimestampAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsDelayCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsDelayAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readDelayAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsDelayCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readDelayAttribute", readThreadNetworkDiagnosticsDelayAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsSecurityPolicyCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsSecurityPolicyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readSecurityPolicyAttribute( + (ChipClusters.ThreadNetworkDiagnosticsCluster.SecurityPolicyAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedSecurityPolicyAttributeCallback(), + readThreadNetworkDiagnosticsSecurityPolicyCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readSecurityPolicyAttribute", + readThreadNetworkDiagnosticsSecurityPolicyAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsChannelMaskCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsChannelMaskAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readChannelMaskAttribute((ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readThreadNetworkDiagnosticsChannelMaskCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readChannelMaskAttribute", + readThreadNetworkDiagnosticsChannelMaskAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams = + new LinkedHashMap(); + InteractionInfo + readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readOperationalDatasetComponentsAttribute( + (ChipClusters.ThreadNetworkDiagnosticsCluster + .OperationalDatasetComponentsAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping.DelegatedOperationalDatasetComponentsAttributeCallback(), + readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readOperationalDatasetComponentsAttribute", + readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeInteractionInfo); + Map + readThreadNetworkDiagnosticsActiveNetworkFaultsListCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readActiveNetworkFaultsListAttribute( + (ChipClusters.ThreadNetworkDiagnosticsCluster + .ActiveNetworkFaultsListAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedActiveNetworkFaultsListAttributeCallback(), + readThreadNetworkDiagnosticsActiveNetworkFaultsListCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readActiveNetworkFaultsListAttribute", + readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeInteractionInfo); + Map readThreadNetworkDiagnosticsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readThreadNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsClusterRevisionCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readThreadNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("threadNetworkDiagnostics", readThreadNetworkDiagnosticsInteractionInfo); + Map readWakeOnLanInteractionInfo = new LinkedHashMap<>(); + Map readWakeOnLanWakeOnLanMacAddressCommandParams = + new LinkedHashMap(); + InteractionInfo readWakeOnLanWakeOnLanMacAddressAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WakeOnLanCluster) cluster) + .readWakeOnLanMacAddressAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readWakeOnLanWakeOnLanMacAddressCommandParams); + readWakeOnLanInteractionInfo.put( + "readWakeOnLanMacAddressAttribute", + readWakeOnLanWakeOnLanMacAddressAttributeInteractionInfo); + Map readWakeOnLanClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readWakeOnLanClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WakeOnLanCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWakeOnLanClusterRevisionCommandParams); + readWakeOnLanInteractionInfo.put( + "readClusterRevisionAttribute", readWakeOnLanClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("wakeOnLan", readWakeOnLanInteractionInfo); + Map readWiFiNetworkDiagnosticsInteractionInfo = new LinkedHashMap<>(); + Map readWiFiNetworkDiagnosticsBssidCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsBssidAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readBssidAttribute((ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), + readWiFiNetworkDiagnosticsBssidCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readBssidAttribute", readWiFiNetworkDiagnosticsBssidAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsSecurityTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsSecurityTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readSecurityTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWiFiNetworkDiagnosticsSecurityTypeCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readSecurityTypeAttribute", + readWiFiNetworkDiagnosticsSecurityTypeAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsWiFiVersionCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsWiFiVersionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readWiFiVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWiFiNetworkDiagnosticsWiFiVersionCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readWiFiVersionAttribute", readWiFiNetworkDiagnosticsWiFiVersionAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsChannelNumberCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsChannelNumberAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readChannelNumberAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWiFiNetworkDiagnosticsChannelNumberCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readChannelNumberAttribute", + readWiFiNetworkDiagnosticsChannelNumberAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsRssiCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsRssiAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readRssiAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWiFiNetworkDiagnosticsRssiCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readRssiAttribute", readWiFiNetworkDiagnosticsRssiAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsBeaconLostCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsBeaconLostCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readBeaconLostCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsBeaconLostCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readBeaconLostCountAttribute", + readWiFiNetworkDiagnosticsBeaconLostCountAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsBeaconRxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsBeaconRxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readBeaconRxCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsBeaconRxCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readBeaconRxCountAttribute", + readWiFiNetworkDiagnosticsBeaconRxCountAttributeInteractionInfo); + Map + readWiFiNetworkDiagnosticsPacketMulticastRxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readPacketMulticastRxCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsPacketMulticastRxCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readPacketMulticastRxCountAttribute", + readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeInteractionInfo); + Map + readWiFiNetworkDiagnosticsPacketMulticastTxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readPacketMulticastTxCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsPacketMulticastTxCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readPacketMulticastTxCountAttribute", + readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsPacketUnicastRxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readPacketUnicastRxCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsPacketUnicastRxCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readPacketUnicastRxCountAttribute", + readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsPacketUnicastTxCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readPacketUnicastTxCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsPacketUnicastTxCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readPacketUnicastTxCountAttribute", + readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsCurrentMaxRateCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsCurrentMaxRateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readCurrentMaxRateAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsCurrentMaxRateCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readCurrentMaxRateAttribute", + readWiFiNetworkDiagnosticsCurrentMaxRateAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsOverrunCountCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsOverrunCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkDiagnosticsOverrunCountCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readOverrunCountAttribute", + readWiFiNetworkDiagnosticsOverrunCountAttributeInteractionInfo); + Map readWiFiNetworkDiagnosticsClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readWiFiNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWiFiNetworkDiagnosticsClusterRevisionCommandParams); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readWiFiNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("wiFiNetworkDiagnostics", readWiFiNetworkDiagnosticsInteractionInfo); + Map readWindowCoveringInteractionInfo = new LinkedHashMap<>(); + Map readWindowCoveringTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringTypeCommandParams); + readWindowCoveringInteractionInfo.put( + "readTypeAttribute", readWindowCoveringTypeAttributeInteractionInfo); + Map readWindowCoveringCurrentPositionLiftCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringCurrentPositionLiftAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readCurrentPositionLiftAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringCurrentPositionLiftCommandParams); + readWindowCoveringInteractionInfo.put( + "readCurrentPositionLiftAttribute", + readWindowCoveringCurrentPositionLiftAttributeInteractionInfo); + Map readWindowCoveringCurrentPositionTiltCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringCurrentPositionTiltAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readCurrentPositionTiltAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringCurrentPositionTiltCommandParams); + readWindowCoveringInteractionInfo.put( + "readCurrentPositionTiltAttribute", + readWindowCoveringCurrentPositionTiltAttributeInteractionInfo); + Map readWindowCoveringConfigStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringConfigStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readConfigStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringConfigStatusCommandParams); + readWindowCoveringInteractionInfo.put( + "readConfigStatusAttribute", readWindowCoveringConfigStatusAttributeInteractionInfo); + Map readWindowCoveringCurrentPositionLiftPercentageCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringCurrentPositionLiftPercentageAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readCurrentPositionLiftPercentageAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringCurrentPositionLiftPercentageCommandParams); + readWindowCoveringInteractionInfo.put( + "readCurrentPositionLiftPercentageAttribute", + readWindowCoveringCurrentPositionLiftPercentageAttributeInteractionInfo); + Map readWindowCoveringCurrentPositionTiltPercentageCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringCurrentPositionTiltPercentageAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readCurrentPositionTiltPercentageAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringCurrentPositionTiltPercentageCommandParams); + readWindowCoveringInteractionInfo.put( + "readCurrentPositionTiltPercentageAttribute", + readWindowCoveringCurrentPositionTiltPercentageAttributeInteractionInfo); + Map readWindowCoveringOperationalStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringOperationalStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readOperationalStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringOperationalStatusCommandParams); + readWindowCoveringInteractionInfo.put( + "readOperationalStatusAttribute", + readWindowCoveringOperationalStatusAttributeInteractionInfo); + Map + readWindowCoveringTargetPositionLiftPercent100thsCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringTargetPositionLiftPercent100thsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readTargetPositionLiftPercent100thsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringTargetPositionLiftPercent100thsCommandParams); + readWindowCoveringInteractionInfo.put( + "readTargetPositionLiftPercent100thsAttribute", + readWindowCoveringTargetPositionLiftPercent100thsAttributeInteractionInfo); + Map + readWindowCoveringTargetPositionTiltPercent100thsCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringTargetPositionTiltPercent100thsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readTargetPositionTiltPercent100thsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringTargetPositionTiltPercent100thsCommandParams); + readWindowCoveringInteractionInfo.put( + "readTargetPositionTiltPercent100thsAttribute", + readWindowCoveringTargetPositionTiltPercent100thsAttributeInteractionInfo); + Map readWindowCoveringEndProductTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringEndProductTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readEndProductTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringEndProductTypeCommandParams); + readWindowCoveringInteractionInfo.put( + "readEndProductTypeAttribute", readWindowCoveringEndProductTypeAttributeInteractionInfo); + Map + readWindowCoveringCurrentPositionLiftPercent100thsCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringCurrentPositionLiftPercent100thsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readCurrentPositionLiftPercent100thsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringCurrentPositionLiftPercent100thsCommandParams); + readWindowCoveringInteractionInfo.put( + "readCurrentPositionLiftPercent100thsAttribute", + readWindowCoveringCurrentPositionLiftPercent100thsAttributeInteractionInfo); + Map + readWindowCoveringCurrentPositionTiltPercent100thsCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringCurrentPositionTiltPercent100thsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readCurrentPositionTiltPercent100thsAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringCurrentPositionTiltPercent100thsCommandParams); + readWindowCoveringInteractionInfo.put( + "readCurrentPositionTiltPercent100thsAttribute", + readWindowCoveringCurrentPositionTiltPercent100thsAttributeInteractionInfo); + Map readWindowCoveringInstalledOpenLimitLiftCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringInstalledOpenLimitLiftAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readInstalledOpenLimitLiftAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringInstalledOpenLimitLiftCommandParams); + readWindowCoveringInteractionInfo.put( + "readInstalledOpenLimitLiftAttribute", + readWindowCoveringInstalledOpenLimitLiftAttributeInteractionInfo); + Map readWindowCoveringInstalledClosedLimitLiftCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringInstalledClosedLimitLiftAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readInstalledClosedLimitLiftAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringInstalledClosedLimitLiftCommandParams); + readWindowCoveringInteractionInfo.put( + "readInstalledClosedLimitLiftAttribute", + readWindowCoveringInstalledClosedLimitLiftAttributeInteractionInfo); + Map readWindowCoveringInstalledOpenLimitTiltCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringInstalledOpenLimitTiltAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readInstalledOpenLimitTiltAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringInstalledOpenLimitTiltCommandParams); + readWindowCoveringInteractionInfo.put( + "readInstalledOpenLimitTiltAttribute", + readWindowCoveringInstalledOpenLimitTiltAttributeInteractionInfo); + Map readWindowCoveringInstalledClosedLimitTiltCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringInstalledClosedLimitTiltAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readInstalledClosedLimitTiltAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringInstalledClosedLimitTiltCommandParams); + readWindowCoveringInteractionInfo.put( + "readInstalledClosedLimitTiltAttribute", + readWindowCoveringInstalledClosedLimitTiltAttributeInteractionInfo); + Map readWindowCoveringModeCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringModeCommandParams); + readWindowCoveringInteractionInfo.put( + "readModeAttribute", readWindowCoveringModeAttributeInteractionInfo); + Map readWindowCoveringSafetyStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringSafetyStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readSafetyStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringSafetyStatusCommandParams); + readWindowCoveringInteractionInfo.put( + "readSafetyStatusAttribute", readWindowCoveringSafetyStatusAttributeInteractionInfo); + Map readWindowCoveringFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWindowCoveringFeatureMapCommandParams); + readWindowCoveringInteractionInfo.put( + "readFeatureMapAttribute", readWindowCoveringFeatureMapAttributeInteractionInfo); + Map readWindowCoveringClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readWindowCoveringClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWindowCoveringClusterRevisionCommandParams); + readWindowCoveringInteractionInfo.put( + "readClusterRevisionAttribute", readWindowCoveringClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("windowCovering", readWindowCoveringInteractionInfo); + return readAttributeMap; + } +} diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java new file mode 100644 index 00000000000000..df210803374a28 --- /dev/null +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -0,0 +1,1684 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +package chip.devicecontroller; + +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.InteractionInfo; +import chip.devicecontroller.ChipClusters.DefaultClusterCallback; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ClusterWriteMapping { + public Map> getWriteAttributeMap() { + Map> writeAttributeMap = new HashMap<>(); + Map writeAccountLoginInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("accountLogin", writeAccountLoginInteractionInfo); + Map writeAdministratorCommissioningInteractionInfo = + new LinkedHashMap<>(); + writeAttributeMap.put( + "administratorCommissioning", writeAdministratorCommissioningInteractionInfo); + Map writeApplicationBasicInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("applicationBasic", writeApplicationBasicInteractionInfo); + Map writeApplicationLauncherInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("applicationLauncher", writeApplicationLauncherInteractionInfo); + Map writeAudioOutputInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("audioOutput", writeAudioOutputInteractionInfo); + Map writeBarrierControlInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("barrierControl", writeBarrierControlInteractionInfo); + Map writeBasicInteractionInfo = new LinkedHashMap<>(); + Map writeBasicUserLabelCommandParams = + new LinkedHashMap(); + CommandParameterInfo basicuserLabelCommandParameterInfo = + new CommandParameterInfo("value", String.class); + writeBasicUserLabelCommandParams.put("value", basicuserLabelCommandParameterInfo); + InteractionInfo writeBasicUserLabelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .writeUserLabelAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBasicUserLabelCommandParams); + writeBasicInteractionInfo.put( + "writeUserLabelAttribute", writeBasicUserLabelAttributeInteractionInfo); + Map writeBasicLocationCommandParams = + new LinkedHashMap(); + CommandParameterInfo basiclocationCommandParameterInfo = + new CommandParameterInfo("value", String.class); + writeBasicLocationCommandParams.put("value", basiclocationCommandParameterInfo); + InteractionInfo writeBasicLocationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .writeLocationAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBasicLocationCommandParams); + writeBasicInteractionInfo.put( + "writeLocationAttribute", writeBasicLocationAttributeInteractionInfo); + Map writeBasicLocalConfigDisabledCommandParams = + new LinkedHashMap(); + CommandParameterInfo basiclocalConfigDisabledCommandParameterInfo = + new CommandParameterInfo("value", boolean.class); + writeBasicLocalConfigDisabledCommandParams.put( + "value", basiclocalConfigDisabledCommandParameterInfo); + InteractionInfo writeBasicLocalConfigDisabledAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BasicCluster) cluster) + .writeLocalConfigDisabledAttribute( + (DefaultClusterCallback) callback, (Boolean) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBasicLocalConfigDisabledCommandParams); + writeBasicInteractionInfo.put( + "writeLocalConfigDisabledAttribute", writeBasicLocalConfigDisabledAttributeInteractionInfo); + writeAttributeMap.put("basic", writeBasicInteractionInfo); + Map writeBinaryInputBasicInteractionInfo = new LinkedHashMap<>(); + Map writeBinaryInputBasicOutOfServiceCommandParams = + new LinkedHashMap(); + CommandParameterInfo binaryInputBasicoutOfServiceCommandParameterInfo = + new CommandParameterInfo("value", boolean.class); + writeBinaryInputBasicOutOfServiceCommandParams.put( + "value", binaryInputBasicoutOfServiceCommandParameterInfo); + InteractionInfo writeBinaryInputBasicOutOfServiceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BinaryInputBasicCluster) cluster) + .writeOutOfServiceAttribute( + (DefaultClusterCallback) callback, (Boolean) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBinaryInputBasicOutOfServiceCommandParams); + writeBinaryInputBasicInteractionInfo.put( + "writeOutOfServiceAttribute", writeBinaryInputBasicOutOfServiceAttributeInteractionInfo); + Map writeBinaryInputBasicPresentValueCommandParams = + new LinkedHashMap(); + CommandParameterInfo binaryInputBasicpresentValueCommandParameterInfo = + new CommandParameterInfo("value", boolean.class); + writeBinaryInputBasicPresentValueCommandParams.put( + "value", binaryInputBasicpresentValueCommandParameterInfo); + InteractionInfo writeBinaryInputBasicPresentValueAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BinaryInputBasicCluster) cluster) + .writePresentValueAttribute( + (DefaultClusterCallback) callback, (Boolean) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBinaryInputBasicPresentValueCommandParams); + writeBinaryInputBasicInteractionInfo.put( + "writePresentValueAttribute", writeBinaryInputBasicPresentValueAttributeInteractionInfo); + writeAttributeMap.put("binaryInputBasic", writeBinaryInputBasicInteractionInfo); + Map writeBindingInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("binding", writeBindingInteractionInfo); + Map writeBooleanStateInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("booleanState", writeBooleanStateInteractionInfo); + Map writeBridgedActionsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("bridgedActions", writeBridgedActionsInteractionInfo); + Map writeBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); + Map writeBridgedDeviceBasicUserLabelCommandParams = + new LinkedHashMap(); + CommandParameterInfo bridgedDeviceBasicuserLabelCommandParameterInfo = + new CommandParameterInfo("value", String.class); + writeBridgedDeviceBasicUserLabelCommandParams.put( + "value", bridgedDeviceBasicuserLabelCommandParameterInfo); + InteractionInfo writeBridgedDeviceBasicUserLabelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicCluster) cluster) + .writeUserLabelAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBridgedDeviceBasicUserLabelCommandParams); + writeBridgedDeviceBasicInteractionInfo.put( + "writeUserLabelAttribute", writeBridgedDeviceBasicUserLabelAttributeInteractionInfo); + writeAttributeMap.put("bridgedDeviceBasic", writeBridgedDeviceBasicInteractionInfo); + Map writeColorControlInteractionInfo = new LinkedHashMap<>(); + Map writeColorControlColorControlOptionsCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorControlOptionsCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorControlOptionsCommandParams.put( + "value", colorControlcolorControlOptionsCommandParameterInfo); + InteractionInfo writeColorControlColorControlOptionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorControlOptionsAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorControlOptionsCommandParams); + writeColorControlInteractionInfo.put( + "writeColorControlOptionsAttribute", + writeColorControlColorControlOptionsAttributeInteractionInfo); + Map writeColorControlWhitePointXCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlwhitePointXCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlWhitePointXCommandParams.put( + "value", colorControlwhitePointXCommandParameterInfo); + InteractionInfo writeColorControlWhitePointXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeWhitePointXAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlWhitePointXCommandParams); + writeColorControlInteractionInfo.put( + "writeWhitePointXAttribute", writeColorControlWhitePointXAttributeInteractionInfo); + Map writeColorControlWhitePointYCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlwhitePointYCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlWhitePointYCommandParams.put( + "value", colorControlwhitePointYCommandParameterInfo); + InteractionInfo writeColorControlWhitePointYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeWhitePointYAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlWhitePointYCommandParams); + writeColorControlInteractionInfo.put( + "writeWhitePointYAttribute", writeColorControlWhitePointYAttributeInteractionInfo); + Map writeColorControlColorPointRXCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointRXCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointRXCommandParams.put( + "value", colorControlcolorPointRXCommandParameterInfo); + InteractionInfo writeColorControlColorPointRXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointRXAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointRXCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointRXAttribute", writeColorControlColorPointRXAttributeInteractionInfo); + Map writeColorControlColorPointRYCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointRYCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointRYCommandParams.put( + "value", colorControlcolorPointRYCommandParameterInfo); + InteractionInfo writeColorControlColorPointRYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointRYAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointRYCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointRYAttribute", writeColorControlColorPointRYAttributeInteractionInfo); + Map writeColorControlColorPointRIntensityCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointRIntensityCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointRIntensityCommandParams.put( + "value", colorControlcolorPointRIntensityCommandParameterInfo); + InteractionInfo writeColorControlColorPointRIntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointRIntensityAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointRIntensityCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointRIntensityAttribute", + writeColorControlColorPointRIntensityAttributeInteractionInfo); + Map writeColorControlColorPointGXCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointGXCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointGXCommandParams.put( + "value", colorControlcolorPointGXCommandParameterInfo); + InteractionInfo writeColorControlColorPointGXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointGXAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointGXCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointGXAttribute", writeColorControlColorPointGXAttributeInteractionInfo); + Map writeColorControlColorPointGYCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointGYCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointGYCommandParams.put( + "value", colorControlcolorPointGYCommandParameterInfo); + InteractionInfo writeColorControlColorPointGYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointGYAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointGYCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointGYAttribute", writeColorControlColorPointGYAttributeInteractionInfo); + Map writeColorControlColorPointGIntensityCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointGIntensityCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointGIntensityCommandParams.put( + "value", colorControlcolorPointGIntensityCommandParameterInfo); + InteractionInfo writeColorControlColorPointGIntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointGIntensityAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointGIntensityCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointGIntensityAttribute", + writeColorControlColorPointGIntensityAttributeInteractionInfo); + Map writeColorControlColorPointBXCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointBXCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointBXCommandParams.put( + "value", colorControlcolorPointBXCommandParameterInfo); + InteractionInfo writeColorControlColorPointBXAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointBXAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointBXCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointBXAttribute", writeColorControlColorPointBXAttributeInteractionInfo); + Map writeColorControlColorPointBYCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointBYCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointBYCommandParams.put( + "value", colorControlcolorPointBYCommandParameterInfo); + InteractionInfo writeColorControlColorPointBYAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointBYAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointBYCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointBYAttribute", writeColorControlColorPointBYAttributeInteractionInfo); + Map writeColorControlColorPointBIntensityCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlcolorPointBIntensityCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlColorPointBIntensityCommandParams.put( + "value", colorControlcolorPointBIntensityCommandParameterInfo); + InteractionInfo writeColorControlColorPointBIntensityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeColorPointBIntensityAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlColorPointBIntensityCommandParams); + writeColorControlInteractionInfo.put( + "writeColorPointBIntensityAttribute", + writeColorControlColorPointBIntensityAttributeInteractionInfo); + Map writeColorControlStartUpColorTemperatureMiredsCommandParams = + new LinkedHashMap(); + CommandParameterInfo colorControlstartUpColorTemperatureMiredsCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeColorControlStartUpColorTemperatureMiredsCommandParams.put( + "value", colorControlstartUpColorTemperatureMiredsCommandParameterInfo); + InteractionInfo writeColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .writeStartUpColorTemperatureMiredsAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeColorControlStartUpColorTemperatureMiredsCommandParams); + writeColorControlInteractionInfo.put( + "writeStartUpColorTemperatureMiredsAttribute", + writeColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo); + writeAttributeMap.put("colorControl", writeColorControlInteractionInfo); + Map writeContentLauncherInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("contentLauncher", writeContentLauncherInteractionInfo); + Map writeDescriptorInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("descriptor", writeDescriptorInteractionInfo); + Map writeDiagnosticLogsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("diagnosticLogs", writeDiagnosticLogsInteractionInfo); + Map writeDoorLockInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("doorLock", writeDoorLockInteractionInfo); + Map writeElectricalMeasurementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("electricalMeasurement", writeElectricalMeasurementInteractionInfo); + Map writeEthernetNetworkDiagnosticsInteractionInfo = + new LinkedHashMap<>(); + writeAttributeMap.put( + "ethernetNetworkDiagnostics", writeEthernetNetworkDiagnosticsInteractionInfo); + Map writeFixedLabelInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("fixedLabel", writeFixedLabelInteractionInfo); + Map writeFlowMeasurementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("flowMeasurement", writeFlowMeasurementInteractionInfo); + Map writeGeneralCommissioningInteractionInfo = new LinkedHashMap<>(); + Map writeGeneralCommissioningBreadcrumbCommandParams = + new LinkedHashMap(); + CommandParameterInfo generalCommissioningbreadcrumbCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeGeneralCommissioningBreadcrumbCommandParams.put( + "value", generalCommissioningbreadcrumbCommandParameterInfo); + InteractionInfo writeGeneralCommissioningBreadcrumbAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralCommissioningCluster) cluster) + .writeBreadcrumbAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeGeneralCommissioningBreadcrumbCommandParams); + writeGeneralCommissioningInteractionInfo.put( + "writeBreadcrumbAttribute", writeGeneralCommissioningBreadcrumbAttributeInteractionInfo); + writeAttributeMap.put("generalCommissioning", writeGeneralCommissioningInteractionInfo); + Map writeGeneralDiagnosticsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("generalDiagnostics", writeGeneralDiagnosticsInteractionInfo); + Map writeGroupKeyManagementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("groupKeyManagement", writeGroupKeyManagementInteractionInfo); + Map writeGroupsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("groups", writeGroupsInteractionInfo); + Map writeIdentifyInteractionInfo = new LinkedHashMap<>(); + Map writeIdentifyIdentifyTimeCommandParams = + new LinkedHashMap(); + CommandParameterInfo identifyidentifyTimeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeIdentifyIdentifyTimeCommandParams.put("value", identifyidentifyTimeCommandParameterInfo); + InteractionInfo writeIdentifyIdentifyTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IdentifyCluster) cluster) + .writeIdentifyTimeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeIdentifyIdentifyTimeCommandParams); + writeIdentifyInteractionInfo.put( + "writeIdentifyTimeAttribute", writeIdentifyIdentifyTimeAttributeInteractionInfo); + writeAttributeMap.put("identify", writeIdentifyInteractionInfo); + Map writeIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("illuminanceMeasurement", writeIlluminanceMeasurementInteractionInfo); + Map writeKeypadInputInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("keypadInput", writeKeypadInputInteractionInfo); + Map writeLevelControlInteractionInfo = new LinkedHashMap<>(); + Map writeLevelControlOptionsCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControloptionsCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlOptionsCommandParams.put("value", levelControloptionsCommandParameterInfo); + InteractionInfo writeLevelControlOptionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeOptionsAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlOptionsCommandParams); + writeLevelControlInteractionInfo.put( + "writeOptionsAttribute", writeLevelControlOptionsAttributeInteractionInfo); + Map writeLevelControlOnOffTransitionTimeCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControlonOffTransitionTimeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlOnOffTransitionTimeCommandParams.put( + "value", levelControlonOffTransitionTimeCommandParameterInfo); + InteractionInfo writeLevelControlOnOffTransitionTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeOnOffTransitionTimeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlOnOffTransitionTimeCommandParams); + writeLevelControlInteractionInfo.put( + "writeOnOffTransitionTimeAttribute", + writeLevelControlOnOffTransitionTimeAttributeInteractionInfo); + Map writeLevelControlOnLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControlonLevelCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlOnLevelCommandParams.put("value", levelControlonLevelCommandParameterInfo); + InteractionInfo writeLevelControlOnLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeOnLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlOnLevelCommandParams); + writeLevelControlInteractionInfo.put( + "writeOnLevelAttribute", writeLevelControlOnLevelAttributeInteractionInfo); + Map writeLevelControlOnTransitionTimeCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControlonTransitionTimeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlOnTransitionTimeCommandParams.put( + "value", levelControlonTransitionTimeCommandParameterInfo); + InteractionInfo writeLevelControlOnTransitionTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeOnTransitionTimeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlOnTransitionTimeCommandParams); + writeLevelControlInteractionInfo.put( + "writeOnTransitionTimeAttribute", + writeLevelControlOnTransitionTimeAttributeInteractionInfo); + Map writeLevelControlOffTransitionTimeCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControloffTransitionTimeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlOffTransitionTimeCommandParams.put( + "value", levelControloffTransitionTimeCommandParameterInfo); + InteractionInfo writeLevelControlOffTransitionTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeOffTransitionTimeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlOffTransitionTimeCommandParams); + writeLevelControlInteractionInfo.put( + "writeOffTransitionTimeAttribute", + writeLevelControlOffTransitionTimeAttributeInteractionInfo); + Map writeLevelControlDefaultMoveRateCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControldefaultMoveRateCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlDefaultMoveRateCommandParams.put( + "value", levelControldefaultMoveRateCommandParameterInfo); + InteractionInfo writeLevelControlDefaultMoveRateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeDefaultMoveRateAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlDefaultMoveRateCommandParams); + writeLevelControlInteractionInfo.put( + "writeDefaultMoveRateAttribute", writeLevelControlDefaultMoveRateAttributeInteractionInfo); + Map writeLevelControlStartUpCurrentLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo levelControlstartUpCurrentLevelCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeLevelControlStartUpCurrentLevelCommandParams.put( + "value", levelControlstartUpCurrentLevelCommandParameterInfo); + InteractionInfo writeLevelControlStartUpCurrentLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.LevelControlCluster) cluster) + .writeStartUpCurrentLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeLevelControlStartUpCurrentLevelCommandParams); + writeLevelControlInteractionInfo.put( + "writeStartUpCurrentLevelAttribute", + writeLevelControlStartUpCurrentLevelAttributeInteractionInfo); + writeAttributeMap.put("levelControl", writeLevelControlInteractionInfo); + Map writeLowPowerInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("lowPower", writeLowPowerInteractionInfo); + Map writeMediaInputInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("mediaInput", writeMediaInputInteractionInfo); + Map writeMediaPlaybackInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("mediaPlayback", writeMediaPlaybackInteractionInfo); + Map writeModeSelectInteractionInfo = new LinkedHashMap<>(); + Map writeModeSelectOnModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo modeSelectonModeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeModeSelectOnModeCommandParams.put("value", modeSelectonModeCommandParameterInfo); + InteractionInfo writeModeSelectOnModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .writeOnModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeModeSelectOnModeCommandParams); + writeModeSelectInteractionInfo.put( + "writeOnModeAttribute", writeModeSelectOnModeAttributeInteractionInfo); + writeAttributeMap.put("modeSelect", writeModeSelectInteractionInfo); + Map writeNetworkCommissioningInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("networkCommissioning", writeNetworkCommissioningInteractionInfo); + Map writeOtaSoftwareUpdateProviderInteractionInfo = + new LinkedHashMap<>(); + writeAttributeMap.put( + "otaSoftwareUpdateProvider", writeOtaSoftwareUpdateProviderInteractionInfo); + Map writeOtaSoftwareUpdateRequestorInteractionInfo = + new LinkedHashMap<>(); + Map + writeOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams = + new LinkedHashMap(); + CommandParameterInfo otaSoftwareUpdateRequestordefaultOtaProviderCommandParameterInfo = + new CommandParameterInfo("value", byte[].class); + writeOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams.put( + "value", otaSoftwareUpdateRequestordefaultOtaProviderCommandParameterInfo); + InteractionInfo writeOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) + .writeDefaultOtaProviderAttribute( + (DefaultClusterCallback) callback, (byte[]) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams); + writeOtaSoftwareUpdateRequestorInteractionInfo.put( + "writeDefaultOtaProviderAttribute", + writeOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo); + writeAttributeMap.put( + "otaSoftwareUpdateRequestor", writeOtaSoftwareUpdateRequestorInteractionInfo); + Map writeOccupancySensingInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("occupancySensing", writeOccupancySensingInteractionInfo); + Map writeOnOffInteractionInfo = new LinkedHashMap<>(); + Map writeOnOffOnTimeCommandParams = + new LinkedHashMap(); + CommandParameterInfo onOffonTimeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeOnOffOnTimeCommandParams.put("value", onOffonTimeCommandParameterInfo); + InteractionInfo writeOnOffOnTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .writeOnTimeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeOnOffOnTimeCommandParams); + writeOnOffInteractionInfo.put("writeOnTimeAttribute", writeOnOffOnTimeAttributeInteractionInfo); + Map writeOnOffOffWaitTimeCommandParams = + new LinkedHashMap(); + CommandParameterInfo onOffoffWaitTimeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeOnOffOffWaitTimeCommandParams.put("value", onOffoffWaitTimeCommandParameterInfo); + InteractionInfo writeOnOffOffWaitTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .writeOffWaitTimeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeOnOffOffWaitTimeCommandParams); + writeOnOffInteractionInfo.put( + "writeOffWaitTimeAttribute", writeOnOffOffWaitTimeAttributeInteractionInfo); + Map writeOnOffStartUpOnOffCommandParams = + new LinkedHashMap(); + CommandParameterInfo onOffstartUpOnOffCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeOnOffStartUpOnOffCommandParams.put("value", onOffstartUpOnOffCommandParameterInfo); + InteractionInfo writeOnOffStartUpOnOffAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffCluster) cluster) + .writeStartUpOnOffAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeOnOffStartUpOnOffCommandParams); + writeOnOffInteractionInfo.put( + "writeStartUpOnOffAttribute", writeOnOffStartUpOnOffAttributeInteractionInfo); + writeAttributeMap.put("onOff", writeOnOffInteractionInfo); + Map writeOnOffSwitchConfigurationInteractionInfo = + new LinkedHashMap<>(); + Map writeOnOffSwitchConfigurationSwitchActionsCommandParams = + new LinkedHashMap(); + CommandParameterInfo onOffSwitchConfigurationswitchActionsCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeOnOffSwitchConfigurationSwitchActionsCommandParams.put( + "value", onOffSwitchConfigurationswitchActionsCommandParameterInfo); + InteractionInfo writeOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) + .writeSwitchActionsAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeOnOffSwitchConfigurationSwitchActionsCommandParams); + writeOnOffSwitchConfigurationInteractionInfo.put( + "writeSwitchActionsAttribute", + writeOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo); + writeAttributeMap.put("onOffSwitchConfiguration", writeOnOffSwitchConfigurationInteractionInfo); + Map writeOperationalCredentialsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("operationalCredentials", writeOperationalCredentialsInteractionInfo); + Map writePowerSourceInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("powerSource", writePowerSourceInteractionInfo); + Map writePressureMeasurementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("pressureMeasurement", writePressureMeasurementInteractionInfo); + Map writePumpConfigurationAndControlInteractionInfo = + new LinkedHashMap<>(); + Map writePumpConfigurationAndControlOperationModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo pumpConfigurationAndControloperationModeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writePumpConfigurationAndControlOperationModeCommandParams.put( + "value", pumpConfigurationAndControloperationModeCommandParameterInfo); + InteractionInfo writePumpConfigurationAndControlOperationModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .writeOperationModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writePumpConfigurationAndControlOperationModeCommandParams); + writePumpConfigurationAndControlInteractionInfo.put( + "writeOperationModeAttribute", + writePumpConfigurationAndControlOperationModeAttributeInteractionInfo); + Map writePumpConfigurationAndControlControlModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo pumpConfigurationAndControlcontrolModeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writePumpConfigurationAndControlControlModeCommandParams.put( + "value", pumpConfigurationAndControlcontrolModeCommandParameterInfo); + InteractionInfo writePumpConfigurationAndControlControlModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PumpConfigurationAndControlCluster) cluster) + .writeControlModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writePumpConfigurationAndControlControlModeCommandParams); + writePumpConfigurationAndControlInteractionInfo.put( + "writeControlModeAttribute", + writePumpConfigurationAndControlControlModeAttributeInteractionInfo); + writeAttributeMap.put( + "pumpConfigurationAndControl", writePumpConfigurationAndControlInteractionInfo); + Map writeRelativeHumidityMeasurementInteractionInfo = + new LinkedHashMap<>(); + writeAttributeMap.put( + "relativeHumidityMeasurement", writeRelativeHumidityMeasurementInteractionInfo); + Map writeScenesInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("scenes", writeScenesInteractionInfo); + Map writeSoftwareDiagnosticsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("softwareDiagnostics", writeSoftwareDiagnosticsInteractionInfo); + Map writeSwitchInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("switch", writeSwitchInteractionInfo); + Map writeTvChannelInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("tvChannel", writeTvChannelInteractionInfo); + Map writeTargetNavigatorInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("targetNavigator", writeTargetNavigatorInteractionInfo); + Map writeTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("temperatureMeasurement", writeTemperatureMeasurementInteractionInfo); + Map writeTestClusterInteractionInfo = new LinkedHashMap<>(); + Map writeTestClusterBooleanCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterbooleanCommandParameterInfo = + new CommandParameterInfo("value", boolean.class); + writeTestClusterBooleanCommandParams.put("value", testClusterbooleanCommandParameterInfo); + InteractionInfo writeTestClusterBooleanAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeBooleanAttribute( + (DefaultClusterCallback) callback, (Boolean) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterBooleanCommandParams); + writeTestClusterInteractionInfo.put( + "writeBooleanAttribute", writeTestClusterBooleanAttributeInteractionInfo); + Map writeTestClusterBitmap8CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterbitmap8CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterBitmap8CommandParams.put("value", testClusterbitmap8CommandParameterInfo); + InteractionInfo writeTestClusterBitmap8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeBitmap8Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterBitmap8CommandParams); + writeTestClusterInteractionInfo.put( + "writeBitmap8Attribute", writeTestClusterBitmap8AttributeInteractionInfo); + Map writeTestClusterBitmap16CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterbitmap16CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterBitmap16CommandParams.put("value", testClusterbitmap16CommandParameterInfo); + InteractionInfo writeTestClusterBitmap16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeBitmap16Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterBitmap16CommandParams); + writeTestClusterInteractionInfo.put( + "writeBitmap16Attribute", writeTestClusterBitmap16AttributeInteractionInfo); + Map writeTestClusterBitmap32CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterbitmap32CommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterBitmap32CommandParams.put("value", testClusterbitmap32CommandParameterInfo); + InteractionInfo writeTestClusterBitmap32AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeBitmap32Attribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterBitmap32CommandParams); + writeTestClusterInteractionInfo.put( + "writeBitmap32Attribute", writeTestClusterBitmap32AttributeInteractionInfo); + Map writeTestClusterBitmap64CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterbitmap64CommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterBitmap64CommandParams.put("value", testClusterbitmap64CommandParameterInfo); + InteractionInfo writeTestClusterBitmap64AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeBitmap64Attribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterBitmap64CommandParams); + writeTestClusterInteractionInfo.put( + "writeBitmap64Attribute", writeTestClusterBitmap64AttributeInteractionInfo); + Map writeTestClusterInt8uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint8uCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterInt8uCommandParams.put("value", testClusterint8uCommandParameterInfo); + InteractionInfo writeTestClusterInt8uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt8uAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt8uCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt8uAttribute", writeTestClusterInt8uAttributeInteractionInfo); + Map writeTestClusterInt16uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint16uCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterInt16uCommandParams.put("value", testClusterint16uCommandParameterInfo); + InteractionInfo writeTestClusterInt16uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt16uAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt16uCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt16uAttribute", writeTestClusterInt16uAttributeInteractionInfo); + Map writeTestClusterInt32uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint32uCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterInt32uCommandParams.put("value", testClusterint32uCommandParameterInfo); + InteractionInfo writeTestClusterInt32uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt32uAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt32uCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt32uAttribute", writeTestClusterInt32uAttributeInteractionInfo); + Map writeTestClusterInt64uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint64uCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterInt64uCommandParams.put("value", testClusterint64uCommandParameterInfo); + InteractionInfo writeTestClusterInt64uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt64uAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt64uCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt64uAttribute", writeTestClusterInt64uAttributeInteractionInfo); + Map writeTestClusterInt8sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint8sCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterInt8sCommandParams.put("value", testClusterint8sCommandParameterInfo); + InteractionInfo writeTestClusterInt8sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt8sAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt8sCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt8sAttribute", writeTestClusterInt8sAttributeInteractionInfo); + Map writeTestClusterInt16sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint16sCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterInt16sCommandParams.put("value", testClusterint16sCommandParameterInfo); + InteractionInfo writeTestClusterInt16sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt16sAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt16sCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt16sAttribute", writeTestClusterInt16sAttributeInteractionInfo); + Map writeTestClusterInt32sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint32sCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterInt32sCommandParams.put("value", testClusterint32sCommandParameterInfo); + InteractionInfo writeTestClusterInt32sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt32sAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt32sCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt32sAttribute", writeTestClusterInt32sAttributeInteractionInfo); + Map writeTestClusterInt64sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterint64sCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterInt64sCommandParams.put("value", testClusterint64sCommandParameterInfo); + InteractionInfo writeTestClusterInt64sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeInt64sAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterInt64sCommandParams); + writeTestClusterInteractionInfo.put( + "writeInt64sAttribute", writeTestClusterInt64sAttributeInteractionInfo); + Map writeTestClusterEnum8CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterenum8CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterEnum8CommandParams.put("value", testClusterenum8CommandParameterInfo); + InteractionInfo writeTestClusterEnum8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeEnum8Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterEnum8CommandParams); + writeTestClusterInteractionInfo.put( + "writeEnum8Attribute", writeTestClusterEnum8AttributeInteractionInfo); + Map writeTestClusterEnum16CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterenum16CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterEnum16CommandParams.put("value", testClusterenum16CommandParameterInfo); + InteractionInfo writeTestClusterEnum16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeEnum16Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterEnum16CommandParams); + writeTestClusterInteractionInfo.put( + "writeEnum16Attribute", writeTestClusterEnum16AttributeInteractionInfo); + Map writeTestClusterOctetStringCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusteroctetStringCommandParameterInfo = + new CommandParameterInfo("value", byte[].class); + writeTestClusterOctetStringCommandParams.put( + "value", testClusteroctetStringCommandParameterInfo); + InteractionInfo writeTestClusterOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeOctetStringAttribute( + (DefaultClusterCallback) callback, (byte[]) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterOctetStringCommandParams); + writeTestClusterInteractionInfo.put( + "writeOctetStringAttribute", writeTestClusterOctetStringAttributeInteractionInfo); + Map writeTestClusterLongOctetStringCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterlongOctetStringCommandParameterInfo = + new CommandParameterInfo("value", byte[].class); + writeTestClusterLongOctetStringCommandParams.put( + "value", testClusterlongOctetStringCommandParameterInfo); + InteractionInfo writeTestClusterLongOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeLongOctetStringAttribute( + (DefaultClusterCallback) callback, (byte[]) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterLongOctetStringCommandParams); + writeTestClusterInteractionInfo.put( + "writeLongOctetStringAttribute", writeTestClusterLongOctetStringAttributeInteractionInfo); + Map writeTestClusterCharStringCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClustercharStringCommandParameterInfo = + new CommandParameterInfo("value", String.class); + writeTestClusterCharStringCommandParams.put("value", testClustercharStringCommandParameterInfo); + InteractionInfo writeTestClusterCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeCharStringAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterCharStringCommandParams); + writeTestClusterInteractionInfo.put( + "writeCharStringAttribute", writeTestClusterCharStringAttributeInteractionInfo); + Map writeTestClusterLongCharStringCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterlongCharStringCommandParameterInfo = + new CommandParameterInfo("value", String.class); + writeTestClusterLongCharStringCommandParams.put( + "value", testClusterlongCharStringCommandParameterInfo); + InteractionInfo writeTestClusterLongCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeLongCharStringAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterLongCharStringCommandParams); + writeTestClusterInteractionInfo.put( + "writeLongCharStringAttribute", writeTestClusterLongCharStringAttributeInteractionInfo); + Map writeTestClusterEpochUsCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterepochUsCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterEpochUsCommandParams.put("value", testClusterepochUsCommandParameterInfo); + InteractionInfo writeTestClusterEpochUsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeEpochUsAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterEpochUsCommandParams); + writeTestClusterInteractionInfo.put( + "writeEpochUsAttribute", writeTestClusterEpochUsAttributeInteractionInfo); + Map writeTestClusterEpochSCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterepochSCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterEpochSCommandParams.put("value", testClusterepochSCommandParameterInfo); + InteractionInfo writeTestClusterEpochSAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeEpochSAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterEpochSCommandParams); + writeTestClusterInteractionInfo.put( + "writeEpochSAttribute", writeTestClusterEpochSAttributeInteractionInfo); + Map writeTestClusterVendorIdCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClustervendorIdCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterVendorIdCommandParams.put("value", testClustervendorIdCommandParameterInfo); + InteractionInfo writeTestClusterVendorIdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeVendorIdAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterVendorIdCommandParams); + writeTestClusterInteractionInfo.put( + "writeVendorIdAttribute", writeTestClusterVendorIdAttributeInteractionInfo); + Map writeTestClusterUnsupportedCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusterunsupportedCommandParameterInfo = + new CommandParameterInfo("value", boolean.class); + writeTestClusterUnsupportedCommandParams.put( + "value", testClusterunsupportedCommandParameterInfo); + InteractionInfo writeTestClusterUnsupportedAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeUnsupportedAttribute( + (DefaultClusterCallback) callback, (Boolean) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterUnsupportedCommandParams); + writeTestClusterInteractionInfo.put( + "writeUnsupportedAttribute", writeTestClusterUnsupportedAttributeInteractionInfo); + Map writeTestClusterNullableBooleanCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableBooleanCommandParameterInfo = + new CommandParameterInfo("value", boolean.class); + writeTestClusterNullableBooleanCommandParams.put( + "value", testClusternullableBooleanCommandParameterInfo); + InteractionInfo writeTestClusterNullableBooleanAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableBooleanAttribute( + (DefaultClusterCallback) callback, (Boolean) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableBooleanCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableBooleanAttribute", writeTestClusterNullableBooleanAttributeInteractionInfo); + Map writeTestClusterNullableBitmap8CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableBitmap8CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableBitmap8CommandParams.put( + "value", testClusternullableBitmap8CommandParameterInfo); + InteractionInfo writeTestClusterNullableBitmap8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableBitmap8Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableBitmap8CommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableBitmap8Attribute", writeTestClusterNullableBitmap8AttributeInteractionInfo); + Map writeTestClusterNullableBitmap16CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableBitmap16CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableBitmap16CommandParams.put( + "value", testClusternullableBitmap16CommandParameterInfo); + InteractionInfo writeTestClusterNullableBitmap16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableBitmap16Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableBitmap16CommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableBitmap16Attribute", writeTestClusterNullableBitmap16AttributeInteractionInfo); + Map writeTestClusterNullableBitmap32CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableBitmap32CommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterNullableBitmap32CommandParams.put( + "value", testClusternullableBitmap32CommandParameterInfo); + InteractionInfo writeTestClusterNullableBitmap32AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableBitmap32Attribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableBitmap32CommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableBitmap32Attribute", writeTestClusterNullableBitmap32AttributeInteractionInfo); + Map writeTestClusterNullableBitmap64CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableBitmap64CommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterNullableBitmap64CommandParams.put( + "value", testClusternullableBitmap64CommandParameterInfo); + InteractionInfo writeTestClusterNullableBitmap64AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableBitmap64Attribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableBitmap64CommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableBitmap64Attribute", writeTestClusterNullableBitmap64AttributeInteractionInfo); + Map writeTestClusterNullableInt8uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt8uCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableInt8uCommandParams.put( + "value", testClusternullableInt8uCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt8uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt8uAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt8uCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt8uAttribute", writeTestClusterNullableInt8uAttributeInteractionInfo); + Map writeTestClusterNullableInt16uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt16uCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableInt16uCommandParams.put( + "value", testClusternullableInt16uCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt16uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt16uAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt16uCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt16uAttribute", writeTestClusterNullableInt16uAttributeInteractionInfo); + Map writeTestClusterNullableInt32uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt32uCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterNullableInt32uCommandParams.put( + "value", testClusternullableInt32uCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt32uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt32uAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt32uCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt32uAttribute", writeTestClusterNullableInt32uAttributeInteractionInfo); + Map writeTestClusterNullableInt64uCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt64uCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterNullableInt64uCommandParams.put( + "value", testClusternullableInt64uCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt64uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt64uAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt64uCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt64uAttribute", writeTestClusterNullableInt64uAttributeInteractionInfo); + Map writeTestClusterNullableInt8sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt8sCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableInt8sCommandParams.put( + "value", testClusternullableInt8sCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt8sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt8sAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt8sCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt8sAttribute", writeTestClusterNullableInt8sAttributeInteractionInfo); + Map writeTestClusterNullableInt16sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt16sCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableInt16sCommandParams.put( + "value", testClusternullableInt16sCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt16sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt16sAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt16sCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt16sAttribute", writeTestClusterNullableInt16sAttributeInteractionInfo); + Map writeTestClusterNullableInt32sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt32sCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterNullableInt32sCommandParams.put( + "value", testClusternullableInt32sCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt32sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt32sAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt32sCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt32sAttribute", writeTestClusterNullableInt32sAttributeInteractionInfo); + Map writeTestClusterNullableInt64sCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableInt64sCommandParameterInfo = + new CommandParameterInfo("value", long.class); + writeTestClusterNullableInt64sCommandParams.put( + "value", testClusternullableInt64sCommandParameterInfo); + InteractionInfo writeTestClusterNullableInt64sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableInt64sAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableInt64sCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableInt64sAttribute", writeTestClusterNullableInt64sAttributeInteractionInfo); + Map writeTestClusterNullableEnum8CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableEnum8CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableEnum8CommandParams.put( + "value", testClusternullableEnum8CommandParameterInfo); + InteractionInfo writeTestClusterNullableEnum8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableEnum8Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableEnum8CommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableEnum8Attribute", writeTestClusterNullableEnum8AttributeInteractionInfo); + Map writeTestClusterNullableEnum16CommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableEnum16CommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeTestClusterNullableEnum16CommandParams.put( + "value", testClusternullableEnum16CommandParameterInfo); + InteractionInfo writeTestClusterNullableEnum16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableEnum16Attribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableEnum16CommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableEnum16Attribute", writeTestClusterNullableEnum16AttributeInteractionInfo); + Map writeTestClusterNullableOctetStringCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableOctetStringCommandParameterInfo = + new CommandParameterInfo("value", byte[].class); + writeTestClusterNullableOctetStringCommandParams.put( + "value", testClusternullableOctetStringCommandParameterInfo); + InteractionInfo writeTestClusterNullableOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableOctetStringAttribute( + (DefaultClusterCallback) callback, (byte[]) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableOctetStringCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableOctetStringAttribute", + writeTestClusterNullableOctetStringAttributeInteractionInfo); + Map writeTestClusterNullableCharStringCommandParams = + new LinkedHashMap(); + CommandParameterInfo testClusternullableCharStringCommandParameterInfo = + new CommandParameterInfo("value", String.class); + writeTestClusterNullableCharStringCommandParams.put( + "value", testClusternullableCharStringCommandParameterInfo); + InteractionInfo writeTestClusterNullableCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .writeNullableCharStringAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeTestClusterNullableCharStringCommandParams); + writeTestClusterInteractionInfo.put( + "writeNullableCharStringAttribute", + writeTestClusterNullableCharStringAttributeInteractionInfo); + writeAttributeMap.put("testCluster", writeTestClusterInteractionInfo); + Map writeThermostatInteractionInfo = new LinkedHashMap<>(); + Map writeThermostatOccupiedCoolingSetpointCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatoccupiedCoolingSetpointCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatOccupiedCoolingSetpointCommandParams.put( + "value", thermostatoccupiedCoolingSetpointCommandParameterInfo); + InteractionInfo writeThermostatOccupiedCoolingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeOccupiedCoolingSetpointAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatOccupiedCoolingSetpointCommandParams); + writeThermostatInteractionInfo.put( + "writeOccupiedCoolingSetpointAttribute", + writeThermostatOccupiedCoolingSetpointAttributeInteractionInfo); + Map writeThermostatOccupiedHeatingSetpointCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatoccupiedHeatingSetpointCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatOccupiedHeatingSetpointCommandParams.put( + "value", thermostatoccupiedHeatingSetpointCommandParameterInfo); + InteractionInfo writeThermostatOccupiedHeatingSetpointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeOccupiedHeatingSetpointAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatOccupiedHeatingSetpointCommandParams); + writeThermostatInteractionInfo.put( + "writeOccupiedHeatingSetpointAttribute", + writeThermostatOccupiedHeatingSetpointAttributeInteractionInfo); + Map writeThermostatMinHeatSetpointLimitCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatminHeatSetpointLimitCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatMinHeatSetpointLimitCommandParams.put( + "value", thermostatminHeatSetpointLimitCommandParameterInfo); + InteractionInfo writeThermostatMinHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeMinHeatSetpointLimitAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatMinHeatSetpointLimitCommandParams); + writeThermostatInteractionInfo.put( + "writeMinHeatSetpointLimitAttribute", + writeThermostatMinHeatSetpointLimitAttributeInteractionInfo); + Map writeThermostatMaxHeatSetpointLimitCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatmaxHeatSetpointLimitCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatMaxHeatSetpointLimitCommandParams.put( + "value", thermostatmaxHeatSetpointLimitCommandParameterInfo); + InteractionInfo writeThermostatMaxHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeMaxHeatSetpointLimitAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatMaxHeatSetpointLimitCommandParams); + writeThermostatInteractionInfo.put( + "writeMaxHeatSetpointLimitAttribute", + writeThermostatMaxHeatSetpointLimitAttributeInteractionInfo); + Map writeThermostatMinCoolSetpointLimitCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatminCoolSetpointLimitCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatMinCoolSetpointLimitCommandParams.put( + "value", thermostatminCoolSetpointLimitCommandParameterInfo); + InteractionInfo writeThermostatMinCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeMinCoolSetpointLimitAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatMinCoolSetpointLimitCommandParams); + writeThermostatInteractionInfo.put( + "writeMinCoolSetpointLimitAttribute", + writeThermostatMinCoolSetpointLimitAttributeInteractionInfo); + Map writeThermostatMaxCoolSetpointLimitCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatmaxCoolSetpointLimitCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatMaxCoolSetpointLimitCommandParams.put( + "value", thermostatmaxCoolSetpointLimitCommandParameterInfo); + InteractionInfo writeThermostatMaxCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeMaxCoolSetpointLimitAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatMaxCoolSetpointLimitCommandParams); + writeThermostatInteractionInfo.put( + "writeMaxCoolSetpointLimitAttribute", + writeThermostatMaxCoolSetpointLimitAttributeInteractionInfo); + Map writeThermostatMinSetpointDeadBandCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatminSetpointDeadBandCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatMinSetpointDeadBandCommandParams.put( + "value", thermostatminSetpointDeadBandCommandParameterInfo); + InteractionInfo writeThermostatMinSetpointDeadBandAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeMinSetpointDeadBandAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatMinSetpointDeadBandCommandParams); + writeThermostatInteractionInfo.put( + "writeMinSetpointDeadBandAttribute", + writeThermostatMinSetpointDeadBandAttributeInteractionInfo); + Map writeThermostatControlSequenceOfOperationCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatcontrolSequenceOfOperationCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatControlSequenceOfOperationCommandParams.put( + "value", thermostatcontrolSequenceOfOperationCommandParameterInfo); + InteractionInfo writeThermostatControlSequenceOfOperationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeControlSequenceOfOperationAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatControlSequenceOfOperationCommandParams); + writeThermostatInteractionInfo.put( + "writeControlSequenceOfOperationAttribute", + writeThermostatControlSequenceOfOperationAttributeInteractionInfo); + Map writeThermostatSystemModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatsystemModeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatSystemModeCommandParams.put("value", thermostatsystemModeCommandParameterInfo); + InteractionInfo writeThermostatSystemModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .writeSystemModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatSystemModeCommandParams); + writeThermostatInteractionInfo.put( + "writeSystemModeAttribute", writeThermostatSystemModeAttributeInteractionInfo); + writeAttributeMap.put("thermostat", writeThermostatInteractionInfo); + Map writeThermostatUserInterfaceConfigurationInteractionInfo = + new LinkedHashMap<>(); + Map + writeThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo + thermostatUserInterfaceConfigurationtemperatureDisplayModeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams.put( + "value", thermostatUserInterfaceConfigurationtemperatureDisplayModeCommandParameterInfo); + InteractionInfo + writeThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .writeTemperatureDisplayModeAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams); + writeThermostatUserInterfaceConfigurationInteractionInfo.put( + "writeTemperatureDisplayModeAttribute", + writeThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo); + Map + writeThermostatUserInterfaceConfigurationKeypadLockoutCommandParams = + new LinkedHashMap(); + CommandParameterInfo thermostatUserInterfaceConfigurationkeypadLockoutCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatUserInterfaceConfigurationKeypadLockoutCommandParams.put( + "value", thermostatUserInterfaceConfigurationkeypadLockoutCommandParameterInfo); + InteractionInfo writeThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .writeKeypadLockoutAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatUserInterfaceConfigurationKeypadLockoutCommandParams); + writeThermostatUserInterfaceConfigurationInteractionInfo.put( + "writeKeypadLockoutAttribute", + writeThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo); + Map + writeThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams = + new LinkedHashMap(); + CommandParameterInfo + thermostatUserInterfaceConfigurationscheduleProgrammingVisibilityCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams.put( + "value", + thermostatUserInterfaceConfigurationscheduleProgrammingVisibilityCommandParameterInfo); + InteractionInfo + writeThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .writeScheduleProgrammingVisibilityAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams); + writeThermostatUserInterfaceConfigurationInteractionInfo.put( + "writeScheduleProgrammingVisibilityAttribute", + writeThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo); + writeAttributeMap.put( + "thermostatUserInterfaceConfiguration", + writeThermostatUserInterfaceConfigurationInteractionInfo); + Map writeThreadNetworkDiagnosticsInteractionInfo = + new LinkedHashMap<>(); + writeAttributeMap.put("threadNetworkDiagnostics", writeThreadNetworkDiagnosticsInteractionInfo); + Map writeWakeOnLanInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("wakeOnLan", writeWakeOnLanInteractionInfo); + Map writeWiFiNetworkDiagnosticsInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("wiFiNetworkDiagnostics", writeWiFiNetworkDiagnosticsInteractionInfo); + Map writeWindowCoveringInteractionInfo = new LinkedHashMap<>(); + Map writeWindowCoveringModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo windowCoveringmodeCommandParameterInfo = + new CommandParameterInfo("value", int.class); + writeWindowCoveringModeCommandParams.put("value", windowCoveringmodeCommandParameterInfo); + InteractionInfo writeWindowCoveringModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WindowCoveringCluster) cluster) + .writeModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeWindowCoveringModeCommandParams); + writeWindowCoveringInteractionInfo.put( + "writeModeAttribute", writeWindowCoveringModeAttributeInteractionInfo); + writeAttributeMap.put("windowCovering", writeWindowCoveringInteractionInfo); + return writeAttributeMap; + } +} From 494fb9b52abefce6d854ac47a902e9e5fd1c4fba Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Wed, 17 Nov 2021 12:01:02 -0800 Subject: [PATCH 3/5] update encoding for read/subscribe/write request (#11856) --- src/app/MessageDef/ReadRequestMessage.cpp | 271 +++++++---------- src/app/MessageDef/ReadRequestMessage.h | 70 ++--- .../MessageDef/SubscribeRequestMessage.cpp | 272 +++++++++--------- src/app/MessageDef/SubscribeRequestMessage.h | 97 +++---- .../MessageDef/SubscribeResponseMessage.cpp | 4 + src/app/MessageDef/WriteRequestMessage.cpp | 214 +++++++------- src/app/MessageDef/WriteRequestMessage.h | 68 +++-- src/app/MessageDef/WriteResponseMessage.cpp | 10 +- src/app/ReadClient.cpp | 33 ++- src/app/ReadHandler.cpp | 13 +- src/app/ReadHandler.h | 1 + src/app/WriteClient.cpp | 17 +- src/app/WriteHandler.cpp | 8 +- src/app/WriteHandler.h | 4 +- src/app/tests/TestMessageDef.cpp | 105 +++---- src/app/tests/TestReadInteraction.cpp | 31 +- src/app/tests/TestReportingEngine.cpp | 4 +- src/app/tests/TestWriteInteraction.cpp | 4 +- src/lib/core/CHIPError.cpp | 19 +- src/lib/core/CHIPError.h | 44 +++ 20 files changed, 656 insertions(+), 633 deletions(-) diff --git a/src/app/MessageDef/ReadRequestMessage.cpp b/src/app/MessageDef/ReadRequestMessage.cpp index efe0693b91b29b..4fbec503a8f099 100644 --- a/src/app/MessageDef/ReadRequestMessage.cpp +++ b/src/app/MessageDef/ReadRequestMessage.cpp @@ -13,11 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * @file - * This file defines ReadRequestMessage parser and builder in CHIP interaction model - * - */ #include "ReadRequestMessage.h" #include "MessageDefHelper.h" @@ -28,20 +23,15 @@ #include -using namespace chip; -using namespace chip::TLV; - namespace chip { namespace app { #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR ReadRequestMessage::Parser::CheckSchemaValidity() const { - CHIP_ERROR err = CHIP_NO_ERROR; - uint16_t TagPresenceMask = 0; - chip::TLV::TLVReader reader; - AttributePathIBs::Parser AttributePathIBs; - EventPaths::Parser eventPathList; - AttributeDataVersionList::Parser attributeDataVersionList; + CHIP_ERROR err = CHIP_NO_ERROR; + int TagPresenceMask = 0; + TLV::TLVReader reader; + PRETTY_PRINT("ReadRequestMessage ="); PRETTY_PRINT("{"); @@ -50,206 +40,151 @@ CHIP_ERROR ReadRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - const Tag tag = reader.GetTag(); - - if (chip::TLV::ContextTag(kCsTag_AttributePathList) == tag) - { - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_AttributePathList)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributePathList); - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - AttributePathIBs.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - - err = AttributePathIBs.CheckSchemaValidity(); - SuccessOrExit(err); - - PRETTY_PRINT_DECDEPTH(); - } - else if (chip::TLV::ContextTag(kCsTag_EventPaths) == tag) - { - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_EventPaths)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_EventPaths); - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - eventPathList.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - - err = eventPathList.CheckSchemaValidity(); - SuccessOrExit(err); - - PRETTY_PRINT_DECDEPTH(); - } - else if (chip::TLV::ContextTag(kCsTag_AttributeDataVersionList) == tag) + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); + switch (tagNum) { - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_AttributeDataVersionList)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributeDataVersionList); - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - attributeDataVersionList.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - - err = attributeDataVersionList.CheckSchemaValidity(); - SuccessOrExit(err); - - PRETTY_PRINT_DECDEPTH(); - } - else if (chip::TLV::ContextTag(kCsTag_AttributePathList) == tag) - { - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_AttributePathList)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributePathList); - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - AttributePathIBs.Init(reader); + case to_underlying(Tag::kAttributeRequests): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kAttributeRequests))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kAttributeRequests)); + { + AttributePathIBs::Parser attributeRequests; + ReturnErrorOnFailure(attributeRequests.Init(reader)); - PRETTY_PRINT_INCDEPTH(); + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(attributeRequests.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + } + break; + case to_underlying(Tag::kEventRequests): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventRequests))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kEventRequests)); + { + EventPaths::Parser eventRequests; + ReturnErrorOnFailure(eventRequests.Init(reader)); - err = AttributePathIBs.CheckSchemaValidity(); - SuccessOrExit(err); + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(eventRequests.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + } + break; + case to_underlying(Tag::kEventFilters): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventFilters))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kEventFilters)); + { + EventFilters::Parser eventFilters; + ReturnErrorOnFailure(eventFilters.Init(reader)); - PRETTY_PRINT_DECDEPTH(); - } - else if (chip::TLV::ContextTag(kCsTag_EventNumber) == tag) - { - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_EventNumber)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_EventNumber); - VerifyOrExit(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(eventFilters.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + } + break; + case to_underlying(Tag::kIsFabricFiltered): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kIsFabricFiltered))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kIsFabricFiltered)); #if CHIP_DETAIL_LOGGING { - uint64_t eventNumber; - err = reader.Get(eventNumber); - SuccessOrExit(err); - PRETTY_PRINT("\tEventNumber = 0x%" PRIx64 ",", eventNumber); + bool isFabricFiltered; + ReturnErrorOnFailure(reader.Get(isFabricFiltered)); + PRETTY_PRINT("\tisFabricFiltered = %s, ", isFabricFiltered ? "true" : "false"); } #endif // CHIP_DETAIL_LOGGING + break; + default: + PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); + break; } } - PRETTY_PRINT("}"); + PRETTY_PRINT("},"); PRETTY_PRINT(""); - // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - err = CHIP_NO_ERROR; - } - SuccessOrExit(err); - err = reader.ExitContainer(mOuterContainerType); + const int RequiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)); -exit: + if ((TagPresenceMask & RequiredFields) == RequiredFields) + { + err = CHIP_NO_ERROR; + } + else + { + err = CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE; + } + } - return err; + ReturnErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK -CHIP_ERROR ReadRequestMessage::Parser::GetPathList(AttributePathIBs::Parser * const apAttributePathList) const +CHIP_ERROR ReadRequestMessage::Parser::GetAttributeRequests(AttributePathIBs::Parser * const apAttributeRequests) const { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::TLV::TLVReader reader; - - err = mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributePathList), reader); - SuccessOrExit(err); - - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = apAttributePathList->Init(reader); - SuccessOrExit(err); - -exit: - ChipLogIfFalse((CHIP_NO_ERROR == err) || (CHIP_END_OF_TLV == err)); - - return err; + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kAttributeRequests)), reader)); + return apAttributeRequests->Init(reader); } -CHIP_ERROR ReadRequestMessage::Parser::GetEventPaths(EventPaths::Parser * const apEventPaths) const +CHIP_ERROR ReadRequestMessage::Parser::GetEventRequests(EventPaths::Parser * const apEventRequests) const { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::TLV::TLVReader reader; - - err = mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_EventPaths), reader); - SuccessOrExit(err); - - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = apEventPaths->Init(reader); - SuccessOrExit(err); - -exit: - ChipLogIfFalse((CHIP_NO_ERROR == err) || (CHIP_END_OF_TLV == err)); - - return err; + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kEventRequests)), reader)); + return apEventRequests->Init(reader); } -CHIP_ERROR -ReadRequestMessage::Parser::GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const +CHIP_ERROR ReadRequestMessage::Parser::GetEventFilters(EventFilters::Parser * const apEventFilters) const { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::TLV::TLVReader reader; - - err = mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributeDataVersionList), reader); - SuccessOrExit(err); - - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = apAttributeDataVersionList->Init(reader); - SuccessOrExit(err); - -exit: - ChipLogIfFalse((CHIP_NO_ERROR == err) || (CHIP_END_OF_TLV == err)); - - return err; + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kEventFilters)), reader)); + return apEventFilters->Init(reader); } -CHIP_ERROR ReadRequestMessage::Parser::GetEventNumber(uint64_t * const apEventNumber) const +CHIP_ERROR ReadRequestMessage::Parser::GetIsFabricFiltered(bool * const apIsFabricFiltered) const { - return GetUnsignedInteger(kCsTag_EventNumber, apEventNumber); + return GetSimpleValue(to_underlying(Tag::kIsFabricFiltered), TLV::kTLVType_Boolean, apIsFabricFiltered); } -AttributePathIBs::Builder & ReadRequestMessage::Builder::CreateAttributePathListBuilder() +AttributePathIBs::Builder & ReadRequestMessage::Builder::CreateAttributeRequests() { // skip if error has already been set - VerifyOrExit(CHIP_NO_ERROR == mError, mAttributePathListBuilder.ResetError(mError)); - - mError = mAttributePathListBuilder.Init(mpWriter, kCsTag_AttributePathList); - -exit: - // on error, mAttributePathListBuilder would be un-/partial initialized and cannot be used to write anything - return mAttributePathListBuilder; + if (mError == CHIP_NO_ERROR) + { + mError = mAttributeRequests.Init(mpWriter, to_underlying(Tag::kAttributeRequests)); + } + return mAttributeRequests; } -EventPaths::Builder & ReadRequestMessage::Builder::CreateEventPathsBuilder() +EventPaths::Builder & ReadRequestMessage::Builder::CreateEventRequests() { // skip if error has already been set - VerifyOrExit(CHIP_NO_ERROR == mError, mEventPathsBuilder.ResetError(mError)); - - mError = mEventPathsBuilder.Init(mpWriter, kCsTag_EventPaths); - -exit: - // on error, mEventPathsBuilder would be un-/partial initialized and cannot be used to write anything - return mEventPathsBuilder; + if (mError == CHIP_NO_ERROR) + { + mError = mEventRequests.Init(mpWriter, to_underlying(Tag::kEventRequests)); + } + return mEventRequests; } -AttributeDataVersionList::Builder & ReadRequestMessage::Builder::CreateAttributeDataVersionListBuilder() +EventFilters::Builder & ReadRequestMessage::Builder::CreateEventFilters() { // skip if error has already been set - VerifyOrExit(CHIP_NO_ERROR == mError, mAttributeDataVersionListBuilder.ResetError(mError)); - - mError = mAttributeDataVersionListBuilder.Init(mpWriter, kCsTag_AttributeDataVersionList); - -exit: - // on error, mAttributeDataVersionListBuilder would be un-/partial initialized and cannot be used to write anything - return mAttributeDataVersionListBuilder; + if (mError == CHIP_NO_ERROR) + { + mError = mEventFilters.Init(mpWriter, to_underlying(Tag::kEventFilters)); + } + return mEventFilters; } -ReadRequestMessage::Builder & ReadRequestMessage::Builder::EventNumber(const uint64_t aEventNumber) +ReadRequestMessage::Builder & ReadRequestMessage::Builder::IsFabricFiltered(const bool aIsFabricFiltered) { // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_EventNumber), aEventNumber); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kIsFabricFiltered)), aIsFabricFiltered); } return *this; } @@ -259,5 +194,5 @@ ReadRequestMessage::Builder & ReadRequestMessage::Builder::EndOfReadRequestMessa EndOfContainer(); return *this; } -}; // namespace app -}; // namespace chip +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/ReadRequestMessage.h b/src/app/MessageDef/ReadRequestMessage.h index b065ce4d317686..b3fe54d71cc518 100644 --- a/src/app/MessageDef/ReadRequestMessage.h +++ b/src/app/MessageDef/ReadRequestMessage.h @@ -15,21 +15,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * @file - * This file defines ReadRequestMessage parser and builder in CHIP interaction model - * - */ #pragma once -#include "AttributeDataVersionList.h" #include "AttributePathIBs.h" -#include "Builder.h" +#include "EventFilters.h" #include "EventPaths.h" -#include "Parser.h" - #include #include #include @@ -40,12 +32,13 @@ namespace chip { namespace app { namespace ReadRequestMessage { -enum +enum class Tag : uint8_t { - kCsTag_AttributePathList = 0, - kCsTag_AttributeDataVersionList = 1, - kCsTag_EventPaths = 2, - kCsTag_EventNumber = 3, + kAttributeRequests = 0, + kEventRequests = 1, + kDataVersionFilters = 2, + kEventFilters = 3, + kIsFabricFiltered = 4, }; class Parser : public StructParser @@ -71,42 +64,40 @@ class Parser : public StructParser /** * @brief Get a TLVReader for the AttributePathIBs. Next() must be called before accessing them. * - * @param [in] apAttributePathList A pointer to an attribute path list parser. + * @param [in] apAttributeRequests A pointer to an attribute path list parser. * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetPathList(AttributePathIBs::Parser * const apAttributePathList) const; + CHIP_ERROR GetAttributeRequests(AttributePathIBs::Parser * const apAttributeRequests) const; /** - * @brief Get a TLVReader for the EventPaths. Next() must be called before accessing them. + * @brief Get a TLVReader for the EventRequests. Next() must be called before accessing them. * * @param [in] apEventPaths A pointer to apEventPaths * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetEventPaths(EventPaths::Parser * const apEventPaths) const; + CHIP_ERROR GetEventRequests(EventPaths::Parser * const apEventRequests) const; /** - * @brief Get a parser for the AttributeDataVersionList. Next() must be called before accessing them. - * - * @param [in] apAttributeDataVersionList A pointer to apAttributeDataVersionList + * @brief Get a TLVReader for the EventFilters. Next() must be called before accessing them. * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const; + CHIP_ERROR GetEventFilters(EventFilters::Parser * const apEventFilters) const; /** - * @brief Get Event Number. Next() must be called before accessing them. + * @brief Get IsFabricFiltered boolean * - * @param [in] apEventNumber A pointer to apEventNumber + * @param [in] apIsFabricFiltered A pointer to apIsFabricFiltered * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetEventNumber(uint64_t * const apEventNumber) const; + CHIP_ERROR GetIsFabricFiltered(bool * const apIsFabricFiltered) const; }; class Builder : public StructBuilder @@ -117,29 +108,28 @@ class Builder : public StructBuilder * * @return A reference to AttributePathIBs::Builder */ - AttributePathIBs::Builder & CreateAttributePathListBuilder(); + AttributePathIBs::Builder & CreateAttributeRequests(); /** * @brief Initialize a EventPaths::Builder for writing into the TLV stream * * @return A reference to EventPaths::Builder */ - EventPaths::Builder & CreateEventPathsBuilder(); + EventPaths::Builder & CreateEventRequests(); /** - * @brief Initialize a AttributeDataVersionList::Builder for writing into the TLV stream + * @brief Initialize a EventFilters::Builder for writing into the TLV stream * - * @return A reference to AttributeDataVersionList::Builder + * @return A reference to EventFilters::Builder */ - AttributeDataVersionList::Builder & CreateAttributeDataVersionListBuilder(); + EventFilters::Builder & CreateEventFilters(); /** - * @brief An initiator can optionally specify an EventNumber it has already to limit the - * set of retrieved events on the server for optimization purposes. - * @param [in] aEventNumber The event number + * @brief limits the data written within fabric-scoped lists to the accessing fabric * @return A reference to *this */ - ReadRequestMessage::Builder & EventNumber(const uint64_t aEventNumber); + ReadRequestMessage::Builder & IsFabricFiltered(const bool aIsFabricFiltered); + /** * @brief Mark the end of this ReadRequestMessage * @@ -148,10 +138,10 @@ class Builder : public StructBuilder ReadRequestMessage::Builder & EndOfReadRequestMessage(); private: - AttributePathIBs::Builder mAttributePathListBuilder; - EventPaths::Builder mEventPathsBuilder; - AttributeDataVersionList::Builder mAttributeDataVersionListBuilder; + AttributePathIBs::Builder mAttributeRequests; + EventPaths::Builder mEventRequests; + EventFilters::Builder mEventFilters; }; -}; // namespace ReadRequestMessage -}; // namespace app -}; // namespace chip +} // namespace ReadRequestMessage +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/SubscribeRequestMessage.cpp b/src/app/MessageDef/SubscribeRequestMessage.cpp index d529ab644e3e37..6ba07eaff71e16 100644 --- a/src/app/MessageDef/SubscribeRequestMessage.cpp +++ b/src/app/MessageDef/SubscribeRequestMessage.cpp @@ -22,12 +22,10 @@ namespace app { #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR SubscribeRequestMessage::Parser::CheckSchemaValidity() const { - CHIP_ERROR err = CHIP_NO_ERROR; - uint16_t TagPresenceMask = 0; - chip::TLV::TLVReader reader; - AttributePathIBs::Parser AttributePathIBs; - EventPaths::Parser eventPathList; - AttributeDataVersionList::Parser attributeDataVersionList; + CHIP_ERROR err = CHIP_NO_ERROR; + int TagPresenceMask = 0; + TLV::TLVReader reader; + PRETTY_PRINT("SubscribeRequestMessage ="); PRETTY_PRINT("{"); @@ -36,247 +34,257 @@ CHIP_ERROR SubscribeRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(chip::TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (chip::TLV::TagNumFromTag(reader.GetTag())) + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); + switch (tagNum) { - case kCsTag_AttributePathList: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_AttributePathList)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributePathList); - VerifyOrReturnError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - - AttributePathIBs.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - ReturnErrorOnFailure(AttributePathIBs.CheckSchemaValidity()); - PRETTY_PRINT_DECDEPTH(); - break; - case kCsTag_EventPaths: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_EventPaths)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_EventPaths); - VerifyOrReturnError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - - eventPathList.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - - ReturnErrorOnFailure(eventPathList.CheckSchemaValidity()); - - PRETTY_PRINT_DECDEPTH(); - break; - case kCsTag_AttributeDataVersionList: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_AttributeDataVersionList)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributeDataVersionList); - VerifyOrReturnError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - - attributeDataVersionList.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - ReturnErrorOnFailure(attributeDataVersionList.CheckSchemaValidity()); - PRETTY_PRINT_DECDEPTH(); - break; - case kCsTag_EventNumber: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_EventNumber)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_EventNumber); - VerifyOrReturnError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + case to_underlying(Tag::kKeepSubscriptions): + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kKeepSubscriptions))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kKeepSubscriptions)); + VerifyOrReturnError(TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { - uint64_t eventNumber; - ReturnErrorOnFailure(reader.Get(eventNumber)); - PRETTY_PRINT("\tEventNumber = 0x%" PRIx64 ",", eventNumber); + bool keepSubscriptions; + ReturnErrorOnFailure(reader.Get(keepSubscriptions)); + PRETTY_PRINT("\tKeepSubscriptions = %s, ", keepSubscriptions ? "true" : "false"); } #endif // CHIP_DETAIL_LOGGING break; - case kCsTag_MinIntervalSeconds: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_MinIntervalSeconds)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_MinIntervalSeconds); - VerifyOrReturnError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + case to_underlying(Tag::kMinIntervalFloorSeconds): + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kMinIntervalFloorSeconds))), + CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kMinIntervalFloorSeconds)); + VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { - uint16_t minIntervalSeconds; - ReturnErrorOnFailure(reader.Get(minIntervalSeconds)); - PRETTY_PRINT("\tMinIntervalSeconds = 0x%" PRIx16 ",", minIntervalSeconds); + uint16_t MinIntervalFloorSeconds; + ReturnErrorOnFailure(reader.Get(MinIntervalFloorSeconds)); + PRETTY_PRINT("\tMinIntervalFloorSeconds = 0x%" PRIx16 ",", MinIntervalFloorSeconds); } #endif // CHIP_DETAIL_LOGGING break; - case kCsTag_MaxIntervalSeconds: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_MaxIntervalSeconds)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_MaxIntervalSeconds); - VerifyOrReturnError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + case to_underlying(Tag::kMaxIntervalCeilingSeconds): + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kMaxIntervalCeilingSeconds))), + CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kMaxIntervalCeilingSeconds)); + VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { - uint16_t maxIntervalSeconds; - ReturnErrorOnFailure(reader.Get(maxIntervalSeconds)); - PRETTY_PRINT("\tkMaxInterval = 0x%" PRIx16 ",", maxIntervalSeconds); + uint16_t MaxIntervalCeilingSeconds; + ReturnErrorOnFailure(reader.Get(MaxIntervalCeilingSeconds)); + PRETTY_PRINT("\tMaxIntervalCeilingSeconds = 0x%" PRIx16 ",", MaxIntervalCeilingSeconds); } #endif // CHIP_DETAIL_LOGGING break; - case kCsTag_KeepSubscriptions: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_KeepSubscriptions)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_KeepSubscriptions); - VerifyOrReturnError(chip::TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); -#if CHIP_DETAIL_LOGGING + case to_underlying(Tag::kAttributeRequests): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kAttributeRequests))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kAttributeRequests)); { - bool keepSubscriptions; - ReturnErrorOnFailure(reader.Get(keepSubscriptions)); - PRETTY_PRINT("\tKeepSubscriptions = %s, ", keepSubscriptions ? "true" : "false"); + AttributePathIBs::Parser attributeRequests; + ReturnErrorOnFailure(attributeRequests.Init(reader)); + + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(attributeRequests.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + } + break; + case to_underlying(Tag::kEventRequests): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventRequests))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kEventRequests)); + { + EventPaths::Parser eventRequests; + ReturnErrorOnFailure(eventRequests.Init(reader)); + + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(eventRequests.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + } + break; + case to_underlying(Tag::kEventFilters): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventFilters))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kEventFilters)); + { + EventFilters::Parser eventFilters; + ReturnErrorOnFailure(eventFilters.Init(reader)); + + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(eventFilters.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); } -#endif // CHIP_DETAIL_LOGGING break; - case kCsTag_IsProxy: - VerifyOrReturnError(!(TagPresenceMask & (1 << kCsTag_IsProxy)), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_IsProxy); - VerifyOrReturnError(chip::TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + case to_underlying(Tag::kIsProxy): + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kIsProxy))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kIsProxy)); + VerifyOrReturnError(TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { bool isProxy; ReturnErrorOnFailure(reader.Get(isProxy)); PRETTY_PRINT("\tIsProxy = %s, ", isProxy ? "true" : "false"); } +#endif // CHIP_DETAIL_LOGGING + break; + case to_underlying(Tag::kIsFabricFiltered): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kIsFabricFiltered))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kIsFabricFiltered)); +#if CHIP_DETAIL_LOGGING + { + bool isFabricFiltered; + ReturnErrorOnFailure(reader.Get(isFabricFiltered)); + PRETTY_PRINT("\tisFabricFiltered = %s, ", isFabricFiltered ? "true" : "false"); + } #endif // CHIP_DETAIL_LOGGING break; default: - ReturnErrorOnFailure(CHIP_ERROR_INVALID_TLV_TAG); + PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); + break; } } - PRETTY_PRINT("}"); + PRETTY_PRINT("},"); PRETTY_PRINT(""); + if (CHIP_END_OF_TLV == err) { - const uint16_t RequiredFields = (1 << kCsTag_MinIntervalSeconds) | (1 << kCsTag_MaxIntervalSeconds); + const int RequiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)) | + (1 << to_underlying(Tag::kMinIntervalFloorSeconds)) | (1 << to_underlying(Tag::kMaxIntervalCeilingSeconds)); if ((TagPresenceMask & RequiredFields) == RequiredFields) { err = CHIP_NO_ERROR; } + else + { + err = CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE; + } } + ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK -CHIP_ERROR SubscribeRequestMessage::Parser::GetPathList(AttributePathIBs::Parser * const apAttributePathList) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetKeepSubscriptions(bool * const apKeepExistingSubscription) const { - TLV::TLVReader reader; - ReturnErrorOnFailure(mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributePathList), reader)); - VerifyOrReturnError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - return apAttributePathList->Init(reader); + return GetSimpleValue(to_underlying(Tag::kKeepSubscriptions), TLV::kTLVType_Boolean, apKeepExistingSubscription); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetEventPaths(EventPaths::Parser * const apEventPaths) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetMinIntervalFloorSeconds(uint16_t * const apMinIntervalFloorSeconds) const { - TLV::TLVReader reader; - ReturnErrorOnFailure(mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_EventPaths), reader)); - VerifyOrReturnError(chip::TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - return apEventPaths->Init(reader); + return GetUnsignedInteger(to_underlying(Tag::kMinIntervalFloorSeconds), apMinIntervalFloorSeconds); } -CHIP_ERROR -SubscribeRequestMessage::Parser::GetAttributeDataVersionList( - AttributeDataVersionList::Parser * const apAttributeDataVersionList) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetMaxIntervalCeilingSeconds(uint16_t * const apMaxIntervalCeilingSeconds) const { - TLV::TLVReader reader; - ReturnErrorOnFailure(mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributeDataVersionList), reader)); - VerifyOrReturnError(TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - return apAttributeDataVersionList->Init(reader); + return GetUnsignedInteger(to_underlying(Tag::kMaxIntervalCeilingSeconds), apMaxIntervalCeilingSeconds); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetEventNumber(uint64_t * const apEventNumber) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetAttributeRequests(AttributePathIBs::Parser * const apAttributeRequests) const { - return GetUnsignedInteger(kCsTag_EventNumber, apEventNumber); + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kAttributeRequests)), reader)); + return apAttributeRequests->Init(reader); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetMinIntervalSeconds(uint16_t * const apMinIntervalSeconds) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetEventRequests(EventPaths::Parser * const apEventRequests) const { - return GetUnsignedInteger(kCsTag_MinIntervalSeconds, apMinIntervalSeconds); + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kEventRequests)), reader)); + return apEventRequests->Init(reader); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetMaxIntervalSeconds(uint16_t * const apMaxIntervalSeconds) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetEventFilters(EventFilters::Parser * const apEventFilters) const { - return GetUnsignedInteger(kCsTag_MaxIntervalSeconds, apMaxIntervalSeconds); + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kEventFilters)), reader)); + return apEventFilters->Init(reader); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetKeepSubscriptions(bool * const apKeepExistingSubscription) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetIsProxy(bool * const apIsProxy) const { - return GetSimpleValue(kCsTag_KeepSubscriptions, chip::TLV::kTLVType_Boolean, apKeepExistingSubscription); + return GetSimpleValue(to_underlying(Tag::kIsProxy), TLV::kTLVType_Boolean, apIsProxy); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetIsProxy(bool * const apIsProxy) const +CHIP_ERROR SubscribeRequestMessage::Parser::GetIsFabricFiltered(bool * const apIsFabricFiltered) const { - return GetSimpleValue(kCsTag_IsProxy, chip::TLV::kTLVType_Boolean, apIsProxy); + return GetSimpleValue(to_underlying(Tag::kIsFabricFiltered), TLV::kTLVType_Boolean, apIsFabricFiltered); } -AttributePathIBs::Builder & SubscribeRequestMessage::Builder::CreateAttributePathListBuilder() +SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::KeepSubscriptions(const bool aKeepSubscriptions) { if (mError == CHIP_NO_ERROR) { - mError = mAttributePathListBuilder.Init(mpWriter, kCsTag_AttributePathList); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kKeepSubscriptions)), aKeepSubscriptions); } - - return mAttributePathListBuilder; + return *this; } -EventPaths::Builder & SubscribeRequestMessage::Builder::CreateEventPathsBuilder() +SubscribeRequestMessage::Builder & +SubscribeRequestMessage::Builder::MinIntervalFloorSeconds(const uint16_t aMinIntervalFloorSeconds) { if (mError == CHIP_NO_ERROR) { - mError = mEventPathsBuilder.Init(mpWriter, kCsTag_EventPaths); + mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kMinIntervalFloorSeconds)), aMinIntervalFloorSeconds); } - - return mEventPathsBuilder; + return *this; } -AttributeDataVersionList::Builder & SubscribeRequestMessage::Builder::CreateAttributeDataVersionListBuilder() +SubscribeRequestMessage::Builder & +SubscribeRequestMessage::Builder::MaxIntervalCeilingSeconds(const uint16_t aMaxIntervalCeilingSeconds) { if (mError == CHIP_NO_ERROR) { - mError = mAttributeDataVersionListBuilder.Init(mpWriter, kCsTag_AttributeDataVersionList); + mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kMaxIntervalCeilingSeconds)), aMaxIntervalCeilingSeconds); } - - return mAttributeDataVersionListBuilder; + return *this; } -SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::EventNumber(const uint64_t aEventNumber) +AttributePathIBs::Builder & SubscribeRequestMessage::Builder::CreateAttributeRequests() { if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_EventNumber), aEventNumber); + mError = mAttributeRequests.Init(mpWriter, to_underlying(Tag::kAttributeRequests)); } - return *this; + return mAttributeRequests; } -SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::MinIntervalSeconds(const uint16_t aMinIntervalSeconds) +EventPaths::Builder & SubscribeRequestMessage::Builder::CreateEventRequests() { if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_MinIntervalSeconds), aMinIntervalSeconds); + mError = mEventRequests.Init(mpWriter, to_underlying(Tag::kEventRequests)); } - return *this; + return mEventRequests; } -SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::MaxIntervalSeconds(const uint16_t aMaxIntervalSeconds) +EventFilters::Builder & SubscribeRequestMessage::Builder::CreateEventFilters() { if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_MaxIntervalSeconds), aMaxIntervalSeconds); + mError = mEventFilters.Init(mpWriter, to_underlying(Tag::kEventFilters)); } - return *this; + return mEventFilters; } -SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::KeepSubscriptions(const bool aKeepSubscriptions) +SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::IsProxy(const bool aIsProxy) { if (mError == CHIP_NO_ERROR) { - mError = mpWriter->PutBoolean(chip::TLV::ContextTag(kCsTag_KeepSubscriptions), aKeepSubscriptions); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kIsProxy)), aIsProxy); } return *this; } -SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::IsProxy(const bool aIsProxy) +SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::IsFabricFiltered(const bool aIsFabricFiltered) { + // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->PutBoolean(chip::TLV::ContextTag(kCsTag_IsProxy), aIsProxy); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kIsFabricFiltered)), aIsFabricFiltered); } return *this; } diff --git a/src/app/MessageDef/SubscribeRequestMessage.h b/src/app/MessageDef/SubscribeRequestMessage.h index ea1802cf46afc1..924060e9d8a6d3 100644 --- a/src/app/MessageDef/SubscribeRequestMessage.h +++ b/src/app/MessageDef/SubscribeRequestMessage.h @@ -19,6 +19,7 @@ #include "AttributeDataVersionList.h" #include "AttributePathIBs.h" +#include "EventFilters.h" #include "EventPaths.h" #include "StructBuilder.h" #include "StructParser.h" @@ -32,16 +33,17 @@ namespace chip { namespace app { namespace SubscribeRequestMessage { -enum +enum class Tag : uint8_t { - kCsTag_AttributePathList = 0, - kCsTag_EventPaths = 1, - kCsTag_AttributeDataVersionList = 2, - kCsTag_EventNumber = 3, - kCsTag_MinIntervalSeconds = 4, - kCsTag_MaxIntervalSeconds = 5, - kCsTag_KeepSubscriptions = 6, - kCsTag_IsProxy = 7, + kKeepSubscriptions = 0, + kMinIntervalFloorSeconds = 1, + kMaxIntervalCeilingSeconds = 2, + kAttributeRequests = 3, + kDataVersionFilters = 4, + kEventRequests = 5, + kEventFilters = 6, + kIsProxy = 7, + kIsFabricFiltered = 8, }; class Parser : public StructParser @@ -63,97 +65,82 @@ class Parser : public StructParser #endif /** - * @brief Get a TLVReader for the AttributePathIBs. Next() must be called before accessing them. - * + * @brief Check if subscription is kept. * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetPathList(AttributePathIBs::Parser * const apAttributePathList) const; + CHIP_ERROR GetKeepSubscriptions(bool * const apKeepExistingSubscription) const; /** - * @brief Get a TLVReader for the EventPaths. Next() must be called before accessing them. + * @brief Get MinIntervalFloorSeconds. Next() must be called before accessing them. * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetEventPaths(EventPaths::Parser * const apEventPaths) const; + CHIP_ERROR GetMinIntervalFloorSeconds(uint16_t * const apMinIntervalFloorSeconds) const; /** - * @brief Get a parser for the AttributeDataVersionList. Next() must be called before accessing them. - * + * @brief Get MaxIntervalCeilingSeconds. Next() must be called before accessing them. * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const; + CHIP_ERROR GetMaxIntervalCeilingSeconds(uint16_t * const apMaxIntervalCeilingSeconds) const; /** - * @brief Get Event Number. Next() must be called before accessing them. + * @brief Get a TLVReader for the AttributePathIBs. Next() must be called before accessing them. * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetEventNumber(uint64_t * const apEventNumber) const; + CHIP_ERROR GetAttributeRequests(AttributePathIBs::Parser * const apAttributeRequests) const; /** - * @brief Get MinIntervalSeconds. Next() must be called before accessing them. + * @brief Get a TLVReader for the EventPaths. Next() must be called before accessing them. * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetMinIntervalSeconds(uint16_t * const apMinIntervalSeconds) const; + CHIP_ERROR GetEventRequests(EventPaths::Parser * const apEventRequests) const; /** - * @brief Get MaxIntervalSeconds. Next() must be called before accessing them. + * @brief Get a TLVReader for the EventFilters. Next() must be called before accessing them. + * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetMaxIntervalSeconds(uint16_t * const apMaxIntervalSeconds) const; + CHIP_ERROR GetEventFilters(EventFilters::Parser * const apEventFilters) const; /** - * @brief Check if subscription is kept. Next() must be called before accessing them. + * @brief Get GetIsProxy boolean . * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetKeepSubscriptions(bool * const apKeepExistingSubscription) const; + CHIP_ERROR GetIsProxy(bool * const apIsProxy) const; /** - * @brief Check if subscription is kept. Next() must be called before accessing them. + * @brief Get IsFabricFiltered boolean + * + * @param [in] apIsFabricFiltered A pointer to apIsFabricFiltered + * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetIsProxy(bool * const apIsProxy) const; + CHIP_ERROR GetIsFabricFiltered(bool * const apIsFabricFiltered) const; }; class Builder : public StructBuilder { public: - AttributePathIBs::Builder & CreateAttributePathListBuilder(); - - /** - * @brief Initialize a EventPaths::Builder for writing into the TLV stream - */ - EventPaths::Builder & CreateEventPathsBuilder(); - - /** - * @brief Initialize a AttributeDataVersionList::Builder for writing into the TLV stream - */ - AttributeDataVersionList::Builder & CreateAttributeDataVersionListBuilder(); - - /** - * @brief An initiator can optionally specify an EventNumber it has already to limit the - * set of retrieved events on the server for optimization purposes. - */ - SubscribeRequestMessage::Builder & EventNumber(const uint64_t aEventNumber); - - SubscribeRequestMessage::Builder & MinIntervalSeconds(const uint16_t aMinIntervalSeconds); - - SubscribeRequestMessage::Builder & MaxIntervalSeconds(const uint16_t aMinIntervalSeconds); - /** * @brief This is set to 'true' by the subscriber to indicate preservation of previous subscriptions. If omitted, it implies * 'false' as a value. */ SubscribeRequestMessage::Builder & KeepSubscriptions(const bool aKeepSubscriptions); + SubscribeRequestMessage::Builder & MinIntervalFloorSeconds(const uint16_t aMinIntervalFloorSeconds); + SubscribeRequestMessage::Builder & MaxIntervalCeilingSeconds(const uint16_t aMinIntervalFloorSeconds); + AttributePathIBs::Builder & CreateAttributeRequests(); + EventPaths::Builder & CreateEventRequests(); + EventFilters::Builder & CreateEventFilters(); /** * @brief This is set to true by the subscriber if it is a proxy-type device proxying for another client. This @@ -162,15 +149,21 @@ class Builder : public StructBuilder */ SubscribeRequestMessage::Builder & IsProxy(const bool aIsProxy); + /** + * @brief limits the data written within fabric-scoped lists to the accessing fabric + * @return A reference to *this + */ + SubscribeRequestMessage::Builder & IsFabricFiltered(const bool aIsFabricFiltered); + /** * @brief Mark the end of this SubscribeRequestMessage */ SubscribeRequestMessage::Builder & EndOfSubscribeRequestMessage(); private: - AttributePathIBs::Builder mAttributePathListBuilder; - EventPaths::Builder mEventPathsBuilder; - AttributeDataVersionList::Builder mAttributeDataVersionListBuilder; + AttributePathIBs::Builder mAttributeRequests; + EventPaths::Builder mEventRequests; + EventFilters::Builder mEventFilters; }; } // namespace SubscribeRequestMessage } // namespace app diff --git a/src/app/MessageDef/SubscribeResponseMessage.cpp b/src/app/MessageDef/SubscribeResponseMessage.cpp index 41684d5691edd2..6236e870388a97 100644 --- a/src/app/MessageDef/SubscribeResponseMessage.cpp +++ b/src/app/MessageDef/SubscribeResponseMessage.cpp @@ -88,6 +88,10 @@ CHIP_ERROR SubscribeResponseMessage::Parser::CheckSchemaValidity() const { err = CHIP_NO_ERROR; } + else + { + err = CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE; + } } ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); diff --git a/src/app/MessageDef/WriteRequestMessage.cpp b/src/app/MessageDef/WriteRequestMessage.cpp index e55db722cc9130..ace36b410f5538 100644 --- a/src/app/MessageDef/WriteRequestMessage.cpp +++ b/src/app/MessageDef/WriteRequestMessage.cpp @@ -28,19 +28,15 @@ #include -using namespace chip; -using namespace chip::TLV; - namespace chip { namespace app { #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR WriteRequestMessage::Parser::CheckSchemaValidity() const { - CHIP_ERROR err = CHIP_NO_ERROR; - uint16_t TagPresenceMask = 0; - chip::TLV::TLVReader reader; - AttributeDataIBs::Parser AttributeDataIBs; - AttributeDataVersionList::Parser attributeDataVersionList; + CHIP_ERROR err = CHIP_NO_ERROR; + int TagPresenceMask = 0; + TLV::TLVReader reader; + PRETTY_PRINT("WriteRequestMessage ="); PRETTY_PRINT("{"); @@ -49,130 +45,126 @@ CHIP_ERROR WriteRequestMessage::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrExit(chip::TLV::IsContextTag(reader.GetTag()), err = CHIP_ERROR_INVALID_TLV_TAG); - switch (chip::TLV::TagNumFromTag(reader.GetTag())) + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); + switch (tagNum) { - case kCsTag_SuppressResponse: - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_SuppressResponse)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_SuppressResponse); - VerifyOrExit(chip::TLV::kTLVType_Boolean == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + case to_underlying(Tag::kSuppressResponse): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kSuppressResponse))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kSuppressResponse)); #if CHIP_DETAIL_LOGGING { - bool SuppressResponse; - err = reader.Get(SuppressResponse); - SuccessOrExit(err); - PRETTY_PRINT("\tSuppressResponse = %s, ", SuppressResponse ? "true" : "false"); + bool suppressResponse; + ReturnErrorOnFailure(reader.Get(suppressResponse)); + PRETTY_PRINT("\tsuppressResponse = %s, ", suppressResponse ? "true" : "false"); } #endif // CHIP_DETAIL_LOGGING break; - case kCsTag_AttributeDataIBs: - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_AttributeDataIBs)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributeDataIBs); - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - AttributeDataIBs.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - err = AttributeDataIBs.CheckSchemaValidity(); - SuccessOrExit(err); - - PRETTY_PRINT_DECDEPTH(); + case to_underlying(Tag::kTimedRequest): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kTimedRequest))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kTimedRequest)); +#if CHIP_DETAIL_LOGGING + { + bool timedRequest; + ReturnErrorOnFailure(reader.Get(timedRequest)); + PRETTY_PRINT("\ttimedRequest = %s, ", timedRequest ? "true" : "false"); + } +#endif // CHIP_DETAIL_LOGGING break; - case kCsTag_AttributeDataVersionList: - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_AttributeDataVersionList)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_AttributeDataVersionList); - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - attributeDataVersionList.Init(reader); - - PRETTY_PRINT_INCDEPTH(); - - err = attributeDataVersionList.CheckSchemaValidity(); - SuccessOrExit(err); + case to_underlying(Tag::kWriteRequests): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kWriteRequests))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kWriteRequests)); + { + AttributeDataIBs::Parser writeRequests; + ReturnErrorOnFailure(writeRequests.Init(reader)); - PRETTY_PRINT_DECDEPTH(); + PRETTY_PRINT_INCDEPTH(); + ReturnErrorOnFailure(writeRequests.CheckSchemaValidity()); + PRETTY_PRINT_DECDEPTH(); + } break; - case kCsTag_MoreChunkedMessages: - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_MoreChunkedMessages)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_MoreChunkedMessages); - VerifyOrExit(chip::TLV::kTLVType_Boolean == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + case to_underlying(Tag::kMoreChunkedMessages): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kMoreChunkedMessages))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kMoreChunkedMessages)); #if CHIP_DETAIL_LOGGING { bool moreChunkedMessages; - err = reader.Get(moreChunkedMessages); - SuccessOrExit(err); - PRETTY_PRINT("\tMoreChunkedMessages = %s, ", moreChunkedMessages ? "true" : "false"); + ReturnErrorOnFailure(reader.Get(moreChunkedMessages)); + PRETTY_PRINT("\tmoreChunkedMessages = %s, ", moreChunkedMessages ? "true" : "false"); + } +#endif // CHIP_DETAIL_LOGGING + break; + case to_underlying(Tag::kIsFabricFiltered): + // check if this tag has appeared before + VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kIsFabricFiltered))), CHIP_ERROR_INVALID_TLV_TAG); + TagPresenceMask |= (1 << to_underlying(Tag::kIsFabricFiltered)); +#if CHIP_DETAIL_LOGGING + { + bool isFabricFiltered; + ReturnErrorOnFailure(reader.Get(isFabricFiltered)); + PRETTY_PRINT("\tisFabricFiltered = %s, ", isFabricFiltered ? "true" : "false"); } #endif // CHIP_DETAIL_LOGGING break; default: - ExitNow(err = CHIP_ERROR_INVALID_TLV_TAG); + PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); + break; } } - PRETTY_PRINT("}"); + + PRETTY_PRINT("},"); PRETTY_PRINT(""); - // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - err = CHIP_NO_ERROR; + const int RequiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)) | (1 << to_underlying(Tag::kTimedRequest)) | + (1 << to_underlying(Tag::kWriteRequests)); + + if ((TagPresenceMask & RequiredFields) == RequiredFields) + { + err = CHIP_NO_ERROR; + } + else + { + err = CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE; + } } - SuccessOrExit(err); - err = reader.ExitContainer(mOuterContainerType); -exit: - return err; + ReturnErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR WriteRequestMessage::Parser::GetSuppressResponse(bool * const apSuppressResponse) const { - return GetSimpleValue(kCsTag_SuppressResponse, chip::TLV::kTLVType_Boolean, apSuppressResponse); + return GetSimpleValue(to_underlying(Tag::kSuppressResponse), TLV::kTLVType_Boolean, apSuppressResponse); } -CHIP_ERROR WriteRequestMessage::Parser::GetAttributeReportIBs(AttributeDataIBs::Parser * const apAttributeDataIBs) const +CHIP_ERROR WriteRequestMessage::Parser::GetTimedRequest(bool * const apTimedRequest) const { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::TLV::TLVReader reader; - - err = mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributeDataIBs), reader); - SuccessOrExit(err); - - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = apAttributeDataIBs->Init(reader); - SuccessOrExit(err); - -exit: - ChipLogIfFalse((CHIP_NO_ERROR == err) || (CHIP_END_OF_TLV == err)); - - return err; + return GetSimpleValue(to_underlying(Tag::kTimedRequest), TLV::kTLVType_Boolean, apTimedRequest); } -CHIP_ERROR -WriteRequestMessage::Parser::GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const +CHIP_ERROR WriteRequestMessage::Parser::GetWriteRequests(AttributeDataIBs::Parser * const apAttributeDataIBs) const { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::TLV::TLVReader reader; - - err = mReader.FindElementWithTag(chip::TLV::ContextTag(kCsTag_AttributeDataVersionList), reader); - SuccessOrExit(err); - - VerifyOrExit(chip::TLV::kTLVType_Array == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = apAttributeDataVersionList->Init(reader); - SuccessOrExit(err); - -exit: - ChipLogIfFalse((CHIP_NO_ERROR == err) || (CHIP_END_OF_TLV == err)); - - return err; + TLV::TLVReader reader; + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kWriteRequests)), reader)); + return apAttributeDataIBs->Init(reader); } CHIP_ERROR WriteRequestMessage::Parser::GetMoreChunkedMessages(bool * const apMoreChunkedMessages) const { - return GetSimpleValue(kCsTag_MoreChunkedMessages, chip::TLV::kTLVType_Boolean, apMoreChunkedMessages); + return GetSimpleValue(to_underlying(Tag::kMoreChunkedMessages), TLV::kTLVType_Boolean, apMoreChunkedMessages); +} + +CHIP_ERROR WriteRequestMessage::Parser::GetIsFabricFiltered(bool * const apIsFabricFiltered) const +{ + return GetSimpleValue(to_underlying(Tag::kIsFabricFiltered), TLV::kTLVType_Boolean, apIsFabricFiltered); } WriteRequestMessage::Builder & WriteRequestMessage::Builder::SuppressResponse(const bool aSuppressResponse) @@ -180,38 +172,29 @@ WriteRequestMessage::Builder & WriteRequestMessage::Builder::SuppressResponse(co // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->PutBoolean(chip::TLV::ContextTag(kCsTag_SuppressResponse), aSuppressResponse); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kSuppressResponse)), aSuppressResponse); } return *this; } -AttributeDataIBs::Builder & WriteRequestMessage::Builder::CreateAttributeDataIBsBuilder() +WriteRequestMessage::Builder & WriteRequestMessage::Builder::TimedRequest(const bool aTimedRequest) { // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mAttributeDataIBsBuilder.Init(mpWriter, kCsTag_AttributeDataIBs); - } - else - { - mAttributeDataIBsBuilder.ResetError(mError); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kTimedRequest)), aTimedRequest); } - - return mAttributeDataIBsBuilder; + return *this; } -AttributeDataVersionList::Builder & WriteRequestMessage::Builder::CreateAttributeDataVersionListBuilder() +AttributeDataIBs::Builder & WriteRequestMessage::Builder::CreateWriteRequests() { // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mAttributeDataVersionListBuilder.Init(mpWriter, kCsTag_AttributeDataVersionList); - } - else - { - mAttributeDataVersionListBuilder.ResetError(mError); + mError = mWriteRequests.Init(mpWriter, to_underlying(Tag::kWriteRequests)); } - return mAttributeDataVersionListBuilder; + return mWriteRequests; } WriteRequestMessage::Builder & WriteRequestMessage::Builder::MoreChunkedMessages(const bool aMoreChunkedMessages) @@ -219,14 +202,19 @@ WriteRequestMessage::Builder & WriteRequestMessage::Builder::MoreChunkedMessages // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->PutBoolean(chip::TLV::ContextTag(kCsTag_MoreChunkedMessages), aMoreChunkedMessages); + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kMoreChunkedMessages)), aMoreChunkedMessages); } return *this; } -AttributeDataIBs::Builder & WriteRequestMessage::Builder::GetAttributeReportIBsBuilder() +WriteRequestMessage::Builder & WriteRequestMessage::Builder::IsFabricFiltered(const bool aIsFabricFiltered) { - return mAttributeDataIBsBuilder; + // skip if error has already been set + if (mError == CHIP_NO_ERROR) + { + mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kIsFabricFiltered)), aIsFabricFiltered); + } + return *this; } WriteRequestMessage::Builder & WriteRequestMessage::Builder::EndOfWriteRequestMessage() @@ -234,5 +222,5 @@ WriteRequestMessage::Builder & WriteRequestMessage::Builder::EndOfWriteRequestMe EndOfContainer(); return *this; } -}; // namespace app -}; // namespace chip +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/WriteRequestMessage.h b/src/app/MessageDef/WriteRequestMessage.h index 62abd141885352..53b4b2d63ad9f9 100644 --- a/src/app/MessageDef/WriteRequestMessage.h +++ b/src/app/MessageDef/WriteRequestMessage.h @@ -35,12 +35,13 @@ namespace chip { namespace app { namespace WriteRequestMessage { -enum +enum class Tag : uint8_t { - kCsTag_SuppressResponse = 0, - kCsTag_AttributeDataIBs = 1, - kCsTag_AttributeDataVersionList = 2, - kCsTag_MoreChunkedMessages = 3, + kSuppressResponse = 0, + kTimedRequest = 1, + kWriteRequests = 2, + kMoreChunkedMessages = 3, + kIsFabricFiltered = 4, }; class Parser : public StructParser @@ -60,7 +61,7 @@ class Parser : public StructParser CHIP_ERROR CheckSchemaValidity() const; /** - * @brief Get GetSuppressResponse Next() must be called before accessing them. + * @brief Get SuppressResponse boolean * * @param [in] apSuppressResponse A pointer to apSuppressResponse * @@ -70,27 +71,27 @@ class Parser : public StructParser CHIP_ERROR GetSuppressResponse(bool * const apSuppressResponse) const; /** - * @brief Get a TLVReader for the AttributePathIBs. Next() must be called before accessing them. + * @brief Get TimedRequest boolean * - * @param [in] apAttributeDataIBs A pointer to apAttributeDataIBs + * @param [in] apTimedRequest A pointer to apTimedRequest * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetAttributeReportIBs(AttributeDataIBs::Parser * const apAttributeDataIBs) const; + CHIP_ERROR GetTimedRequest(bool * const apTimedRequest) const; /** - * @brief Get a TLVReader for the AttributeDataVersionList. Next() must be called before accessing them. + * @brief Get a TLVReader for the AttributePathIBs. Next() must be called before accessing them. * - * @param [in] apAttributeDataVersionList A pointer to apAttributeDataVersionList + * @param [in] apAttributeDataIBs A pointer to apAttributeDataIBs * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const; + CHIP_ERROR GetWriteRequests(AttributeDataIBs::Parser * const apAttributeDataIBs) const; /** - * @brief Get MoreChunkedMessages message. Next() must be called before accessing them. + * @brief Get MoreChunkedMessages boolean * * @param [in] apMoreChunkedMessages A pointer to apMoreChunkedMessages * @@ -98,6 +99,16 @@ class Parser : public StructParser * #CHIP_END_OF_TLV if there is no such element */ CHIP_ERROR GetMoreChunkedMessages(bool * const apMoreChunkedMessages) const; + + /** + * @brief Get IsFabricFiltered boolean + * + * @param [in] apIsFabricFiltered A pointer to apIsFabricFiltered + * + * @return #CHIP_NO_ERROR on success + * #CHIP_END_OF_TLV if there is no such element + */ + CHIP_ERROR GetIsFabricFiltered(bool * const apIsFabricFiltered) const; }; class Builder : public StructBuilder @@ -111,18 +122,18 @@ class Builder : public StructBuilder WriteRequestMessage::Builder & SuppressResponse(const bool aSuppressResponse); /** - * @brief Initialize a AttributeDataIBs::Builder for writing into the TLV stream - * - * @return A reference to AttributeDataIBs::Builder + * @brief flag action as part of a timed write transaction + * @param [in] aSuppressResponse true if client need to signal suppress response + * @return A reference to *this */ - AttributeDataIBs::Builder & CreateAttributeDataIBsBuilder(); + WriteRequestMessage::Builder & TimedRequest(const bool aTimedRequest); /** - * @brief Initialize a AttributeDataVersionList::Builder for writing into the TLV stream + * @brief Initialize a AttributeDataIBs::Builder for writing into the TLV stream * - * @return A reference to EventPaths::Builder + * @return A reference to AttributeDataIBs::Builder */ - AttributeDataVersionList::Builder & CreateAttributeDataVersionListBuilder(); + AttributeDataIBs::Builder & CreateWriteRequests(); /** * @brief Set True if the set of AttributeDataIBs have to be sent across multiple packets in a single transaction @@ -131,7 +142,13 @@ class Builder : public StructBuilder */ WriteRequestMessage::Builder & MoreChunkedMessages(const bool aMoreChunkedMessages); - AttributeDataIBs::Builder & GetAttributeReportIBsBuilder(); + AttributeDataIBs::Builder & GetWriteRequests() { return mWriteRequests; }; + + /** + * @brief limits the data written within fabric-scoped lists to the accessing fabric + * @return A reference to *this + */ + WriteRequestMessage::Builder & IsFabricFiltered(const bool aIsFabricFiltered); /** * @brief Mark the end of this WriteRequestMessage @@ -141,9 +158,8 @@ class Builder : public StructBuilder WriteRequestMessage::Builder & EndOfWriteRequestMessage(); private: - AttributeDataIBs::Builder mAttributeDataIBsBuilder; - AttributeDataVersionList::Builder mAttributeDataVersionListBuilder; + AttributeDataIBs::Builder mWriteRequests; }; -}; // namespace WriteRequestMessage -}; // namespace app -}; // namespace chip +} // namespace WriteRequestMessage +} // namespace app +} // namespace chip diff --git a/src/app/MessageDef/WriteResponseMessage.cpp b/src/app/MessageDef/WriteResponseMessage.cpp index 00e51a3d3a8a64..a616783e761638 100644 --- a/src/app/MessageDef/WriteResponseMessage.cpp +++ b/src/app/MessageDef/WriteResponseMessage.cpp @@ -71,11 +71,14 @@ CHIP_ERROR WriteResponseMessage::Parser::CheckSchemaValidity() const { err = CHIP_NO_ERROR; } + else + { + err = CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE; + } } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -83,8 +86,7 @@ CHIP_ERROR WriteResponseMessage::Parser::GetWriteResponses(AttributeStatuses::Pa { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kWriteResponses)), reader)); - ReturnErrorOnFailure(apWriteResponses->Init(reader)); - return CHIP_NO_ERROR; + return apWriteResponses->Init(reader); } AttributeStatuses::Builder & WriteResponseMessage::Builder::CreateWriteResponses() diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 46e90dcee8c554..39011bca46dc27 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -139,28 +139,34 @@ CHIP_ERROR ReadClient::SendReadRequest(ReadPrepareParams & aReadPrepareParams) if (aReadPrepareParams.mEventPathParamsListSize != 0 && aReadPrepareParams.mpEventPathParamsList != nullptr) { - EventPaths::Builder & eventPathListBuilder = request.CreateEventPathsBuilder(); + EventPaths::Builder & eventPathListBuilder = request.CreateEventRequests(); SuccessOrExit(err = eventPathListBuilder.GetError()); err = GenerateEventPaths(eventPathListBuilder, aReadPrepareParams.mpEventPathParamsList, aReadPrepareParams.mEventPathParamsListSize); SuccessOrExit(err); if (aReadPrepareParams.mEventNumber != 0) { - // EventNumber is optional - request.EventNumber(aReadPrepareParams.mEventNumber); + // EventFilter is optional + EventFilters::Builder eventFilters = request.CreateEventFilters(); + SuccessOrExit(err = request.GetError()); + EventFilterIB::Builder eventFilter = eventFilters.CreateEventFilter(); + eventFilter.EventMin(aReadPrepareParams.mEventNumber).EndOfEventFilterIB(); + SuccessOrExit(err = eventFilter.GetError()); + eventFilters.EndOfEventFilters(); + SuccessOrExit(err = eventFilters.GetError()); } } if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) { - AttributePathIBs::Builder attributePathListBuilder = request.CreateAttributePathListBuilder(); + AttributePathIBs::Builder attributePathListBuilder = request.CreateAttributeRequests(); SuccessOrExit(err = attributePathListBuilder.GetError()); err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, aReadPrepareParams.mAttributePathParamsListSize); SuccessOrExit(err); } - request.EndOfReadRequestMessage(); + request.IsFabricFiltered(false).EndOfReadRequestMessage(); SuccessOrExit(err = request.GetError()); err = writer.Finalize(&msgBuf); @@ -585,7 +591,7 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara if (aReadPrepareParams.mEventPathParamsListSize != 0 && aReadPrepareParams.mpEventPathParamsList != nullptr) { - EventPaths::Builder & eventPathListBuilder = request.CreateEventPathsBuilder(); + EventPaths::Builder & eventPathListBuilder = request.CreateEventRequests(); SuccessOrExit(err = eventPathListBuilder.GetError()); err = GenerateEventPaths(eventPathListBuilder, aReadPrepareParams.mpEventPathParamsList, aReadPrepareParams.mEventPathParamsListSize); @@ -594,13 +600,19 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara if (aReadPrepareParams.mEventNumber != 0) { // EventNumber is optional - request.EventNumber(aReadPrepareParams.mEventNumber); + EventFilters::Builder eventFilters = request.CreateEventFilters(); + SuccessOrExit(err = request.GetError()); + EventFilterIB::Builder eventFilter = eventFilters.CreateEventFilter(); + eventFilter.EventMin(aReadPrepareParams.mEventNumber).EndOfEventFilterIB(); + SuccessOrExit(err = eventFilter.GetError()); + eventFilters.EndOfEventFilters(); + SuccessOrExit(err = eventFilters.GetError()); } } if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) { - AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributePathListBuilder(); + AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); SuccessOrExit(err = attributePathListBuilder.GetError()); err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, aReadPrepareParams.mAttributePathParamsListSize); @@ -609,9 +621,10 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara VerifyOrExit(aReadPrepareParams.mMinIntervalFloorSeconds < aReadPrepareParams.mMaxIntervalCeilingSeconds, err = CHIP_ERROR_INVALID_ARGUMENT); - request.MinIntervalSeconds(aReadPrepareParams.mMinIntervalFloorSeconds) - .MaxIntervalSeconds(aReadPrepareParams.mMaxIntervalCeilingSeconds) + request.MinIntervalFloorSeconds(aReadPrepareParams.mMinIntervalFloorSeconds) + .MaxIntervalCeilingSeconds(aReadPrepareParams.mMaxIntervalCeilingSeconds) .KeepSubscriptions(aReadPrepareParams.mKeepSubscriptions) + .IsFabricFiltered(false) .EndOfSubscribeRequestMessage(); SuccessOrExit(err = request.GetError()); diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 48f6c1c80ccbe5..94e868dad6e1d7 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -274,7 +274,7 @@ CHIP_ERROR ReadHandler::ProcessReadRequest(System::PacketBufferHandle && aPayloa SuccessOrExit(err); #endif - err = readRequestParser.GetPathList(&attributePathListParser); + err = readRequestParser.GetAttributeRequests(&attributePathListParser); if (err == CHIP_END_OF_TLV) { err = CHIP_NO_ERROR; @@ -285,7 +285,7 @@ CHIP_ERROR ReadHandler::ProcessReadRequest(System::PacketBufferHandle && aPayloa err = ProcessAttributePathList(attributePathListParser); } SuccessOrExit(err); - err = readRequestParser.GetEventPaths(&eventPathListParser); + err = readRequestParser.GetEventRequests(&eventPathListParser); if (err == CHIP_END_OF_TLV) { err = CHIP_NO_ERROR; @@ -549,7 +549,7 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP #endif AttributePathIBs::Parser attributePathListParser; - CHIP_ERROR err = subscribeRequestParser.GetPathList(&attributePathListParser); + CHIP_ERROR err = subscribeRequestParser.GetAttributeRequests(&attributePathListParser); if (err == CHIP_END_OF_TLV) { err = CHIP_NO_ERROR; @@ -561,7 +561,7 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP ReturnErrorOnFailure(err); EventPaths::Parser eventPathListParser; - err = subscribeRequestParser.GetEventPaths(&eventPathListParser); + err = subscribeRequestParser.GetEventRequests(&eventPathListParser); if (err == CHIP_END_OF_TLV) { err = CHIP_NO_ERROR; @@ -572,9 +572,10 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(subscribeRequestParser.GetMinIntervalSeconds(&mMinIntervalFloorSeconds)); - ReturnErrorOnFailure(subscribeRequestParser.GetMaxIntervalSeconds(&mMaxIntervalCeilingSeconds)); + ReturnErrorOnFailure(subscribeRequestParser.GetMinIntervalFloorSeconds(&mMinIntervalFloorSeconds)); + ReturnErrorOnFailure(subscribeRequestParser.GetMaxIntervalCeilingSeconds(&mMaxIntervalCeilingSeconds)); VerifyOrReturnError(mMinIntervalFloorSeconds < mMaxIntervalCeilingSeconds, CHIP_ERROR_INVALID_ARGUMENT); + ReturnErrorOnFailure(subscribeRequestParser.GetIsFabricFiltered(&mIsFabricFiltered)); ReturnErrorOnFailure(Crypto::DRBG_get_bytes(reinterpret_cast(&mSubscriptionId), sizeof(mSubscriptionId))); MoveToState(HandlerState::GeneratingReports); diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index 7f1e644832b0dc..fd1aa040ff54e5 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -208,6 +208,7 @@ class ReadHandler : public Messaging::ExchangeDelegate NodeId mInitiatorNodeId = kUndefinedNodeId; FabricIndex mFabricIndex = 0; AttributePathExpandIterator mAttributePathExpandIterator = AttributePathExpandIterator(nullptr); + bool mIsFabricFiltered = false; }; } // namespace app } // namespace chip diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index 60d56a73551215..f540ac75116a8b 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -36,16 +36,17 @@ CHIP_ERROR WriteClient::Init(Messaging::ExchangeManager * apExchangeMgr, Callbac VerifyOrReturnError(mpExchangeMgr == nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mpExchangeCtx == nullptr, CHIP_ERROR_INCORRECT_STATE); - AttributeDataIBs::Builder AttributeDataIBsBuilder; + AttributeDataIBs::Builder attributeDataIBsBuilder; System::PacketBufferHandle packet = System::PacketBufferHandle::New(chip::app::kMaxSecureSduLengthBytes); VerifyOrReturnError(!packet.IsNull(), CHIP_ERROR_NO_MEMORY); mMessageWriter.Init(std::move(packet)); ReturnErrorOnFailure(mWriteRequestBuilder.Init(&mMessageWriter)); - - AttributeDataIBsBuilder = mWriteRequestBuilder.CreateAttributeDataIBsBuilder(); - ReturnErrorOnFailure(AttributeDataIBsBuilder.GetError()); + mWriteRequestBuilder.TimedRequest(false).IsFabricFiltered(false); + ReturnErrorOnFailure(mWriteRequestBuilder.GetError()); + attributeDataIBsBuilder = mWriteRequestBuilder.CreateWriteRequests(); + ReturnErrorOnFailure(attributeDataIBsBuilder.GetError()); ClearExistingExchangeContext(); mpExchangeMgr = apExchangeMgr; @@ -137,7 +138,7 @@ CHIP_ERROR WriteClient::PrepareAttribute(const AttributePathParams & attributePa { CHIP_ERROR err = CHIP_NO_ERROR; - AttributeDataIB::Builder AttributeDataIB = mWriteRequestBuilder.GetAttributeReportIBsBuilder().CreateAttributeDataIBBuilder(); + AttributeDataIB::Builder AttributeDataIB = mWriteRequestBuilder.GetWriteRequests().CreateAttributeDataIBBuilder(); SuccessOrExit(AttributeDataIB.GetError()); err = ConstructAttributePath(attributePathParams, AttributeDataIB); @@ -149,7 +150,7 @@ CHIP_ERROR WriteClient::FinishAttribute() { CHIP_ERROR err = CHIP_NO_ERROR; - AttributeDataIB::Builder AttributeDataIB = mWriteRequestBuilder.GetAttributeReportIBsBuilder().GetAttributeDataIBBuilder(); + AttributeDataIB::Builder AttributeDataIB = mWriteRequestBuilder.GetWriteRequests().GetAttributeDataIBBuilder(); // TODO: Add attribute version support AttributeDataIB.DataVersion(0); @@ -163,7 +164,7 @@ CHIP_ERROR WriteClient::FinishAttribute() TLV::TLVWriter * WriteClient::GetAttributeDataIBTLVWriter() { - return mWriteRequestBuilder.GetAttributeReportIBsBuilder().GetAttributeDataIBBuilder().GetWriter(); + return mWriteRequestBuilder.GetWriteRequests().GetAttributeDataIBBuilder().GetWriter(); } CHIP_ERROR WriteClient::ConstructAttributePath(const AttributePathParams & aAttributePathParams, @@ -180,7 +181,7 @@ CHIP_ERROR WriteClient::FinalizeMessage(System::PacketBufferHandle & aPacket) CHIP_ERROR err = CHIP_NO_ERROR; AttributeDataIBs::Builder AttributeDataIBsBuilder; VerifyOrExit(mState == State::AddAttribute, err = CHIP_ERROR_INCORRECT_STATE); - AttributeDataIBsBuilder = mWriteRequestBuilder.GetAttributeReportIBsBuilder().EndOfAttributeDataIBs(); + AttributeDataIBsBuilder = mWriteRequestBuilder.GetWriteRequests().EndOfAttributeDataIBs(); err = AttributeDataIBsBuilder.GetError(); SuccessOrExit(err); diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index c6533f28844969..ea3ac088abe026 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -202,7 +202,13 @@ CHIP_ERROR WriteHandler::ProcessWriteRequest(System::PacketBufferHandle && aPayl } SuccessOrExit(err); - err = writeRequestParser.GetAttributeReportIBs(&AttributeDataIBsParser); + err = writeRequestParser.GetTimedRequest(&mIsTimedRequest); + SuccessOrExit(err); + + err = writeRequestParser.GetIsFabricFiltered(&mIsFabricFiltered); + SuccessOrExit(err); + + err = writeRequestParser.GetWriteRequests(&AttributeDataIBsParser); SuccessOrExit(err); AttributeDataIBsParser.GetReader(&AttributeDataIBsReader); err = ProcessAttributeDataIBs(AttributeDataIBsReader); diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index 7d0edd139f085e..46ff424ebfbf5e 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -109,7 +109,9 @@ class WriteHandler Messaging::ExchangeContext * mpExchangeCtx = nullptr; WriteResponseMessage::Builder mWriteResponseBuilder; System::PacketBufferTLVWriter mMessageWriter; - State mState = State::Uninitialized; + State mState = State::Uninitialized; + bool mIsTimedRequest = false; + bool mIsFabricFiltered = false; }; } // namespace app } // namespace chip diff --git a/src/app/tests/TestMessageDef.cpp b/src/app/tests/TestMessageDef.cpp index 7c4d94e9c6b4b6..b83bf0739cc407 100644 --- a/src/app/tests/TestMessageDef.cpp +++ b/src/app/tests/TestMessageDef.cpp @@ -139,11 +139,9 @@ void ParseEventFilters(nlTestSuite * apSuite, chip::TLV::TLVReader & aReader) { CHIP_ERROR err = CHIP_NO_ERROR; EventFilters::Parser eventFiltersParser; - AttributePathIB::Parser attributePathParser; err = eventFiltersParser.Init(aReader); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK err = eventFiltersParser.CheckSchemaValidity(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -1028,19 +1026,19 @@ void BuildReadRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWrit err = readRequestBuilder.Init(&aWriter); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributePathIBs::Builder AttributePathIBs = readRequestBuilder.CreateAttributePathListBuilder(); + AttributePathIBs::Builder AttributePathIBs = readRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); BuildAttributePathList(apSuite, AttributePathIBs); - EventPaths::Builder eventPathList = readRequestBuilder.CreateEventPathsBuilder(); + EventPaths::Builder eventPathList = readRequestBuilder.CreateEventRequests(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); BuildEventPaths(apSuite, eventPathList); - AttributeDataVersionList::Builder attributeDataVersionList = readRequestBuilder.CreateAttributeDataVersionListBuilder(); + EventFilters::Builder eventFilters = readRequestBuilder.CreateEventFilters(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildAttributeDataVersionList(apSuite, attributeDataVersionList); + BuildEventFilters(apSuite, eventFilters); - readRequestBuilder.EventNumber(1); + readRequestBuilder.IsFabricFiltered(true); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); readRequestBuilder.EndOfReadRequestMessage(); @@ -1054,8 +1052,8 @@ void ParseReadRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & aRead ReadRequestMessage::Parser readRequestParser; AttributePathIBs::Parser attributePathListParser; EventPaths::Parser eventPathListParser; - AttributeDataVersionList::Parser attributeDataVersionListParser; - uint64_t eventNumber; + EventFilters::Parser eventFiltersParser; + bool isFabricFiltered = false; err = readRequestParser.Init(aReader); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -1063,17 +1061,17 @@ void ParseReadRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & aRead err = readRequestParser.CheckSchemaValidity(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); #endif - err = readRequestParser.GetPathList(&attributePathListParser); + err = readRequestParser.GetAttributeRequests(&attributePathListParser); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = readRequestParser.GetEventPaths(&eventPathListParser); + err = readRequestParser.GetEventRequests(&eventPathListParser); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = readRequestParser.GetAttributeDataVersionList(&attributeDataVersionListParser); + err = readRequestParser.GetEventFilters(&eventFiltersParser); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = readRequestParser.GetEventNumber(&eventNumber); - NL_TEST_ASSERT(apSuite, eventNumber == 1 && err == CHIP_NO_ERROR); + err = readRequestParser.GetIsFabricFiltered(&isFabricFiltered); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && isFabricFiltered); } void BuildWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWriter) @@ -1087,17 +1085,19 @@ void BuildWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWri writeRequestBuilder.SuppressResponse(true); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); - AttributeDataIBs::Builder AttributeDataIBs = writeRequestBuilder.CreateAttributeDataIBsBuilder(); + writeRequestBuilder.TimedRequest(true); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildAttributeDataIBs(apSuite, AttributeDataIBs); - AttributeDataVersionList::Builder attributeDataVersionList = writeRequestBuilder.CreateAttributeDataVersionListBuilder(); + AttributeDataIBs::Builder AttributeDataIBs = writeRequestBuilder.CreateWriteRequests(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildAttributeDataVersionList(apSuite, attributeDataVersionList); + BuildAttributeDataIBs(apSuite, AttributeDataIBs); writeRequestBuilder.MoreChunkedMessages(true); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); + writeRequestBuilder.IsFabricFiltered(true); + NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); + writeRequestBuilder.EndOfWriteRequestMessage(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); } @@ -1108,9 +1108,10 @@ void ParseWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & aRea WriteRequestMessage::Parser writeRequestParser; bool suppressResponse = false; - AttributeDataIBs::Parser AttributeDataIBs; - AttributeDataVersionList::Parser attributeDataVersionList; + bool timeRequest = false; + AttributeDataIBs::Parser writeRequests; bool moreChunkedMessages = false; + bool isFabricFiltered = false; err = writeRequestParser.Init(aReader); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -1121,14 +1122,17 @@ void ParseWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & aRea err = writeRequestParser.GetSuppressResponse(&suppressResponse); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && suppressResponse); - err = writeRequestParser.GetAttributeReportIBs(&AttributeDataIBs); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = writeRequestParser.GetTimedRequest(&timeRequest); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && timeRequest); - err = writeRequestParser.GetAttributeDataVersionList(&attributeDataVersionList); + err = writeRequestParser.GetWriteRequests(&writeRequests); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = writeRequestParser.GetMoreChunkedMessages(&moreChunkedMessages); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && moreChunkedMessages); + + err = writeRequestParser.GetIsFabricFiltered(&isFabricFiltered); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && isFabricFiltered); } void BuildWriteResponseMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWriter) @@ -1171,25 +1175,22 @@ void BuildSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & err = subscribeRequestBuilder.Init(&aWriter); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributePathIBs::Builder AttributePathIBs = subscribeRequestBuilder.CreateAttributePathListBuilder(); + AttributePathIBs::Builder attributePathIBs = subscribeRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildAttributePathList(apSuite, AttributePathIBs); + BuildAttributePathList(apSuite, attributePathIBs); - EventPaths::Builder eventPathList = subscribeRequestBuilder.CreateEventPathsBuilder(); + EventPaths::Builder eventPathList = subscribeRequestBuilder.CreateEventRequests(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); BuildEventPaths(apSuite, eventPathList); - AttributeDataVersionList::Builder attributeDataVersionList = subscribeRequestBuilder.CreateAttributeDataVersionListBuilder(); + EventFilters::Builder eventFilters = subscribeRequestBuilder.CreateEventFilters(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildAttributeDataVersionList(apSuite, attributeDataVersionList); + BuildEventFilters(apSuite, eventFilters); - subscribeRequestBuilder.EventNumber(1); + subscribeRequestBuilder.MinIntervalFloorSeconds(2); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - subscribeRequestBuilder.MinIntervalSeconds(2); - NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - - subscribeRequestBuilder.MaxIntervalSeconds(3); + subscribeRequestBuilder.MaxIntervalCeilingSeconds(3); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); subscribeRequestBuilder.KeepSubscriptions(true); @@ -1198,6 +1199,9 @@ void BuildSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & subscribeRequestBuilder.IsProxy(true); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + subscribeRequestBuilder.IsFabricFiltered(true); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + subscribeRequestBuilder.EndOfSubscribeRequestMessage(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); } @@ -1209,12 +1213,12 @@ void ParseSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & SubscribeRequestMessage::Parser subscribeRequestParser; AttributePathIBs::Parser attributePathListParser; EventPaths::Parser eventPathListParser; - AttributeDataVersionList::Parser attributeDataVersionListParser; - uint64_t eventNumber = 0; - uint16_t minIntervalSeconds = 0; - uint16_t maxIntervalSeconds = 0; - bool keepExistingSubscription = false; - bool isProxy = false; + EventFilters::Parser eventFiltersParser; + uint16_t MinIntervalFloorSeconds = 0; + uint16_t MaxIntervalCeilingSeconds = 0; + bool keepExistingSubscription = false; + bool isProxy = false; + bool isFabricFiltered = false; err = subscribeRequestParser.Init(aReader); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -1222,29 +1226,29 @@ void ParseSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & err = subscribeRequestParser.CheckSchemaValidity(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); #endif - err = subscribeRequestParser.GetPathList(&attributePathListParser); + err = subscribeRequestParser.GetAttributeRequests(&attributePathListParser); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = subscribeRequestParser.GetEventPaths(&eventPathListParser); + err = subscribeRequestParser.GetEventRequests(&eventPathListParser); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = subscribeRequestParser.GetAttributeDataVersionList(&attributeDataVersionListParser); + err = subscribeRequestParser.GetEventFilters(&eventFiltersParser); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = subscribeRequestParser.GetEventNumber(&eventNumber); - NL_TEST_ASSERT(apSuite, eventNumber == 1 && err == CHIP_NO_ERROR); + err = subscribeRequestParser.GetMinIntervalFloorSeconds(&MinIntervalFloorSeconds); + NL_TEST_ASSERT(apSuite, MinIntervalFloorSeconds == 2 && err == CHIP_NO_ERROR); - err = subscribeRequestParser.GetMinIntervalSeconds(&minIntervalSeconds); - NL_TEST_ASSERT(apSuite, minIntervalSeconds == 2 && err == CHIP_NO_ERROR); - - err = subscribeRequestParser.GetMaxIntervalSeconds(&maxIntervalSeconds); - NL_TEST_ASSERT(apSuite, maxIntervalSeconds == 3 && err == CHIP_NO_ERROR); + err = subscribeRequestParser.GetMaxIntervalCeilingSeconds(&MaxIntervalCeilingSeconds); + NL_TEST_ASSERT(apSuite, MaxIntervalCeilingSeconds == 3 && err == CHIP_NO_ERROR); err = subscribeRequestParser.GetKeepSubscriptions(&keepExistingSubscription); NL_TEST_ASSERT(apSuite, keepExistingSubscription && err == CHIP_NO_ERROR); err = subscribeRequestParser.GetIsProxy(&isProxy); NL_TEST_ASSERT(apSuite, isProxy && err == CHIP_NO_ERROR); + + err = subscribeRequestParser.GetIsFabricFiltered(&isFabricFiltered); + NL_TEST_ASSERT(apSuite, isFabricFiltered && err == CHIP_NO_ERROR); } void BuildSubscribeResponseMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWriter) @@ -1339,7 +1343,6 @@ void EventFilterTest(nlTestSuite * apSuite, void * apContext) reader.Init(std::move(buf)); err = reader.Next(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - ParseEventFilterIB(apSuite, reader); } @@ -1349,7 +1352,7 @@ void EventFiltersTest(nlTestSuite * apSuite, void * apContext) chip::System::PacketBufferTLVWriter writer; chip::System::PacketBufferTLVReader reader; EventFilters::Builder eventFiltersBuilder; - + EventFilters::Parser eventFiltersParser; writer.Init(chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSize)); err = eventFiltersBuilder.Init(&writer); diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 2e9fc4b4b2aa78..1650980bea9332 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -417,7 +417,7 @@ void TestReadInteraction::TestReadHandler(nlTestSuite * apSuite, void * apContex err = readRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributePathIBs::Builder attributePathListBuilder = readRequestBuilder.CreateAttributePathListBuilder(); + AttributePathIBs::Builder attributePathListBuilder = readRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, attributePathListBuilder.GetError() == CHIP_NO_ERROR); AttributePathIB::Builder attributePathBuilder = attributePathListBuilder.CreateAttributePath(); @@ -432,7 +432,7 @@ void TestReadInteraction::TestReadHandler(nlTestSuite * apSuite, void * apContex NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); - readRequestBuilder.EndOfReadRequestMessage(); + readRequestBuilder.IsFabricFiltered(false).EndOfReadRequestMessage(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&readRequestbuf); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -466,7 +466,7 @@ void TestReadInteraction::TestReadClientGenerateAttributePathList(nlTestSuite * attributePathParams[0].mAttributeId = 0; attributePathParams[1].mAttributeId = 0; attributePathParams[1].mListIndex = 0; - AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributePathListBuilder(); + AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); err = readClient.GenerateAttributePathList(attributePathListBuilder, attributePathParams, 2 /*aAttributePathParamsListSize*/); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } @@ -492,7 +492,7 @@ void TestReadInteraction::TestReadClientGenerateInvalidAttributePathList(nlTestS AttributePathParams attributePathParams[2]; attributePathParams[0].mAttributeId = 0; attributePathParams[1].mListIndex = 0; - AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributePathListBuilder(); + AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); err = readClient.GenerateAttributePathList(attributePathListBuilder, attributePathParams, 2 /*aAttributePathParamsListSize*/); NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); } @@ -546,7 +546,7 @@ void TestReadInteraction::TestReadHandlerInvalidAttributePath(nlTestSuite * apSu err = readRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributePathIBs::Builder attributePathListBuilder = readRequestBuilder.CreateAttributePathListBuilder(); + AttributePathIBs::Builder attributePathListBuilder = readRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, attributePathListBuilder.GetError() == CHIP_NO_ERROR); AttributePathIB::Builder attributePathBuilder = attributePathListBuilder.CreateAttributePath(); @@ -556,8 +556,9 @@ void TestReadInteraction::TestReadHandlerInvalidAttributePath(nlTestSuite * apSu err = attributePathBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); - readRequestBuilder.EndOfReadRequestMessage(); + attributePathListBuilder.EndOfAttributePathIBs(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + readRequestBuilder.IsFabricFiltered(false).EndOfReadRequestMessage(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&readRequestbuf); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -593,11 +594,11 @@ void TestReadInteraction::TestReadClientGenerateOneEventPaths(nlTestSuite * apSu eventPathParams[0].mClusterId = 3; eventPathParams[0].mEventId = 4; - EventPaths::Builder & eventPathListBuilder = request.CreateEventPathsBuilder(); + EventPaths::Builder & eventPathListBuilder = request.CreateEventRequests(); err = readClient.GenerateEventPaths(eventPathListBuilder, eventPathParams, 1 /*aEventPathParamsListSize*/); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - request.EndOfReadRequestMessage(); + request.IsFabricFiltered(false).EndOfReadRequestMessage(); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == request.GetError()); err = writer.Finalize(&msgBuf); @@ -647,11 +648,11 @@ void TestReadInteraction::TestReadClientGenerateTwoEventPaths(nlTestSuite * apSu eventPathParams[1].mClusterId = 3; eventPathParams[1].mEventId = 5; - EventPaths::Builder & eventPathListBuilder = request.CreateEventPathsBuilder(); + EventPaths::Builder & eventPathListBuilder = request.CreateEventRequests(); err = readClient.GenerateEventPaths(eventPathListBuilder, eventPathParams, 2 /*aEventPathParamsListSize*/); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - request.EndOfReadRequestMessage(); + request.IsFabricFiltered(false).EndOfReadRequestMessage(); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == request.GetError()); err = writer.Finalize(&msgBuf); @@ -948,7 +949,7 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi err = subscribeRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributePathIBs::Builder attributePathListBuilder = subscribeRequestBuilder.CreateAttributePathListBuilder(); + AttributePathIBs::Builder attributePathListBuilder = subscribeRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, attributePathListBuilder.GetError() == CHIP_NO_ERROR); AttributePathIB::Builder attributePathBuilder = attributePathListBuilder.CreateAttributePath(); @@ -962,10 +963,10 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi err = attributePathListBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - subscribeRequestBuilder.MinIntervalSeconds(2); + subscribeRequestBuilder.MinIntervalFloorSeconds(2); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - subscribeRequestBuilder.MaxIntervalSeconds(3); + subscribeRequestBuilder.MaxIntervalCeilingSeconds(3); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); subscribeRequestBuilder.KeepSubscriptions(true); @@ -974,7 +975,7 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi subscribeRequestBuilder.IsProxy(true); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - subscribeRequestBuilder.EndOfSubscribeRequestMessage(); + subscribeRequestBuilder.IsFabricFiltered(false).EndOfSubscribeRequestMessage(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); diff --git a/src/app/tests/TestReportingEngine.cpp b/src/app/tests/TestReportingEngine.cpp index a3b935f386375f..c3776b596166e4 100644 --- a/src/app/tests/TestReportingEngine.cpp +++ b/src/app/tests/TestReportingEngine.cpp @@ -85,7 +85,7 @@ void TestReportingEngine::TestBuildAndSendSingleReportData(nlTestSuite * apSuite writer.Init(std::move(readRequestbuf)); err = readRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - attributePathListBuilder = readRequestBuilder.CreateAttributePathListBuilder(); + attributePathListBuilder = readRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); attributePathBuilder = attributePathListBuilder.CreateAttributePath(); NL_TEST_ASSERT(apSuite, attributePathListBuilder.GetError() == CHIP_NO_ERROR); @@ -107,7 +107,7 @@ void TestReportingEngine::TestBuildAndSendSingleReportData(nlTestSuite * apSuite attributePathListBuilder.EndOfAttributePathIBs(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); - readRequestBuilder.EndOfReadRequestMessage(); + readRequestBuilder.IsFabricFiltered(false).EndOfReadRequestMessage(); NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&readRequestbuf); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index fd83dd21491365..24c6ee82efb557 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -124,7 +124,7 @@ void TestWriteInteraction::GenerateWriteRequest(nlTestSuite * apSuite, void * ap WriteRequestMessage::Builder writeRequestBuilder; err = writeRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributeDataIBs::Builder attributeDataIBsBuilder = writeRequestBuilder.CreateAttributeDataIBsBuilder(); + AttributeDataIBs::Builder attributeDataIBsBuilder = writeRequestBuilder.CreateWriteRequests(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); AttributeDataIB::Builder attributeDataIBBuilder = attributeDataIBsBuilder.CreateAttributeDataIBBuilder(); NL_TEST_ASSERT(apSuite, attributeDataIBsBuilder.GetError() == CHIP_NO_ERROR); @@ -155,7 +155,7 @@ void TestWriteInteraction::GenerateWriteRequest(nlTestSuite * apSuite, void * ap attributeDataIBsBuilder.EndOfAttributeDataIBs(); NL_TEST_ASSERT(apSuite, attributeDataIBsBuilder.GetError() == CHIP_NO_ERROR); - writeRequestBuilder.EndOfWriteRequestMessage(); + writeRequestBuilder.TimedRequest(false).IsFabricFiltered(false).EndOfWriteRequestMessage(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&aPayload); diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index edec0415c29220..9e41fa862f9e1f 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -663,10 +663,25 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) desc = "Malformed Interaction Model Invoke Response Message"; break; case CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE.AsInteger(): - desc = "Malformed Interaction Model Invoke Response MESSAGE"; + desc = "Malformed Interaction Model Invoke Response Message"; break; case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE.AsInteger(): - desc = "Malformed Interaction Model Attribute Report MESSAGE"; + desc = "Malformed Interaction Model Attribute Report Message"; + break; + case CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Write Request Message"; + break; + case CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Write Response Message"; + break; + case CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Read Request Message"; + break; + case CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Subscribe Request Message"; + break; + case CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Subscribe Response Message"; break; } #endif // !CHIP_CONFIG_SHORT_ERROR_STR diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index f101c2478b68bb..b2f7bc541f4224 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -2261,6 +2261,50 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE CHIP_CORE_ERROR(0xcf) +/** + * @def CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE + * + * @brief + * The WriteRequestMessage is malformed: it either does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd0) + +/** + * @def CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE + * + * @brief + * The WriteResponseMessage is malformed: it either does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xd1) + +/** + * @def CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE + * + * @brief + * The ReadRequestMessage is malformed: it either does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd2) + +/** + * @def CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE + * + * @brief + * The SubscribeRequestMessage is malformed: it either does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd3) + +/** + * @def CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE + * + * @brief + * The SubscribeResponseMessage is malformed: it either does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xd4) /** * @} */ From bd4515cd5aee80a7c50e99c36f521e73d0d9b132 Mon Sep 17 00:00:00 2001 From: Austin Hsieh <77706079+austinh0@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:21:01 -0800 Subject: [PATCH 4/5] [Android] Use InvokeCommand and support nullable/optional for commands (#11873) * Use InvokeCommand and support nullable/optional for commands. * Regenerate * Restyled by whitespace * Restyled by clang-format * Account for array/struct in encode_value/decode_value. * Add TODO for if_is_struct Co-authored-by: Restyled.io --- src/controller/java/BUILD.gn | 2 + .../java/templates/CHIPCallbackTypes.zapt | 14 + .../java/templates/CHIPClusters-JNI.zapt | 166 +- .../templates/CHIPInvokeCallbacks-src.zapt | 76 + .../java/templates/CHIPInvokeCallbacks.zapt | 29 + .../java/templates/ChipClusters-java.zapt | 60 +- .../java/templates/ClusterInfo-java.zapt | 44 +- src/controller/java/templates/helper.js | 38 +- .../templates/partials/command_arguments.zapt | 13 + .../partials/command_callback_responses.zapt | 19 + .../java/templates/partials/decode_value.zapt | 33 + .../java/templates/partials/encode_value.zapt | 75 + .../list_attribute_callback_type.zapt | 36 + src/controller/java/templates/templates.json | 43 +- .../java/zap-generated/CHIPCallbackTypes.h | 176 + .../java/zap-generated/CHIPClusters-JNI.cpp | 15602 +++++----------- .../zap-generated/CHIPInvokeCallbacks.cpp | 5250 ++++++ .../java/zap-generated/CHIPInvokeCallbacks.h | 1139 ++ .../chip/devicecontroller/ChipClusters.java | 1403 +- .../devicecontroller/ClusterInfoMapping.java | 245 +- src/lib/support/JniReferences.cpp | 57 + src/lib/support/JniReferences.h | 41 +- src/lib/support/JniTypeWrappers.h | 30 +- 23 files changed, 12308 insertions(+), 12283 deletions(-) create mode 100644 src/controller/java/templates/CHIPCallbackTypes.zapt create mode 100644 src/controller/java/templates/CHIPInvokeCallbacks-src.zapt create mode 100644 src/controller/java/templates/CHIPInvokeCallbacks.zapt create mode 100644 src/controller/java/templates/partials/command_arguments.zapt create mode 100644 src/controller/java/templates/partials/command_callback_responses.zapt create mode 100644 src/controller/java/templates/partials/decode_value.zapt create mode 100644 src/controller/java/templates/partials/encode_value.zapt create mode 100644 src/controller/java/templates/partials/list_attribute_callback_type.zapt create mode 100644 src/controller/java/zap-generated/CHIPCallbackTypes.h create mode 100644 src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp create mode 100644 src/controller/java/zap-generated/CHIPInvokeCallbacks.h diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 52e7ac01b344f9..911ebb12ad275c 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -34,6 +34,8 @@ shared_library("jni") { "CHIPDeviceController-JNI.cpp", "zap-generated/CHIPClusters-JNI.cpp", "zap-generated/CHIPClustersRead-JNI.cpp", + "zap-generated/CHIPInvokeCallbacks.cpp", + "zap-generated/CHIPInvokeCallbacks.h", "zap-generated/CHIPReadCallbacks.cpp", "zap-generated/CHIPReadCallbacks.h", ] diff --git a/src/controller/java/templates/CHIPCallbackTypes.zapt b/src/controller/java/templates/CHIPCallbackTypes.zapt new file mode 100644 index 00000000000000..3f4d648f2e102a --- /dev/null +++ b/src/controller/java/templates/CHIPCallbackTypes.zapt @@ -0,0 +1,14 @@ +{{> header}} +{{#if (chip_has_client_clusters)}} +#include +#include + +typedef void (*CHIPDefaultSuccessCallbackType)(void *, const chip::app::DataModel::NullObjectType &); +typedef void (*CHIPDefaultFailureCallbackType)(void *, EmberAfStatus); + +{{#chip_client_clusters}} +{{#chip_cluster_responses}} +typedef void (*CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}CallbackType)(void *, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &); +{{/chip_cluster_responses}} +{{/chip_client_clusters}} +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/CHIPClusters-JNI.zapt b/src/controller/java/templates/CHIPClusters-JNI.zapt index e733901e40a79b..6cd43c136eebca 100644 --- a/src/controller/java/templates/CHIPClusters-JNI.zapt +++ b/src/controller/java/templates/CHIPClusters-JNI.zapt @@ -1,5 +1,7 @@ {{> header}} {{#if (chip_has_client_clusters)}} +#include "CHIPCallbackTypes.h" +#include "CHIPInvokeCallbacks.h" #include "CHIPReadCallbacks.h" #include @@ -8,7 +10,6 @@ #include #include -#include #include #include #include @@ -22,110 +23,6 @@ using namespace chip; using namespace chip::Controller; -{{! TODO(#8773): Clean up callbacks. }} - -{{#chip_client_clusters}} -{{#chip_cluster_responses}} -class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback : public Callback::Callback<{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback> -{ - public: - CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback): Callback::Callback<{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback>(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context{{#chip_cluster_response_arguments}}, {{asUnderlyingZclType type}} {{asSymbol label}}{{/chip_cluster_response_arguments}}) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback * cppCallback = nullptr; - {{#chip_cluster_response_arguments}} - {{#if (isOctetString type)}} - jbyteArray {{asSymbol label}}Arr; - {{else if (isShortString type)}} - UtfString {{asSymbol label}}Str(env, {{asSymbol label}}); - {{/if}} - {{/chip_cluster_response_arguments}} - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{#if isArray}}{{else if (isOctetString type)}}[B{{else if (isShortString type)}}Ljava/lang/String;{{else}}{{asJniSignature type false}}{{/if}}{{/chip_cluster_response_arguments}})V", &javaMethod); - SuccessOrExit(err); - - {{#chip_cluster_response_arguments}} - {{#if (isOctetString type)}} - {{asSymbol label}}Arr = env->NewByteArray({{asSymbol label}}.size()); - VerifyOrExit({{asSymbol label}}Arr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion({{asSymbol label}}Arr, 0, {{asSymbol label}}.size(), reinterpret_cast({{asSymbol label}}.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - {{/if}} - {{/chip_cluster_response_arguments}} - - env->CallVoidMethod(javaCallbackRef, javaMethod - {{#chip_cluster_response_arguments}} - {{#if isArray}} - // {{asSymbol label}}: {{asUnderlyingZclType type}} - // Conversion from this type to Java is not properly implemented yet - {{else if (isOctetString type)}} - , {{asSymbol label}}Arr - {{else if (isShortString type)}} - , {{asSymbol label}}Str.jniValue() - {{else}} - , static_cast<{{asJniBasicTypeForZclType type}}>({{asSymbol label}}) - {{/if}} - {{/chip_cluster_response_arguments}} - ); - - {{#chip_cluster_response_arguments}} - {{#if (isOctetString type)}} - env->DeleteLocalRef({{asSymbol label}}Arr); - {{/if}} - {{/chip_cluster_response_arguments}} - - exit: - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) { - cppCallback->Cancel(); - delete cppCallback; - } - } - - private: - jobject javaCallbackRef; -}; - -{{/chip_cluster_responses}} -{{/chip_client_clusters}} JNI_METHOD(void, BaseChipCluster, deleteCluster)(JNIEnv * env, jobject self, jlong clusterPtr) { chip::DeviceLayer::StackLock lock; @@ -146,58 +43,37 @@ JNI_METHOD(jlong, {{asUpperCamelCase name}}Cluster, initWithDevice)(JNIEnv * env } {{#chip_cluster_commands}} -JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}})(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asJniBasicType type false}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}) +JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}})(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asJniBasicType type true}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; {{asUpperCamelCase ../name}}Cluster * cppCluster; - {{#chip_cluster_command_arguments_with_structs_expanded}} - {{#if (isOctetString type)}} - JniByteArray {{asLowerCamelCase label}}Arr(env, {{asLowerCamelCase label}}); - {{else if (isCharString type)}} - JniUtfString {{asLowerCamelCase label}}Str(env, {{asLowerCamelCase label}}); - {{/if}} - {{/chip_cluster_command_arguments_with_structs_expanded}} + chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type request; - {{#if hasSpecificResponse}} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - {{else}} - std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); - {{/if}} + {{#chip_cluster_command_arguments}} + {{>encode_value target=(concat "request." (asLowerCamelCase label)) source=(asLowerCamelCase label)}} + {{/chip_cluster_command_arguments}} + + {{#*inline "callbackName"}}{{#if hasSpecificResponse}}{{asUpperCamelCase parent.name false}}Cluster{{asUpperCamelCase responseName false}}{{else}}DefaultSuccess{{/if}}{{/inline}} + + std::unique_ptrcallbackName}}Callback, void (*)(CHIP{{>callbackName}}Callback *)> onSuccess( + Platform::NewcallbackName}}Callback>(callback), Platform::DeletecallbackName}}Callback>); std::unique_ptr onFailure(Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast<{{asUpperCamelCase ../name}}Cluster *>(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - - err = cppCluster->{{asCamelCased name false}}(onSuccess->Cancel(), onFailure->Cancel() - {{#chip_cluster_command_arguments_with_structs_expanded}}, {{#if_chip_enum type}}static_cast<{{chipType}}>({{asLowerCamelCase label}}){{else if (isOctetString type)}}{{asUnderlyingZclType type}}((const uint8_t*) {{asLowerCamelCase label}}Arr.data(), {{asLowerCamelCase label}}Arr.size()){{else if (isCharString type)}}chip::CharSpan({{asLowerCamelCase label}}Str.c_str(), strlen({{asLowerCamelCase label}}Str.c_str())){{else}}{{asLowerCamelCase label}}{{/if_chip_enum}}{{/chip_cluster_command_arguments_with_structs_expanded}}); - SuccessOrExit(err); + VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); -exit: - if (err != CHIP_NO_ERROR) { - jthrowable exception; - jmethodID method; + auto successFn = chip::Callback::CallbackcallbackName}}CallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", CHIP_ERROR_INCORRECT_STATE)); - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, exception); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } else { - onSuccess.release(); - onFailure.release(); - } + onSuccess.release(); + onFailure.release(); } {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} diff --git a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt new file mode 100644 index 00000000000000..c079b4fa1a8e45 --- /dev/null +++ b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt @@ -0,0 +1,76 @@ +{{> header}} +{{#if (chip_has_client_clusters)}} +#include "CHIPCallbackTypes.h" +#include "CHIPInvokeCallbacks.h" + +#include +#include +#include +#include +#include +#include +#include + +{{! TODO(#8773): Clean up callbacks. }} + +namespace chip { + +{{#chip_client_clusters}} +{{#chip_cluster_responses}} +CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback::CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback): Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback::~CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback::CallbackFn(void * context, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete + ); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{#if isArray}}{{else if isOptional}}Ljava/util/Optional;{{else if (isOctetString type)}}[B{{else if (isShortString type)}}Ljava/lang/String;{{else}}{{asJniSignature type true}}{{/if}}{{/chip_cluster_response_arguments}})V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + {{#chip_cluster_response_arguments}} + {{>decode_value}} + {{/chip_cluster_response_arguments}} + + env->CallVoidMethod(javaCallbackRef, javaMethod{{#chip_cluster_response_arguments}}, {{asSymbol label}}{{/chip_cluster_response_arguments}}); +} +{{/chip_cluster_responses}} +{{/chip_client_clusters}} +} // namespace chip +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/CHIPInvokeCallbacks.zapt b/src/controller/java/templates/CHIPInvokeCallbacks.zapt new file mode 100644 index 00000000000000..a89db3856a66f9 --- /dev/null +++ b/src/controller/java/templates/CHIPInvokeCallbacks.zapt @@ -0,0 +1,29 @@ +{{> header}} +{{#if (chip_has_client_clusters)}} +#include "CHIPCallbackTypes.h" + +#include +#include +#include + +namespace chip { + +{{#chip_client_clusters}} +{{#chip_cluster_responses}} +class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback : public Callback::Callback +{ +public: + CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback); + + ~CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(); + + static void CallbackFn(void * context, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +{{/chip_cluster_responses}} +{{/chip_client_clusters}} +} // namespace chip +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index db9d6f57e783d8..caa278adedb25e 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -4,8 +4,8 @@ package chip.devicecontroller; import androidx.annotation.Nullable; -import java.util.List; import java.util.Arrays; +import java.util.List; import java.util.Optional; public class ChipClusters { @@ -78,30 +78,17 @@ public class ChipClusters { public native long initWithDevice(long devicePtr, int endpointId); {{#chip_cluster_commands}} - public void {{asLowerCamelCase name}}({{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asJavaBasicType type}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}) { + public void {{asLowerCamelCase name}}({{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback{{>command_arguments}}) { {{asLowerCamelCase name}}(chipClusterPtr, callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}); } {{/chip_cluster_commands}} {{#chip_cluster_commands}} - private native void {{asLowerCamelCase name}}(long chipClusterPtr, {{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asJavaBasicType type}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}); + private native void {{asLowerCamelCase name}}(long chipClusterPtr, {{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback{{>command_arguments}}); {{/chip_cluster_commands}} {{#chip_cluster_responses}} public interface {{asUpperCamelCase name}}Callback { - void onSuccess( -{{#chip_cluster_response_arguments}} -{{#if isArray}} - // {{asSymbol label}}: {{asUnderlyingZclType type}} - // Conversion from this type to Java is not properly implemented yet -{{else if (isOctetString type)}} - {{omitCommaForFirstNonStatusCommand parent.id index}}byte[] {{asSymbol label}} -{{else if (isShortString type)}} - {{omitCommaForFirstNonStatusCommand parent.id index}}String {{asSymbol label}} -{{else}} - {{omitCommaForFirstNonStatusCommand parent.id index}}{{asJavaBasicTypeForZclType type false}} {{asSymbol label}} -{{/if}} -{{/chip_cluster_response_arguments}} - ); + void onSuccess({{>command_callback_responses parent=..}}); void onError(Exception error); } @@ -200,44 +187,7 @@ public class ChipClusters { {{/if}} public interface {{asUpperCamelCase name}}AttributeCallback { - void onSuccess(List< - {{#if isStruct}} - {{asUpperCamelCase name}}Attribute - {{else}} - {{#if isNullable}} - {{#unless isArray}} - {{#unless isStruct}} - @Nullable - {{/unless}} - {{/unless}} - {{/if}} - {{#if isOptional}} - {{#unless isArray}} - {{#unless isStruct}} - Optional< - {{/unless}} - {{/unless}} - {{/if}} - {{#if (isOctetString type)}} - byte[] - {{else if (isCharString type)}} - // Add String field here after ByteSpan is properly emitted in C++ layer - {{else}} - {{! NOTE: asJavaBasicTypeForZclType ends up sniffing for isArray on the - context. Since we want the type of our _entry_, force isArray to - false. }} - {{~#*inline "asJavaBasicTypeForEntry"}}{{asJavaBasicTypeForZclType type true}}{{/inline~}} - {{> asJavaBasicTypeForEntry isArray=false}} - {{/if}} - {{#if isOptional}} - {{#unless isArray}} - {{#unless isStruct}} - > - {{/unless}} - {{/unless}} - {{/if}} - {{/if}} - > valueList); + void onSuccess(List<{{#>list_attribute_callback_type}}{{/list_attribute_callback_type}}> valueList); void onError(Exception ex); } {{/if}} diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index 05ea012ce6985c..7a44283ef52afa 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -4,10 +4,11 @@ package chip.devicecontroller; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.Map; import java.util.List; -import java.util.HashMap; +import java.util.Map; +import java.util.Optional; import chip.clusterinfo.ClusterInfo; import chip.clusterinfo.InteractionInfo; import chip.clusterinfo.CommandParameterInfo; @@ -162,20 +163,7 @@ public class ClusterInfoMapping { } @Override - public void onSuccess( - {{#chip_cluster_response_arguments}} - {{#if isArray}} - // {{asSymbol label}}: {{asUnderlyingZclType type}} - // Conversion from this type to Java is not properly implemented yet - {{else if (isOctetString type)}} - {{omitCommaForFirstNonStatusCommand parent.id index}}byte[] {{asSymbol label}} - {{else if (isShortString type)}} - {{omitCommaForFirstNonStatusCommand parent.id index}}String {{asSymbol label}} - {{else}} - {{omitCommaForFirstNonStatusCommand parent.id index}}{{asJavaBasicTypeForZclType type false}} {{asSymbol label}} - {{/if}} - {{/chip_cluster_response_arguments}} - ) { + public void onSuccess({{>command_callback_responses parent=..}}) { Map responseValues = new LinkedHashMap<>(); {{#chip_cluster_response_arguments}} {{#if isArray}} @@ -209,24 +197,7 @@ public class ClusterInfoMapping { this.callback = callback; } @Override - public void onSuccess(List< - {{#if isStruct}} - ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}Attribute - {{else}} - {{#if (isOctetString type)}} - byte[] - {{else if (isCharString type)}} - // Add String field here after ByteSpan is properly emitted in C++ layer - {{else}} - {{! NOTE: asJavaBasicTypeForZclType does not handle isArray well, so - add an inline partial to force isArray to false when we want the - types of list entries. }} - {{~#*inline "asBoxedJavaBasicType"}}{{asJavaBasicTypeForZclType type true}}{{/inline~}} - {{~#*inline "asBoxedJavaBasicTypeForEntry"}}{{> asBoxedJavaBasicType isArray=false}}{{/inline~}} - {{> asBoxedJavaBasicTypeForEntry}} - {{/if}} - {{/if}} - > valueList) { + public void onSuccess(List<{{#>list_attribute_callback_type}}ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{/list_attribute_callback_type}}> valueList) { Map responseValues = new LinkedHashMap<>(); {{#if isStruct}} CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); @@ -285,6 +256,7 @@ public class ClusterInfoMapping { {{/chip_client_clusters}} } + @SuppressWarnings("unchecked") public Map> getCommandMap() { Map> commandMap = new HashMap<>(); {{#chip_client_clusters}} @@ -307,7 +279,7 @@ public class ClusterInfoMapping { ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster) .{{asLowerCamelCase name}}((ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase responseName}}Callback) callback {{#chip_cluster_command_arguments_with_structs_expanded}}, - ({{asJavaBoxedType type}}) + ({{#if isOptional}}Optional<{{/if}}{{asJavaBoxedType type}}{{#if isOptional}}>{{/if}}) commandArguments.get("{{asLowerCamelCase label}}") {{/chip_cluster_command_arguments_with_structs_expanded}} ); @@ -321,7 +293,7 @@ public class ClusterInfoMapping { ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster) .{{asLowerCamelCase name}}((DefaultClusterCallback) callback {{#chip_cluster_command_arguments_with_structs_expanded}}, - ({{asJavaBoxedType type}}) + ({{#if isOptional}}Optional<{{/if}}{{asJavaBoxedType type}}{{#if isOptional}}>{{/if}}) commandArguments.get("{{asLowerCamelCase label}}") {{/chip_cluster_command_arguments_with_structs_expanded}} ); diff --git a/src/controller/java/templates/helper.js b/src/controller/java/templates/helper.js index e8bb5d7434f689..e878e0f8eda196 100644 --- a/src/controller/java/templates/helper.js +++ b/src/controller/java/templates/helper.js @@ -101,7 +101,9 @@ function asJavaBoxedType(type) function asJniBasicType(type, useBoxedTypes) { - if (StringHelper.isOctetString(type)) { + if (this.isOptional) { + return 'jobject'; + } else if (StringHelper.isOctetString(type)) { return 'jbyteArray'; } else if (StringHelper.isCharString(type)) { return 'jstring'; @@ -221,28 +223,20 @@ function notLastSupportedEntryTypes(context, options) } } -function omitCommaForFirstNonStatusCommand(id, index) +function notLastSupportedCommandResponseType(items, options) { - let promise = templateUtil.ensureZclPackageId(this) - .then((pkgId) => { return queryCommand.selectCommandArgumentsByCommandId(this.global.db, id, pkgId) }) - .catch(err => { - console.log(err); - throw err; - }) - .then((result) => { - // Currently, we omit array types, so don't count it as a valid non-status command. - let firstNonStatusCommandIndex = result.findIndex((command) => !command.isArray); - if (firstNonStatusCommandIndex == -1 || firstNonStatusCommandIndex != index) { - return ", "; - } - return ""; - }) - .catch(err => { - console.log(err); - throw err; - }); + if (items.length == 0) { + return + } - return templateUtil.templatePromise(this.global, promise); + let lastIndex = items.length - 1; + while (items[lastIndex].isArray) { + lastIndex--; + } + + if (this.index != lastIndex) { + return options.fn(this); + } } // @@ -258,5 +252,5 @@ exports.convertBasicCTypeToJniType = convertBasicCTypeToJniType; exports.convertCTypeToJniSignature = convertCTypeToJniSignature; exports.convertBasicCTypeToJavaBoxedType = convertBasicCTypeToJavaBoxedType; exports.convertAttributeCallbackTypeToJavaName = convertAttributeCallbackTypeToJavaName; -exports.omitCommaForFirstNonStatusCommand = omitCommaForFirstNonStatusCommand; exports.notLastSupportedEntryTypes = notLastSupportedEntryTypes; +exports.notLastSupportedCommandResponseType = notLastSupportedCommandResponseType; diff --git a/src/controller/java/templates/partials/command_arguments.zapt b/src/controller/java/templates/partials/command_arguments.zapt new file mode 100644 index 00000000000000..b534c0d285d26b --- /dev/null +++ b/src/controller/java/templates/partials/command_arguments.zapt @@ -0,0 +1,13 @@ +{{#chip_cluster_command_arguments_with_structs_expanded}} +, +{{#if isOptional}} +Optional< +{{else if isNullable}} +@Nullable +{{/if}} +{{asJavaBoxedType type}} +{{#if isOptional}} +> +{{/if}} +{{asLowerCamelCase label}} +{{/chip_cluster_command_arguments_with_structs_expanded}} \ No newline at end of file diff --git a/src/controller/java/templates/partials/command_callback_responses.zapt b/src/controller/java/templates/partials/command_callback_responses.zapt new file mode 100644 index 00000000000000..42ddde1188a644 --- /dev/null +++ b/src/controller/java/templates/partials/command_callback_responses.zapt @@ -0,0 +1,19 @@ +{{#chip_cluster_response_arguments}} +{{#if isNullable}} + {{#unless isArray}} + {{#unless isOptional}} + @Nullable + {{/unless}} + {{/unless}} +{{/if}} +{{#if isArray}} + // {{asSymbol label}}: {{asUnderlyingZclType type}} + // Conversion from this type to Java is not properly implemented yet +{{else if (isOctetString type)}} + {{#if isOptional}}Optional<{{/if}}byte[]{{#if isOptional}}>{{/if}} {{asSymbol label}}{{#notLastSupportedCommandResponseType parent.arguments}},{{/notLastSupportedCommandResponseType}} +{{else if (isShortString type)}} + {{#if isOptional}}Optional<{{/if}}String{{#if isOptional}}>{{/if}} {{asSymbol label}}{{#notLastSupportedCommandResponseType parent.arguments}},{{/notLastSupportedCommandResponseType}} +{{else}} + {{#if isOptional}}Optional<{{/if}}{{asJavaBasicTypeForZclType type true}}{{#if isOptional}}>{{/if}} {{asSymbol label}}{{#notLastSupportedCommandResponseType parent.arguments}},{{/notLastSupportedCommandResponseType}} +{{/if}} +{{/chip_cluster_response_arguments}} \ No newline at end of file diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt new file mode 100644 index 00000000000000..954f08244e895e --- /dev/null +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -0,0 +1,33 @@ +jobject {{asSymbol label}}; +{{#if isOptional}} +if (!dataResponse.{{asLowerCamelCase label}}.HasValue()) { + chip::JniReferences::GetInstance().CreateOptional(nullptr, {{asSymbol label}}); +} else { +{{#if isNullable}} +if (dataResponse.{{asLowerCamelCase label}}.Value().IsNull()) { + chip::JniReferences::GetInstance().CreateOptional(nullptr, {{asSymbol label}}); +} else { +{{/if}} +{{/if}} +{{~#*inline "item"}}dataResponse.{{asLowerCamelCase name}}{{#if isOptional}}.Value(){{/if}}{{#if isNullable}}.Value(){{/if}}{{/inline}} +{{#if isArray}} +{{asSymbol label}} = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ +{{! TODO: Use if_is_struct, which works better for nested types. Currently can't because inline partials aren't found in its else block. }} +{{else if isStruct}} +{{asSymbol label}} = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ +{{else if (isOctetString type)}} +{{asSymbol label}} = chip::ByteArray(env, {{>item}}).jniValue(); +{{else if (isCharString type)}} +{{asSymbol label}} = chip::UtfString(env, {{>item}}).jniValue(); +{{else}} +std::string {{asSymbol label}}ClassName = "java/lang/{{asJavaBasicTypeForZclType type true}}"; +std::string {{asSymbol label}}CtorSignature = "({{asJniSignature type false}})V"; +chip::JniReferences::GetInstance().CreateBoxedObject<{{chipType}}>({{asSymbol label}}ClassName.c_str(), {{asSymbol label}}CtorSignature.c_str(), {{>item}}, {{asSymbol label}}); +{{/if}} +{{#if isOptional}} +chip::JniReferences::GetInstance().CreateOptional({{asSymbol label}}, {{asSymbol label}}); +{{#if isNullable}} +} +{{/if}} +} +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/partials/encode_value.zapt b/src/controller/java/templates/partials/encode_value.zapt new file mode 100644 index 00000000000000..8cf48d1d44cdf7 --- /dev/null +++ b/src/controller/java/templates/partials/encode_value.zapt @@ -0,0 +1,75 @@ +{{#if isOptional}} +chip::JniReferences::GetInstance().GetOptionalValue({{source}}, {{source}}); +{{/if}} +{{#if isNullable}} + {{#if_chip_enum type}} + decltype({{target}}) {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})); + } + {{else}} + {{#if isArray}} + {{! TODO: Support array types. }} + {{else if isStruct}} + {{! TODO: Use if_is_struct, which works better for nested types. Currently can't because inline partials aren't found in its else block. }} + {{! TODO: Support struct types. }} + {{else if (isOctetString type)}} + chip::ByteSpan {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = chip::JniByteArray(env, static_cast({{source}})).byteSpan(); + } + {{else if (isCharString type)}} + chip::CharSpan {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = chip::JniUtfString(env, static_cast({{source}})).charSpan(); + } + {{else}} + {{#if_is_bitmap type}} + decltype({{target}}) {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})); + } + {{else}} + {{chipType}} {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}}); + } + {{/if_is_bitmap}} + {{/if}} + {{/if_chip_enum}} +{{/if}} +{{#*inline "value"}} +{{! TODO Implement complex types parsing in order to properly set the request parameters }} +{{#if isArray}} +{{zapTypeToEncodableClusterObjectType type ns=parent.parent.name}}() +{{else if isStruct}} +{{zapTypeToEncodableClusterObjectType type ns=parent.parent.name}}() +{{else if (isOctetString type)}} +chip::JniByteArray(env, static_cast({{source}})).byteSpan() +{{else if (isCharString type)}} +chip::JniUtfString(env, static_cast({{source}})).charSpan() +{{else}} + {{#if_chip_enum type}} + static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})) + {{else}} + {{#if_is_bitmap type}} + static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})) + {{else}} + static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})) + {{/if_is_bitmap}} + {{/if_chip_enum}} +{{/if}} +{{/inline}} +{{target}} = +{{#if isOptional}} +{{zapTypeToEncodableClusterObjectType type ns=parent.parent.name}}( +{{/if}} +{{#if isNullable}} + {{source}} == nullptr ? chip::app::DataModel::Nullable<{{chipType}}>() : chip::app::DataModel::Nullable<{{chipType}}>({{source}}Value) + {{else}} +{{! TODO If the inline partial is indented, generation fails with "result.split is not a function". }} +{{>value}} +{{/if}} +{{#if isOptional}} +) +{{/if}}; diff --git a/src/controller/java/templates/partials/list_attribute_callback_type.zapt b/src/controller/java/templates/partials/list_attribute_callback_type.zapt new file mode 100644 index 00000000000000..b74884de17986b --- /dev/null +++ b/src/controller/java/templates/partials/list_attribute_callback_type.zapt @@ -0,0 +1,36 @@ +{{#if isStruct}} +{{> @partial-block }}{{asUpperCamelCase name}}Attribute +{{else}} + {{#if isNullable}} + {{#unless isArray}} + {{#unless isStruct}} + @Nullable + {{/unless}} + {{/unless}} + {{/if}} + {{#if isOptional}} + {{#unless isArray}} + {{#unless isStruct}} + Optional< + {{/unless}} + {{/unless}} + {{/if}} + {{#if (isOctetString type)}} + byte[] + {{else if (isCharString type)}} + // Add String field here after ByteSpan is properly emitted in C++ layer + {{else}} + {{! NOTE: asJavaBasicTypeForZclType ends up sniffing for isArray on the + context. Since we want the type of our _entry_, force isArray to + false. }} + {{~#*inline "asJavaBasicTypeForEntry"}}{{asJavaBasicTypeForZclType type true}}{{/inline~}} + {{> asJavaBasicTypeForEntry isArray=false}} + {{/if}} + {{#if isOptional}} + {{#unless isArray}} + {{#unless isStruct}} + > + {{/unless}} + {{/unless}} + {{/if}} +{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index c0fa30fabdb32a..590f9a74447f35 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -23,9 +23,44 @@ { "name": "cluster_header", "path": "../../../app/zap-templates/partials/cluster_header.zapt" + }, + { + "name": "encode_value", + "path": "partials/encode_value.zapt" + }, + { + "name": "decode_value", + "path": "partials/decode_value.zapt" + }, + { + "name": "list_attribute_callback_type", + "path": "partials/list_attribute_callback_type.zapt" + }, + { + "name": "command_callback_responses", + "path": "partials/command_callback_responses.zapt" + }, + { + "name": "command_arguments", + "path": "partials/command_arguments.zapt" } ], "templates": [ + { + "path": "CHIPInvokeCallbacks.zapt", + "name": "CHIP cluster invoke callbacks for Java (native code)", + "output": "src/controller/java/zap-generated/CHIPInvokeCallbacks.h" + }, + { + "path": "CHIPInvokeCallbacks-src.zapt", + "name": "CHIP cluster invoke callbacks for Java (native code)", + "output": "src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp" + }, + { + "path": "CHIPCallbackTypes.zapt", + "name": "CHIP cluster callback types", + "output": "src/controller/java/zap-generated/CHIPCallbackTypes.h" + }, { "path": "CHIPClusters-JNI.zapt", "name": "CHIP ZCL API for Java (native code)", @@ -37,14 +72,14 @@ "output": "src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp" }, { - "path": "CHIPReadCallbacks-src.zapt", + "path": "CHIPReadCallbacks.zapt", "name": "CHIP cluster attribute read callback for Java (native code)", - "output": "src/controller/java/zap-generated/CHIPReadCallbacks.cpp" + "output": "src/controller/java/zap-generated/CHIPReadCallbacks.h" }, { - "path": "CHIPReadCallbacks.zapt", + "path": "CHIPReadCallbacks-src.zapt", "name": "CHIP cluster attribute read callback for Java (native code)", - "output": "src/controller/java/zap-generated/CHIPReadCallbacks.h" + "output": "src/controller/java/zap-generated/CHIPReadCallbacks.cpp" }, { "path": "ChipClusters-java.zapt", diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h new file mode 100644 index 00000000000000..feeaa68e68cc35 --- /dev/null +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -0,0 +1,176 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP +#include +#include + +typedef void (*CHIPDefaultSuccessCallbackType)(void *, const chip::app::DataModel::NullObjectType &); +typedef void (*CHIPDefaultFailureCallbackType)(void *, EmberAfStatus); + +typedef void (*CHIPAccountLoginClusterGetSetupPINResponseCallbackType)( + void *, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &); +typedef void (*CHIPApplicationLauncherClusterLaunchAppResponseCallbackType)( + void *, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType &); +typedef void (*CHIPContentLauncherClusterLaunchContentResponseCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType &); +typedef void (*CHIPContentLauncherClusterLaunchURLResponseCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType &); +typedef void (*CHIPDiagnosticLogsClusterRetrieveLogsResponseCallbackType)( + void *, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearAllPinsResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearAllPinsResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearAllRfidsResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearAllRfidsResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearHolidayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearHolidayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearPinResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearPinResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearRfidResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearRfidResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearWeekdayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterClearYeardayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::ClearYeardayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetHolidayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetLogRecordResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetLogRecordResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetPinResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetPinResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetRfidResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetRfidResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetUserTypeResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetUserTypeResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetWeekdayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterGetYeardayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::GetYeardayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterLockDoorResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::LockDoorResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterSetHolidayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::SetHolidayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterSetPinResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::SetPinResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterSetRfidResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::SetRfidResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterSetUserTypeResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::SetUserTypeResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::SetWeekdayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterSetYeardayScheduleResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::SetYeardayScheduleResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterUnlockDoorResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::UnlockDoorResponse::DecodableType &); +typedef void (*CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackType)( + void *, const chip::app::Clusters::DoorLock::Commands::UnlockWithTimeoutResponse::DecodableType &); +typedef void (*CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackType)( + void *, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType &); +typedef void (*CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackType)( + void *, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &); +typedef void (*CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType)( + void *, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &); +typedef void (*CHIPGroupsClusterAddGroupResponseCallbackType)( + void *, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &); +typedef void (*CHIPGroupsClusterGetGroupMembershipResponseCallbackType)( + void *, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType &); +typedef void (*CHIPGroupsClusterRemoveGroupResponseCallbackType)( + void *, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType &); +typedef void (*CHIPGroupsClusterViewGroupResponseCallbackType)( + void *, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType &); +typedef void (*CHIPIdentifyClusterIdentifyQueryResponseCallbackType)( + void *, const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType &); +typedef void (*CHIPKeypadInputClusterSendKeyResponseCallbackType)( + void *, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaNextResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaPauseResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaPlayResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaPreviousResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaRewindResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaSeekResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaStartOverResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterMediaStopResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::AddThreadNetworkResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::AddWiFiNetworkResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::DisableNetworkResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::EnableNetworkResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetworkResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterScanNetworksResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::UpdateThreadNetworkResponse::DecodableType &); +typedef void (*CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackType)( + void *, const chip::app::Clusters::NetworkCommissioning::Commands::UpdateWiFiNetworkResponse::DecodableType &); +typedef void (*CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackType)( + void *, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType &); +typedef void (*CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackType)( + void *, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterAttestationResponseCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterCertificateChainResponseCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterNOCResponseCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterOpCSRResponseCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Commands::OpCSRResponse::DecodableType &); +typedef void (*CHIPScenesClusterAddSceneResponseCallbackType)( + void *, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType &); +typedef void (*CHIPScenesClusterGetSceneMembershipResponseCallbackType)( + void *, const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType &); +typedef void (*CHIPScenesClusterRemoveAllScenesResponseCallbackType)( + void *, const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType &); +typedef void (*CHIPScenesClusterRemoveSceneResponseCallbackType)( + void *, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType &); +typedef void (*CHIPScenesClusterStoreSceneResponseCallbackType)( + void *, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType &); +typedef void (*CHIPScenesClusterViewSceneResponseCallbackType)( + void *, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType &); +typedef void (*CHIPTvChannelClusterChangeChannelResponseCallbackType)( + void *, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType &); +typedef void (*CHIPTargetNavigatorClusterNavigateTargetResponseCallbackType)( + void *, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &); +typedef void (*CHIPTestClusterClusterBooleanResponseCallbackType)( + void *, const chip::app::Clusters::TestCluster::Commands::BooleanResponse::DecodableType &); +typedef void (*CHIPTestClusterClusterTestAddArgumentsResponseCallbackType)( + void *, const chip::app::Clusters::TestCluster::Commands::TestAddArgumentsResponse::DecodableType &); +typedef void (*CHIPTestClusterClusterTestEnumsResponseCallbackType)( + void *, const chip::app::Clusters::TestCluster::Commands::TestEnumsResponse::DecodableType &); +typedef void (*CHIPTestClusterClusterTestListInt8UReverseResponseCallbackType)( + void *, const chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseResponse::DecodableType &); +typedef void (*CHIPTestClusterClusterTestNullableOptionalResponseCallbackType)( + void *, const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType &); +typedef void (*CHIPTestClusterClusterTestSpecificResponseCallbackType)( + void *, const chip::app::Clusters::TestCluster::Commands::TestSpecificResponse::DecodableType &); diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index d864242bd2721e..672be94172bf6b 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -16,6 +16,8 @@ */ // THIS FILE IS GENERATED BY ZAP +#include "CHIPCallbackTypes.h" +#include "CHIPInvokeCallbacks.h" #include "CHIPReadCallbacks.h" #include @@ -25,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -38,5388 +39,6 @@ using namespace chip; using namespace chip::Controller; -class CHIPAccountLoginClusterGetSetupPINResponseCallback : public Callback::Callback -{ -public: - CHIPAccountLoginClusterGetSetupPINResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPAccountLoginClusterGetSetupPINResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::CharSpan setupPIN) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPAccountLoginClusterGetSetupPINResponseCallback * cppCallback = nullptr; - UtfString setupPINStr(env, setupPIN); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, setupPINStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPApplicationLauncherClusterLaunchAppResponseCallback - : public Callback::Callback -{ -public: - CHIPApplicationLauncherClusterLaunchAppResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPApplicationLauncherClusterLaunchAppResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, chip::CharSpan data) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPApplicationLauncherClusterLaunchAppResponseCallback * cppCallback = nullptr; - UtfString dataStr(env, data); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), dataStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPContentLauncherClusterLaunchContentResponseCallback - : public Callback::Callback -{ -public: - CHIPContentLauncherClusterLaunchContentResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPContentLauncherClusterLaunchContentResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::CharSpan data, uint8_t contentLaunchStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPContentLauncherClusterLaunchContentResponseCallback * cppCallback = nullptr; - UtfString dataStr(env, data); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, dataStr.jniValue(), static_cast(contentLaunchStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPContentLauncherClusterLaunchURLResponseCallback - : public Callback::Callback -{ -public: - CHIPContentLauncherClusterLaunchURLResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPContentLauncherClusterLaunchURLResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::CharSpan data, uint8_t contentLaunchStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPContentLauncherClusterLaunchURLResponseCallback * cppCallback = nullptr; - UtfString dataStr(env, data); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, dataStr.jniValue(), static_cast(contentLaunchStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback - : public Callback::Callback -{ -public: - CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, chip::ByteSpan content, uint32_t timeStamp, uint32_t timeSinceBoot) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback * cppCallback = nullptr; - jbyteArray contentArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I[BJJ)V", &javaMethod); - SuccessOrExit(err); - - contentArr = env->NewByteArray(content.size()); - VerifyOrExit(contentArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(contentArr, 0, content.size(), reinterpret_cast(content.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), contentArr, static_cast(timeStamp), - static_cast(timeSinceBoot)); - - env->DeleteLocalRef(contentArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearAllPinsResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearAllPinsResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearAllPinsResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearAllPinsResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearAllRfidsResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearAllRfidsResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearAllRfidsResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearAllRfidsResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearHolidayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearHolidayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearHolidayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearHolidayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearPinResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearPinResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearPinResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearPinResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearRfidResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearRfidResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearRfidResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearRfidResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearWeekdayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearWeekdayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearWeekdayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearWeekdayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterClearYeardayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterClearYeardayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterClearYeardayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterClearYeardayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetHolidayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetHolidayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetHolidayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t scheduleId, uint8_t status, uint32_t localStartTime, uint32_t localEndTime, - uint8_t operatingModeDuringHoliday) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetHolidayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IIJJI)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(scheduleId), static_cast(status), - static_cast(localStartTime), static_cast(localEndTime), - static_cast(operatingModeDuringHoliday)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetLogRecordResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetLogRecordResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetLogRecordResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType, uint8_t source, - uint8_t eventIdOrAlarmCode, uint16_t userId, chip::ByteSpan pin) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetLogRecordResponseCallback * cppCallback = nullptr; - jbyteArray pinArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IJIIII[B)V", &javaMethod); - SuccessOrExit(err); - - pinArr = env->NewByteArray(pin.size()); - VerifyOrExit(pinArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(pinArr, 0, pin.size(), reinterpret_cast(pin.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(logEntryId), static_cast(timestamp), - static_cast(eventType), static_cast(source), static_cast(eventIdOrAlarmCode), - static_cast(userId), pinArr); - - env->DeleteLocalRef(pinArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetPinResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetPinResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetPinResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, chip::ByteSpan pin) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetPinResponseCallback * cppCallback = nullptr; - jbyteArray pinArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(III[B)V", &javaMethod); - SuccessOrExit(err); - - pinArr = env->NewByteArray(pin.size()); - VerifyOrExit(pinArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(pinArr, 0, pin.size(), reinterpret_cast(pin.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(userId), static_cast(userStatus), - static_cast(userType), pinArr); - - env->DeleteLocalRef(pinArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetRfidResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetRfidResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetRfidResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, chip::ByteSpan rfid) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetRfidResponseCallback * cppCallback = nullptr; - jbyteArray rfidArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(III[B)V", &javaMethod); - SuccessOrExit(err); - - rfidArr = env->NewByteArray(rfid.size()); - VerifyOrExit(rfidArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(rfidArr, 0, rfid.size(), reinterpret_cast(rfid.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(userId), static_cast(userStatus), - static_cast(userType), rfidArr); - - env->DeleteLocalRef(rfidArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetUserTypeResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetUserTypeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetUserTypeResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint16_t userId, uint8_t userType) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetUserTypeResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(userId), static_cast(userType)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetWeekdayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetWeekdayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetWeekdayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t scheduleId, uint16_t userId, uint8_t status, uint8_t daysMask, uint8_t startHour, - uint8_t startMinute, uint8_t endHour, uint8_t endMinute) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetWeekdayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IIIIIIII)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(scheduleId), static_cast(userId), - static_cast(status), static_cast(daysMask), static_cast(startHour), - static_cast(startMinute), static_cast(endHour), static_cast(endMinute)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterGetYeardayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterGetYeardayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterGetYeardayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t scheduleId, uint16_t userId, uint8_t status, uint32_t localStartTime, - uint32_t localEndTime) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterGetYeardayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IIIJJ)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(scheduleId), static_cast(userId), - static_cast(status), static_cast(localStartTime), static_cast(localEndTime)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterLockDoorResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterLockDoorResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterLockDoorResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterLockDoorResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterSetHolidayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterSetHolidayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterSetHolidayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterSetHolidayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterSetPinResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterSetPinResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterSetPinResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterSetPinResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterSetRfidResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterSetRfidResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterSetRfidResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterSetRfidResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterSetUserTypeResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterSetUserTypeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterSetUserTypeResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterSetUserTypeResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterSetWeekdayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterSetWeekdayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterSetWeekdayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterSetWeekdayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterSetYeardayScheduleResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterSetYeardayScheduleResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterSetYeardayScheduleResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterSetYeardayScheduleResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterUnlockDoorResponseCallback : public Callback::Callback -{ -public: - CHIPDoorLockClusterUnlockDoorResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterUnlockDoorResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterUnlockDoorResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPDoorLockClusterUnlockWithTimeoutResponseCallback - : public Callback::Callback -{ -public: - CHIPDoorLockClusterUnlockWithTimeoutResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPDoorLockClusterUnlockWithTimeoutResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPDoorLockClusterUnlockWithTimeoutResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGeneralCommissioningClusterArmFailSafeResponseCallback - : public Callback::Callback -{ -public: - CHIPGeneralCommissioningClusterArmFailSafeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGeneralCommissioningClusterArmFailSafeResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGeneralCommissioningClusterArmFailSafeResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback - : public Callback::Callback -{ -public: - CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback - : public Callback::Callback -{ -public: - CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGroupsClusterAddGroupResponseCallback : public Callback::Callback -{ -public: - CHIPGroupsClusterAddGroupResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGroupsClusterAddGroupResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGroupsClusterAddGroupResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGroupsClusterGetGroupMembershipResponseCallback - : public Callback::Callback -{ -public: - CHIPGroupsClusterGetGroupMembershipResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGroupsClusterGetGroupMembershipResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t capacity, uint8_t groupCount, - /* TYPE WARNING: array array defaults to */ uint8_t * groupList) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGroupsClusterGetGroupMembershipResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(capacity), static_cast(groupCount) - // groupList: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGroupsClusterRemoveGroupResponseCallback : public Callback::Callback -{ -public: - CHIPGroupsClusterRemoveGroupResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGroupsClusterRemoveGroupResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGroupsClusterRemoveGroupResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPGroupsClusterViewGroupResponseCallback : public Callback::Callback -{ -public: - CHIPGroupsClusterViewGroupResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPGroupsClusterViewGroupResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPGroupsClusterViewGroupResponseCallback * cppCallback = nullptr; - UtfString groupNameStr(env, groupName); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId), - groupNameStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPIdentifyClusterIdentifyQueryResponseCallback : public Callback::Callback -{ -public: - CHIPIdentifyClusterIdentifyQueryResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPIdentifyClusterIdentifyQueryResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint16_t timeout) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPIdentifyClusterIdentifyQueryResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(timeout)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPKeypadInputClusterSendKeyResponseCallback : public Callback::Callback -{ -public: - CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPKeypadInputClusterSendKeyResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPKeypadInputClusterSendKeyResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaFastForwardResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaFastForwardResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaFastForwardResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaFastForwardResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaNextResponseCallback : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaNextResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaNextResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaNextResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaPauseResponseCallback : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaPauseResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaPauseResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaPauseResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaPlayResponseCallback : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaPlayResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaPlayResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaPlayResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaPreviousResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaPreviousResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaPreviousResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaPreviousResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaRewindResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaRewindResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaRewindResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaRewindResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaSeekResponseCallback : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaSeekResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaSeekResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaSeekResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaStartOverResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaStartOverResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaStartOverResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaStartOverResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaStopResponseCallback : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaStopResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPMediaPlaybackClusterMediaStopResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaStopResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(mediaPlaybackStatus)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterDisableNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterDisableNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterDisableNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterDisableNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterEnableNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterEnableNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterEnableNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterEnableNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterScanNetworksResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterScanNetworksResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterScanNetworksResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText, - /* TYPE WARNING: array array defaults to */ uint8_t * wifiScanResults, - /* TYPE WARNING: array array defaults to */ uint8_t * threadScanResults) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterScanNetworksResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue() - // wifiScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - // threadScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback - : public Callback::Callback -{ -public: - CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t errorCode, chip::CharSpan debugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback * cppCallback = nullptr; - UtfString debugTextStr(env, debugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(errorCode), debugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback - : public Callback::Callback -{ -public: - CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t action, uint32_t delayedActionTime) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IJ)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(action), static_cast(delayedActionTime)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback - : public Callback::Callback -{ -public: - CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint32_t delayedActionTime, chip::CharSpan imageURI, - uint32_t softwareVersion, chip::CharSpan softwareVersionString, chip::ByteSpan updateToken, - bool userConsentNeeded, chip::ByteSpan metadataForRequestor) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback * cppCallback = nullptr; - UtfString imageURIStr(env, imageURI); - UtfString softwareVersionStringStr(env, softwareVersionString); - jbyteArray updateTokenArr; - jbyteArray metadataForRequestorArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", - "(IJLjava/lang/String;JLjava/lang/String;[BZ[B)V", &javaMethod); - SuccessOrExit(err); - - updateTokenArr = env->NewByteArray(updateToken.size()); - VerifyOrExit(updateTokenArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(updateTokenArr, 0, updateToken.size(), reinterpret_cast(updateToken.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - metadataForRequestorArr = env->NewByteArray(metadataForRequestor.size()); - VerifyOrExit(metadataForRequestorArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(metadataForRequestorArr, 0, metadataForRequestor.size(), - reinterpret_cast(metadataForRequestor.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(delayedActionTime), - imageURIStr.jniValue(), static_cast(softwareVersion), softwareVersionStringStr.jniValue(), - updateTokenArr, static_cast(userConsentNeeded), metadataForRequestorArr); - - env->DeleteLocalRef(updateTokenArr); - env->DeleteLocalRef(metadataForRequestorArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPOperationalCredentialsClusterAttestationResponseCallback - : public Callback::Callback -{ -public: - CHIPOperationalCredentialsClusterAttestationResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPOperationalCredentialsClusterAttestationResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::ByteSpan AttestationElements, chip::ByteSpan Signature) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPOperationalCredentialsClusterAttestationResponseCallback * cppCallback = nullptr; - jbyteArray AttestationElementsArr; - jbyteArray SignatureArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B[B)V", &javaMethod); - SuccessOrExit(err); - - AttestationElementsArr = env->NewByteArray(AttestationElements.size()); - VerifyOrExit(AttestationElementsArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(AttestationElementsArr, 0, AttestationElements.size(), - reinterpret_cast(AttestationElements.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - SignatureArr = env->NewByteArray(Signature.size()); - VerifyOrExit(SignatureArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(SignatureArr, 0, Signature.size(), reinterpret_cast(Signature.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, AttestationElementsArr, SignatureArr); - - env->DeleteLocalRef(AttestationElementsArr); - env->DeleteLocalRef(SignatureArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPOperationalCredentialsClusterCertificateChainResponseCallback - : public Callback::Callback -{ -public: - CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPOperationalCredentialsClusterCertificateChainResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::ByteSpan Certificate) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPOperationalCredentialsClusterCertificateChainResponseCallback * cppCallback = nullptr; - jbyteArray CertificateArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B)V", &javaMethod); - SuccessOrExit(err); - - CertificateArr = env->NewByteArray(Certificate.size()); - VerifyOrExit(CertificateArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(CertificateArr, 0, Certificate.size(), reinterpret_cast(Certificate.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, CertificateArr); - - env->DeleteLocalRef(CertificateArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPOperationalCredentialsClusterNOCResponseCallback - : public Callback::Callback -{ -public: - CHIPOperationalCredentialsClusterNOCResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPOperationalCredentialsClusterNOCResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPOperationalCredentialsClusterNOCResponseCallback * cppCallback = nullptr; - UtfString DebugTextStr(env, DebugText); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(StatusCode), static_cast(FabricIndex), - DebugTextStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPOperationalCredentialsClusterOpCSRResponseCallback - : public Callback::Callback -{ -public: - CHIPOperationalCredentialsClusterOpCSRResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPOperationalCredentialsClusterOpCSRResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::ByteSpan NOCSRElements, chip::ByteSpan AttestationSignature) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPOperationalCredentialsClusterOpCSRResponseCallback * cppCallback = nullptr; - jbyteArray NOCSRElementsArr; - jbyteArray AttestationSignatureArr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B[B)V", &javaMethod); - SuccessOrExit(err); - - NOCSRElementsArr = env->NewByteArray(NOCSRElements.size()); - VerifyOrExit(NOCSRElementsArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(NOCSRElementsArr, 0, NOCSRElements.size(), reinterpret_cast(NOCSRElements.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - AttestationSignatureArr = env->NewByteArray(AttestationSignature.size()); - VerifyOrExit(AttestationSignatureArr != nullptr, err = CHIP_ERROR_NO_MEMORY); - env->ExceptionClear(); - env->SetByteArrayRegion(AttestationSignatureArr, 0, AttestationSignature.size(), - reinterpret_cast(AttestationSignature.data())); - VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - - env->CallVoidMethod(javaCallbackRef, javaMethod, NOCSRElementsArr, AttestationSignatureArr); - - env->DeleteLocalRef(NOCSRElementsArr); - env->DeleteLocalRef(AttestationSignatureArr); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPScenesClusterAddSceneResponseCallback : public Callback::Callback -{ -public: - CHIPScenesClusterAddSceneResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPScenesClusterAddSceneResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPScenesClusterAddSceneResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(III)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId), - static_cast(sceneId)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPScenesClusterGetSceneMembershipResponseCallback - : public Callback::Callback -{ -public: - CHIPScenesClusterGetSceneMembershipResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPScenesClusterGetSceneMembershipResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint8_t capacity, uint16_t groupId, uint8_t sceneCount, - /* TYPE WARNING: array array defaults to */ uint8_t * sceneList) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPScenesClusterGetSceneMembershipResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IIII)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(capacity), - static_cast(groupId), static_cast(sceneCount) - // sceneList: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPScenesClusterRemoveAllScenesResponseCallback : public Callback::Callback -{ -public: - CHIPScenesClusterRemoveAllScenesResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPScenesClusterRemoveAllScenesResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPScenesClusterRemoveAllScenesResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPScenesClusterRemoveSceneResponseCallback : public Callback::Callback -{ -public: - CHIPScenesClusterRemoveSceneResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPScenesClusterRemoveSceneResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPScenesClusterRemoveSceneResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(III)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId), - static_cast(sceneId)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPScenesClusterStoreSceneResponseCallback : public Callback::Callback -{ -public: - CHIPScenesClusterStoreSceneResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPScenesClusterStoreSceneResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPScenesClusterStoreSceneResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(III)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId), - static_cast(sceneId)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPScenesClusterViewSceneResponseCallback : public Callback::Callback -{ -public: - CHIPScenesClusterViewSceneResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPScenesClusterViewSceneResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, - chip::CharSpan sceneName, /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPScenesClusterViewSceneResponseCallback * cppCallback = nullptr; - UtfString sceneNameStr(env, sceneName); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(IIIILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), static_cast(groupId), - static_cast(sceneId), static_cast(transitionTime), sceneNameStr.jniValue() - // extensionFieldSets: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTvChannelClusterChangeChannelResponseCallback : public Callback::Callback -{ -public: - CHIPTvChannelClusterChangeChannelResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTvChannelClusterChangeChannelResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, /* TYPE WARNING: array array defaults to */ uint8_t * ChannelMatch, uint8_t ErrorType) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTvChannelClusterChangeChannelResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, - javaMethod - // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - , - static_cast(ErrorType)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTargetNavigatorClusterNavigateTargetResponseCallback - : public Callback::Callback -{ -public: - CHIPTargetNavigatorClusterNavigateTargetResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTargetNavigatorClusterNavigateTargetResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t status, chip::CharSpan data) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTargetNavigatorClusterNavigateTargetResponseCallback * cppCallback = nullptr; - UtfString dataStr(env, data); - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ILjava/lang/String;)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(status), dataStr.jniValue()); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTestClusterClusterBooleanResponseCallback : public Callback::Callback -{ -public: - CHIPTestClusterClusterBooleanResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTestClusterClusterBooleanResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, bool value) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTestClusterClusterBooleanResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Z)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(value)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTestClusterClusterTestAddArgumentsResponseCallback - : public Callback::Callback -{ -public: - CHIPTestClusterClusterTestAddArgumentsResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTestClusterClusterTestAddArgumentsResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t returnValue) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTestClusterClusterTestAddArgumentsResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(returnValue)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTestClusterClusterTestEnumsResponseCallback : public Callback::Callback -{ -public: - CHIPTestClusterClusterTestEnumsResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTestClusterClusterTestEnumsResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, chip::VendorId arg1, uint8_t arg2) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTestClusterClusterTestEnumsResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(II)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(arg1), static_cast(arg2)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTestClusterClusterTestListInt8UReverseResponseCallback - : public Callback::Callback -{ -public: - CHIPTestClusterClusterTestListInt8UReverseResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTestClusterClusterTestListInt8UReverseResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, /* TYPE WARNING: array array defaults to */ uint8_t * arg1) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTestClusterClusterTestListInt8UReverseResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "()V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod - // arg1: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTestClusterClusterTestNullableOptionalResponseCallback - : public Callback::Callback -{ -public: - CHIPTestClusterClusterTestNullableOptionalResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTestClusterClusterTestNullableOptionalResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, bool wasPresent, bool wasNull, uint8_t value, uint8_t originalValue) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTestClusterClusterTestNullableOptionalResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ZZII)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(wasPresent), static_cast(wasNull), - static_cast(value), static_cast(originalValue)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - -class CHIPTestClusterClusterTestSpecificResponseCallback : public Callback::Callback -{ -public: - CHIPTestClusterClusterTestSpecificResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } - } - ~CHIPTestClusterClusterTestSpecificResponseCallback() - { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); - }; - - static void CallbackFn(void * context, uint8_t returnValue) - { - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - CHIPTestClusterClusterTestSpecificResponseCallback * cppCallback = nullptr; - - VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - - cppCallback = reinterpret_cast(context); - VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); - - javaCallbackRef = cppCallback->javaCallbackRef; - VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(I)V", &javaMethod); - SuccessOrExit(err); - - env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(returnValue)); - - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); - } - if (cppCallback != nullptr) - { - cppCallback->Cancel(); - delete cppCallback; - } - } - -private: - jobject javaCallbackRef; -}; - JNI_METHOD(void, BaseChipCluster, deleteCluster)(JNIEnv * env, jobject self, jlong clusterPtr) { chip::DeviceLayer::StackLock lock; @@ -5446,7 +65,9 @@ JNI_METHOD(void, AccountLoginCluster, getSetupPIN) CHIP_ERROR err = CHIP_NO_ERROR; AccountLoginCluster * cppCluster; - JniUtfString tempAccountIdentifierStr(env, tempAccountIdentifier); + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type request; + + request.tempAccountIdentifier = chip::JniUtfString(env, static_cast(tempAccountIdentifier)).charSpan(); std::unique_ptr @@ -5454,43 +75,29 @@ JNI_METHOD(void, AccountLoginCluster, getSetupPIN) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetSetupPIN(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(tempAccountIdentifierStr.c_str(), strlen(tempAccountIdentifierStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, AccountLoginCluster, login) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring tempAccountIdentifier, jstring setupPIN) @@ -5499,51 +106,37 @@ JNI_METHOD(void, AccountLoginCluster, login) CHIP_ERROR err = CHIP_NO_ERROR; AccountLoginCluster * cppCluster; - JniUtfString tempAccountIdentifierStr(env, tempAccountIdentifier); - JniUtfString setupPINStr(env, setupPIN); + chip::app::Clusters::AccountLogin::Commands::Login::Type request; + + request.tempAccountIdentifier = chip::JniUtfString(env, static_cast(tempAccountIdentifier)).charSpan(); + request.setupPIN = chip::JniUtfString(env, static_cast(setupPIN)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Login(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(tempAccountIdentifierStr.c_str(), strlen(tempAccountIdentifierStr.c_str())), - chip::CharSpan(setupPINStr.c_str(), strlen(setupPINStr.c_str()))); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, AdministratorCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -5555,107 +148,90 @@ JNI_METHOD(jlong, AdministratorCommissioningCluster, initWithDevice)(JNIEnv * en } JNI_METHOD(void, AdministratorCommissioningCluster, openBasicCommissioningWindow) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint commissioningTimeout) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject commissioningTimeout) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AdministratorCommissioningCluster * cppCluster; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type request; + + request.commissioningTimeout = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(commissioningTimeout)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->OpenBasicCommissioningWindow(onSuccess->Cancel(), onFailure->Cancel(), commissioningTimeout); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, AdministratorCommissioningCluster, openCommissioningWindow) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint commissioningTimeout, jbyteArray PAKEVerifier, - jint discriminator, jlong iterations, jbyteArray salt, jint passcodeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject commissioningTimeout, jbyteArray PAKEVerifier, + jobject discriminator, jobject iterations, jbyteArray salt, jobject passcodeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AdministratorCommissioningCluster * cppCluster; - JniByteArray PAKEVerifierArr(env, PAKEVerifier); - JniByteArray saltArr(env, salt); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type request; + + request.commissioningTimeout = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(commissioningTimeout)); + request.PAKEVerifier = chip::JniByteArray(env, static_cast(PAKEVerifier)).byteSpan(); + request.discriminator = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(discriminator)); + request.iterations = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(iterations)); + request.salt = chip::JniByteArray(env, static_cast(salt)).byteSpan(); + request.passcodeID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(passcodeID)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->OpenCommissioningWindow(onSuccess->Cancel(), onFailure->Cancel(), commissioningTimeout, - chip::ByteSpan((const uint8_t *) PAKEVerifierArr.data(), PAKEVerifierArr.size()), - discriminator, iterations, - chip::ByteSpan((const uint8_t *) saltArr.data(), saltArr.size()), passcodeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, AdministratorCommissioningCluster, revokeCommissioning) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) @@ -5664,46 +240,34 @@ JNI_METHOD(void, AdministratorCommissioningCluster, revokeCommissioning) CHIP_ERROR err = CHIP_NO_ERROR; AdministratorCommissioningCluster * cppCluster; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RevokeCommissioning(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, ApplicationBasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -5714,52 +278,43 @@ JNI_METHOD(jlong, ApplicationBasicCluster, initWithDevice)(JNIEnv * env, jobject return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ApplicationBasicCluster, changeStatus)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint status) +JNI_METHOD(void, ApplicationBasicCluster, changeStatus) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject status) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ApplicationBasicCluster * cppCluster; + chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type request; + + request.status = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(status)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ChangeStatus(onSuccess->Cancel(), onFailure->Cancel(), static_cast(status)); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, ApplicationLauncherCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -5771,14 +326,18 @@ JNI_METHOD(jlong, ApplicationLauncherCluster, initWithDevice)(JNIEnv * env, jobj } JNI_METHOD(void, ApplicationLauncherCluster, launchApp) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring data, jint catalogVendorId, jstring applicationId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring data, jobject catalogVendorId, jstring applicationId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ApplicationLauncherCluster * cppCluster; - JniUtfString dataStr(env, data); - JniUtfString applicationIdStr(env, applicationId); + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type request; + + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + request.catalogVendorId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(catalogVendorId)); + request.applicationId = chip::JniUtfString(env, static_cast(applicationId)).charSpan(); std::unique_ptr @@ -5786,43 +345,29 @@ JNI_METHOD(void, ApplicationLauncherCluster, launchApp) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->LaunchApp(onSuccess->Cancel(), onFailure->Cancel(), chip::CharSpan(dataStr.c_str(), strlen(dataStr.c_str())), - catalogVendorId, chip::CharSpan(applicationIdStr.c_str(), strlen(applicationIdStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, AudioOutputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -5834,102 +379,80 @@ JNI_METHOD(jlong, AudioOutputCluster, initWithDevice)(JNIEnv * env, jobject self } JNI_METHOD(void, AudioOutputCluster, renameOutput) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint index, jstring name) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AudioOutputCluster * cppCluster; - JniUtfString nameStr(env, name); + chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type request; + + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RenameOutput(onSuccess->Cancel(), onFailure->Cancel(), index, - chip::CharSpan(nameStr.c_str(), strlen(nameStr.c_str()))); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, AudioOutputCluster, selectOutput)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint index) +JNI_METHOD(void, AudioOutputCluster, selectOutput)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AudioOutputCluster * cppCluster; + chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type request; + + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SelectOutput(onSuccess->Cancel(), onFailure->Cancel(), index); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, BarrierControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -5941,52 +464,43 @@ JNI_METHOD(jlong, BarrierControlCluster, initWithDevice)(JNIEnv * env, jobject s } JNI_METHOD(void, BarrierControlCluster, barrierControlGoToPercent) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint percentOpen) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject percentOpen) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BarrierControlCluster * cppCluster; + chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Type request; + + request.percentOpen = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(percentOpen)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BarrierControlCluster, barrierControlStop)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -5994,46 +508,34 @@ JNI_METHOD(void, BarrierControlCluster, barrierControlStop)(JNIEnv * env, jobjec CHIP_ERROR err = CHIP_NO_ERROR; BarrierControlCluster * cppCluster; + chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, BasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -6050,46 +552,34 @@ JNI_METHOD(void, BasicCluster, mfgSpecificPing)(JNIEnv * env, jobject self, jlon CHIP_ERROR err = CHIP_NO_ERROR; BasicCluster * cppCluster; + chip::app::Clusters::Basic::Commands::MfgSpecificPing::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->MfgSpecificPing(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BasicCluster, writeUserLabelAttribute) @@ -6380,100 +870,90 @@ JNI_METHOD(jlong, BindingCluster, initWithDevice)(JNIEnv * env, jobject self, jl } JNI_METHOD(void, BindingCluster, bind) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong nodeId, jint groupId, jint endpointId, jlong clusterId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject nodeId, jobject groupId, jobject endpointId, + jobject clusterId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BindingCluster * cppCluster; + chip::app::Clusters::Binding::Commands::Bind::Type request; + + request.nodeId = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(nodeId)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.endpointId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endpointId)); + request.clusterId = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(clusterId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Bind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BindingCluster, unbind) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong nodeId, jint groupId, jint endpointId, jlong clusterId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject nodeId, jobject groupId, jobject endpointId, + jobject clusterId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BindingCluster * cppCluster; + chip::app::Clusters::Binding::Commands::Unbind::Type request; + + request.nodeId = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(nodeId)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.endpointId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endpointId)); + request.clusterId = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(clusterId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Unbind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, BooleanStateCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -6548,580 +1028,502 @@ JNI_METHOD(jlong, BridgedActionsCluster, initWithDevice)(JNIEnv * env, jobject s } JNI_METHOD(void, BridgedActionsCluster, disableAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::DisableAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->DisableAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, disableActionWithDuration) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID, jlong duration) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID, jobject duration) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::DisableActionWithDuration::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + request.duration = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(duration)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->DisableActionWithDuration(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID, duration); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, enableAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::EnableAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnableAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, enableActionWithDuration) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID, jlong duration) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID, jobject duration) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::EnableActionWithDuration::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + request.duration = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(duration)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnableActionWithDuration(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID, duration); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, instantAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::InstantAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->InstantAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, instantActionWithTransition) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID, jint transitionTime) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID, jobject transitionTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::InstantActionWithTransition::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->InstantActionWithTransition(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID, transitionTime); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, pauseAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::PauseAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->PauseAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, pauseActionWithDuration) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID, jlong duration) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID, jobject duration) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::PauseActionWithDuration::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + request.duration = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(duration)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->PauseActionWithDuration(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID, duration); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, resumeAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::ResumeAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ResumeAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, startAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::StartAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StartAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, startActionWithDuration) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID, jlong duration) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID, jobject duration) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::StartActionWithDuration::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + request.duration = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(duration)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StartActionWithDuration(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID, duration); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, BridgedActionsCluster, stopAction) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint actionID, jlong invokeID) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject actionID, jobject invokeID) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; BridgedActionsCluster * cppCluster; + chip::app::Clusters::BridgedActions::Commands::StopAction::Type request; + + request.actionID = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(actionID)); + chip::JniReferences::GetInstance().GetOptionalValue(invokeID, invokeID); + request.invokeID = chip::Optional( + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(invokeID))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StopAction(onSuccess->Cancel(), onFailure->Cancel(), actionID, invokeID); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, BridgedDeviceBasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -7174,948 +1576,877 @@ JNI_METHOD(jlong, ColorControlCluster, initWithDevice)(JNIEnv * env, jobject sel } JNI_METHOD(void, ColorControlCluster, colorLoopSet) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint updateFlags, jint action, jint direction, jint time, - jint startHue, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject updateFlags, jobject action, jobject direction, + jobject time, jobject startHue, jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type request; + + request.updateFlags = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(updateFlags)); + request.action = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(action)); + request.direction = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(direction)); + request.time = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(time)); + request.startHue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(startHue)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ColorLoopSet(onSuccess->Cancel(), onFailure->Cancel(), updateFlags, static_cast(action), - static_cast(direction), time, startHue, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, enhancedMoveHue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint moveMode, jint rate, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionsMask, + jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnhancedMoveHue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(moveMode), rate, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, enhancedMoveToHue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint enhancedHue, jint direction, jint transitionTime, - jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject enhancedHue, jobject direction, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type request; + + request.enhancedHue = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(enhancedHue)); + request.direction = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(direction)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnhancedMoveToHue(onSuccess->Cancel(), onFailure->Cancel(), enhancedHue, static_cast(direction), - transitionTime, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, enhancedMoveToHueAndSaturation) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint enhancedHue, jint saturation, jint transitionTime, - jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject enhancedHue, jobject saturation, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type request; + + request.enhancedHue = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(enhancedHue)); + request.saturation = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(saturation)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnhancedMoveToHueAndSaturation(onSuccess->Cancel(), onFailure->Cancel(), enhancedHue, saturation, - transitionTime, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, enhancedStepHue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepMode, jint stepSize, jint transitionTime, - jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnhancedStepHue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(stepMode), stepSize, - transitionTime, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveColor) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint rateX, jint rateY, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject rateX, jobject rateY, jobject optionsMask, + jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveColor::Type request; + + request.rateX = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rateX)); + request.rateY = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rateY)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveColorTemperature) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint moveMode, jint rate, jint colorTemperatureMinimum, - jint colorTemperatureMaximum, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject colorTemperatureMinimum, + jobject colorTemperatureMaximum, jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.colorTemperatureMinimum = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(colorTemperatureMinimum)); + request.colorTemperatureMaximum = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(colorTemperatureMaximum)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), static_cast(moveMode), rate, - colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveHue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint moveMode, jint rate, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionsMask, + jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveHue::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveHue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(moveMode), rate, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveSaturation) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint moveMode, jint rate, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionsMask, + jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), static_cast(moveMode), rate, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveToColor) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint colorX, jint colorY, jint transitionTime, jint optionsMask, - jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject colorX, jobject colorY, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type request; + + request.colorX = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(colorX)); + request.colorY = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(colorY)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToColor(onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveToColorTemperature) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint colorTemperature, jint transitionTime, jint optionsMask, - jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject colorTemperature, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type request; + + request.colorTemperature = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(colorTemperature)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, - optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveToHue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint hue, jint direction, jint transitionTime, jint optionsMask, - jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject hue, jobject direction, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type request; + + request.hue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hue)); + request.direction = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(direction)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToHue(onSuccess->Cancel(), onFailure->Cancel(), hue, static_cast(direction), transitionTime, - optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveToHueAndSaturation) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint hue, jint saturation, jint transitionTime, jint optionsMask, - jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject hue, jobject saturation, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type request; + + request.hue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hue)); + request.saturation = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(saturation)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToHueAndSaturation(onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, moveToSaturation) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint saturation, jint transitionTime, jint optionsMask, - jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject saturation, jobject transitionTime, jobject optionsMask, + jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type request; + + request.saturation = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(saturation)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToSaturation(onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, stepColor) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepX, jint stepY, jint transitionTime, jint optionsMask, - jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepX, jobject stepY, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::StepColor::Type request; + + request.stepX = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepX)); + request.stepY = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepY)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = - cppCluster->StepColor(onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, stepColorTemperature) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepMode, jint stepSize, jint transitionTime, - jint colorTemperatureMinimum, jint colorTemperatureMaximum, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject colorTemperatureMinimum, jobject colorTemperatureMaximum, jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.colorTemperatureMinimum = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(colorTemperatureMinimum)); + request.colorTemperatureMaximum = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(colorTemperatureMaximum)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), static_cast(stepMode), stepSize, - transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, - optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, stepHue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepMode, jint stepSize, jint transitionTime, - jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::StepHue::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StepHue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(stepMode), stepSize, transitionTime, - optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, stepSaturation) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepMode, jint stepSize, jint transitionTime, - jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::StepSaturation::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StepSaturation(onSuccess->Cancel(), onFailure->Cancel(), static_cast(stepMode), stepSize, - transitionTime, optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, stopMoveStep) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint optionsMask, jint optionsOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject optionsMask, jobject optionsOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster; + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type request; + + request.optionsMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsMask)); + request.optionsOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionsOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ColorControlCluster, subscribeCurrentHueAttribute) @@ -8808,13 +3139,16 @@ JNI_METHOD(jlong, ContentLauncherCluster, initWithDevice)(JNIEnv * env, jobject } JNI_METHOD(void, ContentLauncherCluster, launchContent) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean autoPlay, jstring data) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject autoPlay, jstring data) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ContentLauncherCluster * cppCluster; - JniUtfString dataStr(env, data); + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type request; + + request.autoPlay = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(autoPlay)); + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); std::unique_ptr @@ -8822,43 +3156,29 @@ JNI_METHOD(void, ContentLauncherCluster, launchContent) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->LaunchContent(onSuccess->Cancel(), onFailure->Cancel(), autoPlay, - chip::CharSpan(dataStr.c_str(), strlen(dataStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ContentLauncherCluster, launchURL) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring contentURL, jstring displayString) @@ -8867,8 +3187,10 @@ JNI_METHOD(void, ContentLauncherCluster, launchURL) CHIP_ERROR err = CHIP_NO_ERROR; ContentLauncherCluster * cppCluster; - JniUtfString contentURLStr(env, contentURL); - JniUtfString displayStringStr(env, displayString); + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type request; + + request.contentURL = chip::JniUtfString(env, static_cast(contentURL)).charSpan(); + request.displayString = chip::JniUtfString(env, static_cast(displayString)).charSpan(); std::unique_ptr @@ -8876,44 +3198,29 @@ JNI_METHOD(void, ContentLauncherCluster, launchURL) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->LaunchURL(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(contentURLStr.c_str(), strlen(contentURLStr.c_str())), - chip::CharSpan(displayStringStr.c_str(), strlen(displayStringStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, DescriptorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -8934,14 +3241,19 @@ JNI_METHOD(jlong, DiagnosticLogsCluster, initWithDevice)(JNIEnv * env, jobject s } JNI_METHOD(void, DiagnosticLogsCluster, retrieveLogsRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint intent, jint requestedProtocol, +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject intent, jobject requestedProtocol, jbyteArray transferFileDesignator) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DiagnosticLogsCluster * cppCluster; - JniByteArray transferFileDesignatorArr(env, transferFileDesignator); + chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; + + request.intent = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(intent)); + request.requestedProtocol = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(requestedProtocol)); + request.transferFileDesignator = chip::JniByteArray(env, static_cast(transferFileDesignator)).byteSpan(); std::unique_ptr @@ -8949,44 +3261,29 @@ JNI_METHOD(void, DiagnosticLogsCluster, retrieveLogsRequest) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RetrieveLogsRequest( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(intent), static_cast(requestedProtocol), - chip::ByteSpan((const uint8_t *) transferFileDesignatorArr.data(), transferFileDesignatorArr.size())); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, DoorLockCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -9003,47 +3300,36 @@ JNI_METHOD(void, DoorLockCluster, clearAllPins)(JNIEnv * env, jobject self, jlon CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearAllPins::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearAllPins(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, clearAllRfids)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -9051,635 +3337,523 @@ JNI_METHOD(void, DoorLockCluster, clearAllRfids)(JNIEnv * env, jobject self, jlo CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearAllRfids::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, clearHolidaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, clearPin)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId) +JNI_METHOD(void, DoorLockCluster, clearPin)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearPin::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, clearRfid)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId) +JNI_METHOD(void, DoorLockCluster, clearRfid)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearRfid::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, clearWeekdaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jint userId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearWeekdaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, clearYeardaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jint userId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::ClearYeardaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, getHolidaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, getLogRecord)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint logIndex) +JNI_METHOD(void, DoorLockCluster, getLogRecord)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject logIndex) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetLogRecord::Type request; + + request.logIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(logIndex)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, getPin)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId) +JNI_METHOD(void, DoorLockCluster, getPin)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetPin::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, getRfid)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId) +JNI_METHOD(void, DoorLockCluster, getRfid)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetRfid::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, getUserType)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId) +JNI_METHOD(void, DoorLockCluster, getUserType)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetUserType::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, getWeekdaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jint userId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetWeekdaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, getYeardaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jint userId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject userId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::GetYeardaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, lockDoor)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray pin) { @@ -9687,359 +3861,313 @@ JNI_METHOD(void, DoorLockCluster, lockDoor)(JNIEnv * env, jobject self, jlong cl CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; - JniByteArray pinArr(env, pin); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type request; + + request.pin = chip::JniByteArray(env, static_cast(pin)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->LockDoor(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) pinArr.data(), pinArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, setHolidaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jlong localStartTime, jlong localEndTime, - jint operatingModeDuringHoliday) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject localStartTime, jobject localEndTime, + jobject operatingModeDuringHoliday) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.localStartTime = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(localStartTime)); + request.localEndTime = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(localEndTime)); + request.operatingModeDuringHoliday = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(operatingModeDuringHoliday)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, - operatingModeDuringHoliday); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, setPin) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId, jint userStatus, jint userType, jbyteArray pin) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId, jobject userStatus, jobject userType, + jbyteArray pin) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; - JniByteArray pinArr(env, pin); + chip::app::Clusters::DoorLock::Commands::SetPin::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + request.userStatus = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); + request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); + request.pin = chip::JniByteArray(env, static_cast(pin)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, static_cast(userStatus), - static_cast(userType), chip::ByteSpan((const uint8_t *) pinArr.data(), pinArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, setRfid) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId, jint userStatus, jint userType, jbyteArray id) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId, jobject userStatus, jobject userType, + jbyteArray id) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; - JniByteArray idArr(env, id); + chip::app::Clusters::DoorLock::Commands::SetRfid::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + request.userStatus = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); + request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); + request.id = chip::JniByteArray(env, static_cast(id)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, static_cast(userStatus), - static_cast(userType), chip::ByteSpan((const uint8_t *) idArr.data(), idArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, setUserType) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint userId, jint userType) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userId, jobject userType) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::SetUserType::Type request; + + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, static_cast(userType)); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, setWeekdaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jint userId, jint daysMask, jint startHour, - jint startMinute, jint endHour, jint endMinute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject userId, jobject daysMask, + jobject startHour, jobject startMinute, jobject endHour, jobject endMinute) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::SetWeekdaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + request.daysMask = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(daysMask)); + request.startHour = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(startHour)); + request.startMinute = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(startMinute)); + request.endHour = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endHour)); + request.endMinute = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endMinute)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, - startMinute, endHour, endMinute); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, setYeardaySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint scheduleId, jint userId, jlong localStartTime, - jlong localEndTime) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject scheduleId, jobject userId, jobject localStartTime, + jobject localEndTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; + chip::app::Clusters::DoorLock::Commands::SetYeardaySchedule::Type request; + + request.scheduleId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(scheduleId)); + request.userId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userId)); + request.localStartTime = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(localStartTime)); + request.localEndTime = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(localEndTime)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = - cppCluster->SetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, unlockDoor)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray pin) { @@ -10047,59 +4175,51 @@ JNI_METHOD(void, DoorLockCluster, unlockDoor)(JNIEnv * env, jobject self, jlong CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; - JniByteArray pinArr(env, pin); + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type request; + + request.pin = chip::JniByteArray(env, static_cast(pin)).byteSpan(); std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) pinArr.data(), pinArr.size())); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, unlockWithTimeout) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint timeoutInSeconds, jbyteArray pin) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timeoutInSeconds, jbyteArray pin) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; DoorLockCluster * cppCluster; - JniByteArray pinArr(env, pin); + chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type request; + + request.timeoutInSeconds = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(timeoutInSeconds)); + request.pin = chip::JniByteArray(env, static_cast(pin)).byteSpan(); std::unique_ptr @@ -10107,43 +4227,29 @@ JNI_METHOD(void, DoorLockCluster, unlockWithTimeout) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds, - chip::ByteSpan((const uint8_t *) pinArr.data(), pinArr.size())); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) @@ -10224,46 +4330,34 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, j CHIP_ERROR err = CHIP_NO_ERROR; EthernetNetworkDiagnosticsCluster * cppCluster; + chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ResetCounts(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, FixedLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -10293,54 +4387,48 @@ JNI_METHOD(jlong, GeneralCommissioningCluster, initWithDevice)(JNIEnv * env, job } JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint expiryLengthSeconds, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject expiryLengthSeconds, jobject breadcrumb, jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GeneralCommissioningCluster * cppCluster; + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type request; + + request.expiryLengthSeconds = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(expiryLengthSeconds)); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ArmFailSafe(onSuccess->Cancel(), onFailure->Cancel(), expiryLengthSeconds, breadcrumb, timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -10348,58 +4436,53 @@ JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete)(JNIEnv * en CHIP_ERROR err = CHIP_NO_ERROR; GeneralCommissioningCluster * cppCluster; + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->CommissioningComplete(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint location, jstring countryCode, jlong breadcrumb, - jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject location, jstring countryCode, jobject breadcrumb, + jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GeneralCommissioningCluster * cppCluster; - JniUtfString countryCodeStr(env, countryCode); + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; + + request.location = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(location)); + request.countryCode = chip::JniUtfString(env, static_cast(countryCode)).charSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -10407,44 +4490,30 @@ JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetRegulatoryConfig(onSuccess->Cancel(), onFailure->Cancel(), static_cast(location), - chip::CharSpan(countryCodeStr.c_str(), strlen(countryCodeStr.c_str())), breadcrumb, - timeoutMs); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) @@ -10505,157 +4574,126 @@ JNI_METHOD(jlong, GroupsCluster, initWithDevice)(JNIEnv * env, jobject self, jlo } JNI_METHOD(void, GroupsCluster, addGroup) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jstring groupName) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GroupsCluster * cppCluster; - JniUtfString groupNameStr(env, groupName); + chip::app::Clusters::Groups::Commands::AddGroup::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId, - chip::CharSpan(groupNameStr.c_str(), strlen(groupNameStr.c_str()))); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, GroupsCluster, addGroupIfIdentifying) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jstring groupName) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GroupsCluster * cppCluster; - JniUtfString groupNameStr(env, groupName); + chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId, - chip::CharSpan(groupNameStr.c_str(), strlen(groupNameStr.c_str()))); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, GroupsCluster, getGroupMembership) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupCount, jint groupList) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupCount, jobject groupList) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GroupsCluster * cppCluster; + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type request; + + request.groupCount = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupCount)); + request.groupList = chip::app::DataModel::List(); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetGroupMembership(onSuccess->Cancel(), onFailure->Cancel(), groupCount, groupList); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, GroupsCluster, removeAllGroups)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -10663,142 +4701,111 @@ JNI_METHOD(void, GroupsCluster, removeAllGroups)(JNIEnv * env, jobject self, jlo CHIP_ERROR err = CHIP_NO_ERROR; GroupsCluster * cppCluster; + chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveAllGroups(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, GroupsCluster, removeGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId) +JNI_METHOD(void, GroupsCluster, removeGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GroupsCluster * cppCluster; + chip::app::Clusters::Groups::Commands::RemoveGroup::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, GroupsCluster, viewGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId) +JNI_METHOD(void, GroupsCluster, viewGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; GroupsCluster * cppCluster; + chip::app::Clusters::Groups::Commands::ViewGroup::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ViewGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, IdentifyCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -10809,52 +4816,43 @@ JNI_METHOD(jlong, IdentifyCluster, initWithDevice)(JNIEnv * env, jobject self, j return reinterpret_cast(cppCluster); } -JNI_METHOD(void, IdentifyCluster, identify)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint identifyTime) +JNI_METHOD(void, IdentifyCluster, identify)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject identifyTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; IdentifyCluster * cppCluster; + chip::app::Clusters::Identify::Commands::Identify::Type request; + + request.identifyTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(identifyTime)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Identify(onSuccess->Cancel(), onFailure->Cancel(), identifyTime); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, IdentifyCluster, identifyQuery)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -10862,96 +4860,77 @@ JNI_METHOD(void, IdentifyCluster, identifyQuery)(JNIEnv * env, jobject self, jlo CHIP_ERROR err = CHIP_NO_ERROR; IdentifyCluster * cppCluster; + chip::app::Clusters::Identify::Commands::IdentifyQuery::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->IdentifyQuery(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, IdentifyCluster, triggerEffect) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint effectIdentifier, jint effectVariant) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectIdentifier, jobject effectVariant) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; IdentifyCluster * cppCluster; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type request; + + request.effectIdentifier = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); + request.effectVariant = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TriggerEffect(onSuccess->Cancel(), onFailure->Cancel(), static_cast(effectIdentifier), - static_cast(effectVariant)); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) @@ -11057,53 +5036,44 @@ JNI_METHOD(jlong, KeypadInputCluster, initWithDevice)(JNIEnv * env, jobject self return reinterpret_cast(cppCluster); } -JNI_METHOD(void, KeypadInputCluster, sendKey)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint keyCode) +JNI_METHOD(void, KeypadInputCluster, sendKey)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject keyCode) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; KeypadInputCluster * cppCluster; + chip::app::Clusters::KeypadInput::Commands::SendKey::Type request; + + request.keyCode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(keyCode)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SendKey(onSuccess->Cancel(), onFailure->Cancel(), static_cast(keyCode)); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, LevelControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -11115,345 +5085,300 @@ JNI_METHOD(jlong, LevelControlCluster, initWithDevice)(JNIEnv * env, jobject sel } JNI_METHOD(void, LevelControlCluster, move) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint moveMode, jint rate, jint optionMask, jint optionOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionMask, + jobject optionOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::Move::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Move(onSuccess->Cancel(), onFailure->Cancel(), static_cast(moveMode), rate, optionMask, - optionOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, moveToLevel) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint level, jint transitionTime, jint optionMask, - jint optionOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, jobject optionMask, + jobject optionOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type request; + + request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToLevel(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime, optionMask, optionOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, moveToLevelWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint level, jint transitionTime) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type request; + + request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveToLevelWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, moveWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint moveMode, jint rate) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MoveWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), static_cast(moveMode), rate); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, step) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepMode, jint stepSize, jint transitionTime, jint optionMask, - jint optionOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject optionMask, jobject optionOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::Step::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Step(onSuccess->Cancel(), onFailure->Cancel(), static_cast(stepMode), stepSize, transitionTime, - optionMask, optionOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, stepWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint stepMode, jint stepSize, jint transitionTime) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StepWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), static_cast(stepMode), stepSize, - transitionTime); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, stop) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint optionMask, jint optionOverride) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject optionMask, jobject optionOverride) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::Stop::Type request; + + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Stop(onSuccess->Cancel(), onFailure->Cancel(), optionMask, optionOverride); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, stopWithOnOff)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -11461,46 +5386,34 @@ JNI_METHOD(void, LevelControlCluster, stopWithOnOff)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; LevelControlCluster * cppCluster; + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StopWithOnOff(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, LevelControlCluster, subscribeCurrentLevelAttribute) @@ -11789,46 +5702,34 @@ JNI_METHOD(void, LowPowerCluster, sleep)(JNIEnv * env, jobject self, jlong clust CHIP_ERROR err = CHIP_NO_ERROR; LowPowerCluster * cppCluster; + chip::app::Clusters::LowPower::Commands::Sleep::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Sleep(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, MediaInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -11845,144 +5746,110 @@ JNI_METHOD(void, MediaInputCluster, hideInputStatus)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; MediaInputCluster * cppCluster; + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->HideInputStatus(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaInputCluster, renameInput) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint index, jstring name) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; MediaInputCluster * cppCluster; - JniUtfString nameStr(env, name); + chip::app::Clusters::MediaInput::Commands::RenameInput::Type request; + + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RenameInput(onSuccess->Cancel(), onFailure->Cancel(), index, - chip::CharSpan(nameStr.c_str(), strlen(nameStr.c_str()))); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, MediaInputCluster, selectInput)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint index) +JNI_METHOD(void, MediaInputCluster, selectInput)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; MediaInputCluster * cppCluster; + chip::app::Clusters::MediaInput::Commands::SelectInput::Type request; + + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SelectInput(onSuccess->Cancel(), onFailure->Cancel(), index); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaInputCluster, showInputStatus)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -11990,46 +5857,34 @@ JNI_METHOD(void, MediaInputCluster, showInputStatus)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; MediaInputCluster * cppCluster; + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ShowInputStatus(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, MediaPlaybackCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -12046,48 +5901,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaFastForward)(JNIEnv * env, jobject s CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaFastForward(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaNext)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12095,48 +5939,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaNext)(JNIEnv * env, jobject self, jl CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaNext(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaPause)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12144,48 +5977,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaPause)(JNIEnv * env, jobject self, j CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaPause(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaPlay)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12193,48 +6015,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaPlay)(JNIEnv * env, jobject self, jl CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaPlay(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaPrevious)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12242,48 +6053,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaPrevious)(JNIEnv * env, jobject self CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaPrevious(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaRewind)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12291,197 +6091,161 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaRewind)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaRewind(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, mediaSeek)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong position) +JNI_METHOD(void, MediaPlaybackCluster, mediaSeek)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject position) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type request; + + request.position = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(position)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaSeek(onSuccess->Cancel(), onFailure->Cancel(), position); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaSkipBackward) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong deltaPositionMilliseconds) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type request; + + request.deltaPositionMilliseconds = static_cast( + chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaSkipBackward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaSkipForward) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong deltaPositionMilliseconds) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type request; + + request.deltaPositionMilliseconds = static_cast( + chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaSkipForward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaStartOver)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12489,48 +6253,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaStartOver)(JNIEnv * env, jobject sel CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaStartOver(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, MediaPlaybackCluster, mediaStop)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -12538,48 +6291,37 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaStop)(JNIEnv * env, jobject self, jl CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->MediaStop(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, ModeSelectCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -12590,52 +6332,42 @@ JNI_METHOD(jlong, ModeSelectCluster, initWithDevice)(JNIEnv * env, jobject self, return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ModeSelectCluster, changeToMode)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint newMode) +JNI_METHOD(void, ModeSelectCluster, changeToMode)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject newMode) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ModeSelectCluster * cppCluster; + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type request; + + request.newMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(newMode)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ChangeToMode(onSuccess->Cancel(), onFailure->Cancel(), newMode); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) @@ -12733,13 +6465,18 @@ JNI_METHOD(jlong, NetworkCommissioningCluster, initWithDevice)(JNIEnv * env, job } JNI_METHOD(void, NetworkCommissioningCluster, addThreadNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jobject breadcrumb, + jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray operationalDatasetArr(env, operationalDataset); + chip::app::Clusters::NetworkCommissioning::Commands::AddThreadNetwork::Type request; + + request.operationalDataset = chip::JniByteArray(env, static_cast(operationalDataset)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -12747,55 +6484,44 @@ JNI_METHOD(void, NetworkCommissioningCluster, addThreadNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddThreadNetwork(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) operationalDatasetArr.data(), operationalDatasetArr.size()), - breadcrumb, timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, addWiFiNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jlong breadcrumb, - jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jobject breadcrumb, + jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray ssidArr(env, ssid); - JniByteArray credentialsArr(env, credentials); + chip::app::Clusters::NetworkCommissioning::Commands::AddWiFiNetwork::Type request; + + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.credentials = chip::JniByteArray(env, static_cast(credentials)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -12803,53 +6529,42 @@ JNI_METHOD(void, NetworkCommissioningCluster, addWiFiNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddWiFiNetwork( - onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) ssidArr.data(), ssidArr.size()), - chip::ByteSpan((const uint8_t *) credentialsArr.data(), credentialsArr.size()), breadcrumb, timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, disableNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray networkIDArr(env, networkID); + chip::app::Clusters::NetworkCommissioning::Commands::DisableNetwork::Type request; + + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -12857,53 +6572,42 @@ JNI_METHOD(void, NetworkCommissioningCluster, disableNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->DisableNetwork(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) networkIDArr.data(), networkIDArr.size()), breadcrumb, - timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, enableNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray networkIDArr(env, networkID); + chip::app::Clusters::NetworkCommissioning::Commands::EnableNetwork::Type request; + + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -12911,53 +6615,42 @@ JNI_METHOD(void, NetworkCommissioningCluster, enableNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->EnableNetwork(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) networkIDArr.data(), networkIDArr.size()), breadcrumb, - timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray networkIDArr(env, networkID); + chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type request; + + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -12965,53 +6658,42 @@ JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveNetwork(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) networkIDArr.data(), networkIDArr.size()), breadcrumb, - timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jobject breadcrumb, jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray ssidArr(env, ssid); + chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type request; + + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -13019,52 +6701,43 @@ JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ScanNetworks(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) ssidArr.data(), ssidArr.size()), breadcrumb, timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, updateThreadNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jlong breadcrumb, jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jobject breadcrumb, + jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray operationalDatasetArr(env, operationalDataset); + chip::app::Clusters::NetworkCommissioning::Commands::UpdateThreadNetwork::Type request; + + request.operationalDataset = chip::JniByteArray(env, static_cast(operationalDataset)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -13072,55 +6745,45 @@ JNI_METHOD(void, NetworkCommissioningCluster, updateThreadNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UpdateThreadNetwork( - onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) operationalDatasetArr.data(), operationalDatasetArr.size()), breadcrumb, timeoutMs); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, NetworkCommissioningCluster, updateWiFiNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jlong breadcrumb, - jlong timeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jobject breadcrumb, + jobject timeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; NetworkCommissioningCluster * cppCluster; - JniByteArray ssidArr(env, ssid); - JniByteArray credentialsArr(env, credentials); + chip::app::Clusters::NetworkCommissioning::Commands::UpdateWiFiNetwork::Type request; + + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.credentials = chip::JniByteArray(env, static_cast(credentials)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); std::unique_ptr @@ -13128,44 +6791,29 @@ JNI_METHOD(void, NetworkCommissioningCluster, updateWiFiNetwork) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UpdateWiFiNetwork( - onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) ssidArr.data(), ssidArr.size()), - chip::ByteSpan((const uint8_t *) credentialsArr.data(), credentialsArr.size()), breadcrumb, timeoutMs); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -13177,13 +6825,16 @@ JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env } JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jlong newVersion) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject newVersion) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OtaSoftwareUpdateProviderCluster * cppCluster; - JniByteArray updateTokenArr(env, updateToken); + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; + + request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); + request.newVersion = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(newVersion)); std::unique_ptr @@ -13191,107 +6842,97 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = - cppCluster->ApplyUpdateRequest(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) updateTokenArr.data(), updateTokenArr.size()), newVersion); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jlong softwareVersion) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject softwareVersion) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OtaSoftwareUpdateProviderCluster * cppCluster; - JniByteArray updateTokenArr(env, updateToken); + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; + + request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); + request.softwareVersion = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->NotifyUpdateApplied(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) updateTokenArr.data(), updateTokenArr.size()), - softwareVersion); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint vendorId, jint productId, jlong softwareVersion, - jint protocolsSupported, jint hardwareVersion, jstring location, jboolean requestorCanConsent, jbyteArray metadataForProvider) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject vendorId, jobject productId, jobject softwareVersion, + jobject protocolsSupported, jobject hardwareVersion, jobject location, jobject requestorCanConsent, jobject metadataForProvider) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OtaSoftwareUpdateProviderCluster * cppCluster; - JniUtfString locationStr(env, location); - JniByteArray metadataForProviderArr(env, metadataForProvider); + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; + + request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); + request.productId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(productId)); + request.softwareVersion = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); + request.protocolsSupported = + chip::app::DataModel::List(); + chip::JniReferences::GetInstance().GetOptionalValue(hardwareVersion, hardwareVersion); + request.hardwareVersion = chip::Optional( + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hardwareVersion))); + chip::JniReferences::GetInstance().GetOptionalValue(location, location); + request.location = chip::Optional(chip::JniUtfString(env, static_cast(location)).charSpan()); + chip::JniReferences::GetInstance().GetOptionalValue(requestorCanConsent, requestorCanConsent); + request.requestorCanConsent = chip::Optional(static_cast( + chip::JniReferences::GetInstance().BooleanToPrimitive(requestorCanConsent))); + chip::JniReferences::GetInstance().GetOptionalValue(metadataForProvider, metadataForProvider); + request.metadataForProvider = + chip::Optional(chip::JniByteArray(env, static_cast(metadataForProvider)).byteSpan()); std::unique_ptr @@ -13299,45 +6940,29 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->QueryImage(onSuccess->Cancel(), onFailure->Cancel(), static_cast(vendorId), productId, - softwareVersion, static_cast(protocolsSupported), hardwareVersion, - chip::CharSpan(locationStr.c_str(), strlen(locationStr.c_str())), requestorCanConsent, - chip::ByteSpan((const uint8_t *) metadataForProviderArr.data(), metadataForProviderArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, OtaSoftwareUpdateRequestorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -13349,57 +6974,50 @@ JNI_METHOD(jlong, OtaSoftwareUpdateRequestorCluster, initWithDevice)(JNIEnv * en } JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong providerLocation, jint vendorId, jint announcementReason, - jbyteArray metadataForNode) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject providerLocation, jobject vendorId, + jobject announcementReason, jobject metadataForNode) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OtaSoftwareUpdateRequestorCluster * cppCluster; - JniByteArray metadataForNodeArr(env, metadataForNode); + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; + + request.providerLocation = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(providerLocation)); + request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); + request.announcementReason = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(announcementReason)); + chip::JniReferences::GetInstance().GetOptionalValue(metadataForNode, metadataForNode); + request.metadataForNode = + chip::Optional(chip::JniByteArray(env, static_cast(metadataForNode)).byteSpan()); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AnnounceOtaProvider(onSuccess->Cancel(), onFailure->Cancel(), providerLocation, - static_cast(vendorId), static_cast(announcementReason), - chip::ByteSpan((const uint8_t *) metadataForNodeArr.data(), metadataForNodeArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, writeDefaultOtaProviderAttribute) @@ -13512,95 +7130,74 @@ JNI_METHOD(void, OnOffCluster, off)(JNIEnv * env, jobject self, jlong clusterPtr CHIP_ERROR err = CHIP_NO_ERROR; OnOffCluster * cppCluster; + chip::app::Clusters::OnOff::Commands::Off::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Off(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OnOffCluster, offWithEffect) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint effectId, jint effectVariant) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectId, jobject effectVariant) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OnOffCluster * cppCluster; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type request; + + request.effectId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectId)); + request.effectVariant = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->OffWithEffect(onSuccess->Cancel(), onFailure->Cancel(), static_cast(effectId), - static_cast(effectVariant)); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OnOffCluster, on)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -13608,46 +7205,34 @@ JNI_METHOD(void, OnOffCluster, on)(JNIEnv * env, jobject self, jlong clusterPtr, CHIP_ERROR err = CHIP_NO_ERROR; OnOffCluster * cppCluster; + chip::app::Clusters::OnOff::Commands::On::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->On(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OnOffCluster, onWithRecallGlobalScene)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -13655,94 +7240,76 @@ JNI_METHOD(void, OnOffCluster, onWithRecallGlobalScene)(JNIEnv * env, jobject se CHIP_ERROR err = CHIP_NO_ERROR; OnOffCluster * cppCluster; + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->OnWithRecallGlobalScene(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OnOffCluster, onWithTimedOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint onOffControl, jint onTime, jint offWaitTime) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject onOffControl, jobject onTime, jobject offWaitTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OnOffCluster * cppCluster; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type request; + + request.onOffControl = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onOffControl)); + request.onTime = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onTime)); + request.offWaitTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(offWaitTime)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->OnWithTimedOff(onSuccess->Cancel(), onFailure->Cancel(), onOffControl, onTime, offWaitTime); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OnOffCluster, toggle)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -13750,46 +7317,34 @@ JNI_METHOD(void, OnOffCluster, toggle)(JNIEnv * env, jobject self, jlong cluster CHIP_ERROR err = CHIP_NO_ERROR; OnOffCluster * cppCluster; + chip::app::Clusters::OnOff::Commands::Toggle::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Toggle(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) @@ -13987,16 +7542,23 @@ JNI_METHOD(jlong, OperationalCredentialsCluster, initWithDevice)(JNIEnv * env, j } JNI_METHOD(void, OperationalCredentialsCluster, addNOC) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jbyteArray ICACValue, jbyteArray IPKValue, - jlong caseAdminNode, jint adminVendorId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, jbyteArray IPKValue, + jobject caseAdminNode, jobject adminVendorId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniByteArray NOCValueArr(env, NOCValue); - JniByteArray ICACValueArr(env, ICACValue); - JniByteArray IPKValueArr(env, IPKValue); + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type request; + + request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); + chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); + request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); + request.IPKValue = chip::JniByteArray(env, static_cast(IPKValue)).byteSpan(); + request.caseAdminNode = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(caseAdminNode)); + request.adminVendorId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(adminVendorId)); std::unique_ptr @@ -14004,45 +7566,29 @@ JNI_METHOD(void, OperationalCredentialsCluster, addNOC) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddNOC( - onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) NOCValueArr.data(), NOCValueArr.size()), - chip::ByteSpan((const uint8_t *) ICACValueArr.data(), ICACValueArr.size()), - chip::ByteSpan((const uint8_t *) IPKValueArr.data(), IPKValueArr.size()), caseAdminNode, adminVendorId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray rootCertificate) @@ -14051,50 +7597,36 @@ JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniByteArray rootCertificateArr(env, rootCertificate); + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; + + request.rootCertificate = chip::JniByteArray(env, static_cast(rootCertificate)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddTrustedRootCertificate( - onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) rootCertificateArr.data(), rootCertificateArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray attestationNonce) @@ -14103,7 +7635,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniByteArray attestationNonceArr(env, attestationNonce); + chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type request; + + request.attestationNonce = chip::JniByteArray(env, static_cast(attestationNonce)).byteSpan(); std::unique_ptr @@ -14111,93 +7645,72 @@ JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AttestationRequest(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) attestationNonceArr.data(), attestationNonceArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint certificateType) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject certificateType) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; + chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type request; + + request.certificateType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(certificateType)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->CertificateChainRequest(onSuccess->Cancel(), onFailure->Cancel(), certificateType); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray CSRNonce) @@ -14206,7 +7719,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniByteArray CSRNonceArr(env, CSRNonce); + chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::Type request; + + request.CSRNonce = chip::JniByteArray(env, static_cast(CSRNonce)).byteSpan(); std::unique_ptr @@ -14214,93 +7729,71 @@ JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->OpCSRRequest(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) CSRNonceArr.data(), CSRNonceArr.size())); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, removeFabric) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint fabricIndex) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject fabricIndex) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type request; + + request.fabricIndex = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(fabricIndex)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricIndex); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray trustedRootIdentifier) @@ -14309,50 +7802,36 @@ JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniByteArray trustedRootIdentifierArr(env, trustedRootIdentifier); + chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type request; + + request.trustedRootIdentifier = chip::JniByteArray(env, static_cast(trustedRootIdentifier)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveTrustedRootCertificate( - onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) trustedRootIdentifierArr.data(), trustedRootIdentifierArr.size())); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring label) @@ -14361,7 +7840,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniUtfString labelStr(env, label); + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type request; + + request.label = chip::JniUtfString(env, static_cast(label)).charSpan(); std::unique_ptr @@ -14369,53 +7850,42 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UpdateFabricLabel(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(labelStr.c_str(), strlen(labelStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jbyteArray ICACValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; OperationalCredentialsCluster * cppCluster; - JniByteArray NOCValueArr(env, NOCValue); - JniByteArray ICACValueArr(env, ICACValue); + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type request; + + request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); + chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); + request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); std::unique_ptr @@ -14423,44 +7893,29 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UpdateNOC(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) NOCValueArr.data(), NOCValueArr.size()), - chip::ByteSpan((const uint8_t *) ICACValueArr.data(), ICACValueArr.size())); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, PowerSourceCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -14847,349 +8302,291 @@ JNI_METHOD(jlong, ScenesCluster, initWithDevice)(JNIEnv * env, jobject self, jlo } JNI_METHOD(void, ScenesCluster, addScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jint sceneId, jint transitionTime, jstring sceneName, - jlong clusterId, jint length, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, + jstring sceneName, jobject clusterId, jobject length, jobject value) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; - JniUtfString sceneNameStr(env, sceneName); + chip::app::Clusters::Scenes::Commands::AddScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.sceneName = chip::JniUtfString(env, static_cast(sceneName)).charSpan(); + request.extensionFieldSets = + chip::app::DataModel::List(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->AddScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime, - chip::CharSpan(sceneNameStr.c_str(), strlen(sceneNameStr.c_str())), clusterId, length, value); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ScenesCluster, getSceneMembership)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId) +JNI_METHOD(void, ScenesCluster, getSceneMembership)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetSceneMembership(onSuccess->Cancel(), onFailure->Cancel(), groupId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ScenesCluster, recallScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jint sceneId, jint transitionTime) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::RecallScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RecallScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ScenesCluster, removeAllScenes)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId) +JNI_METHOD(void, ScenesCluster, removeAllScenes)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveAllScenes(onSuccess->Cancel(), onFailure->Cancel(), groupId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ScenesCluster, removeScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jint sceneId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::RemoveScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->RemoveScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ScenesCluster, storeScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jint sceneId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::StoreScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StoreScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ScenesCluster, viewScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint groupId, jint sceneId) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::ViewScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ViewScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, SoftwareDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -15206,46 +8603,34 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks)(JNIEnv * env, jobj CHIP_ERROR err = CHIP_NO_ERROR; SoftwareDiagnosticsCluster * cppCluster; + chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ResetWatermarks(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, SwitchCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -15325,7 +8710,9 @@ JNI_METHOD(void, TvChannelCluster, changeChannel)(JNIEnv * env, jobject self, jl CHIP_ERROR err = CHIP_NO_ERROR; TvChannelCluster * cppCluster; - JniUtfString matchStr(env, match); + chip::app::Clusters::TvChannel::Commands::ChangeChannel::Type request; + + request.match = chip::JniUtfString(env, static_cast(match)).charSpan(); std::unique_ptr @@ -15333,138 +8720,107 @@ JNI_METHOD(void, TvChannelCluster, changeChannel)(JNIEnv * env, jobject self, jl Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ChangeChannel(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(matchStr.c_str(), strlen(matchStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TvChannelCluster, changeChannelByNumber) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint majorNumber, jint minorNumber) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject majorNumber, jobject minorNumber) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TvChannelCluster * cppCluster; + chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::Type request; + + request.majorNumber = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(majorNumber)); + request.minorNumber = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(minorNumber)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ChangeChannelByNumber(onSuccess->Cancel(), onFailure->Cancel(), majorNumber, minorNumber); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TvChannelCluster, skipChannel)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint count) +JNI_METHOD(void, TvChannelCluster, skipChannel)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject count) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TvChannelCluster * cppCluster; + chip::app::Clusters::TvChannel::Commands::SkipChannel::Type request; + + request.count = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(count)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SkipChannel(onSuccess->Cancel(), onFailure->Cancel(), count); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, TargetNavigatorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -15476,13 +8832,16 @@ JNI_METHOD(jlong, TargetNavigatorCluster, initWithDevice)(JNIEnv * env, jobject } JNI_METHOD(void, TargetNavigatorCluster, navigateTarget) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint target, jstring data) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject target, jstring data) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TargetNavigatorCluster * cppCluster; - JniUtfString dataStr(env, data); + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type request; + + request.target = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(target)); + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); std::unique_ptr @@ -15490,43 +8849,29 @@ JNI_METHOD(void, TargetNavigatorCluster, navigateTarget) Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->NavigateTarget(onSuccess->Cancel(), onFailure->Cancel(), target, - chip::CharSpan(dataStr.c_str(), strlen(dataStr.c_str()))); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, TemperatureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -15663,299 +9008,239 @@ JNI_METHOD(void, TestClusterCluster, test)(JNIEnv * env, jobject self, jlong clu CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::Test::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->Test(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testAddArguments) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint arg1, jint arg2) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type request; + + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestAddArguments(onSuccess->Cancel(), onFailure->Cancel(), arg1, arg2); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testEnumsRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint arg1, jint arg2) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type request; + + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestEnumsRequest(onSuccess->Cancel(), onFailure->Cancel(), static_cast(arg1), - static_cast(arg2)); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint arg1) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestListInt8UArgumentRequest(onSuccess->Cancel(), onFailure->Cancel(), arg1); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint arg1) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestListInt8UReverseRequest(onSuccess->Cancel(), onFailure->Cancel(), arg1); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint a, jboolean b, jint c, jbyteArray d, jstring e, jint f) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; - JniByteArray dArr(env, d); - JniUtfString eStr(env, e); + chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestListStructArgumentRequest(onSuccess->Cancel(), onFailure->Cancel(), a, b, static_cast(c), - chip::ByteSpan((const uint8_t *) dArr.data(), dArr.size()), - chip::CharSpan(eStr.c_str(), strlen(eStr.c_str())), f); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -15963,96 +9248,82 @@ JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestNotHandled(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint arg1) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; + + chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); + uint8_t arg1Value; + if (arg1 != nullptr) + { + arg1Value = chip::JniReferences::GetInstance().IntegerToPrimitive(arg1); + } + request.arg1 = chip::Optional>( + arg1 == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(arg1Value)); + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestNullableOptionalRequest(onSuccess->Cancel(), onFailure->Cancel(), arg1); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testSpecific)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -16060,102 +9331,78 @@ JNI_METHOD(void, TestClusterCluster, testSpecific)(JNIEnv * env, jobject self, j CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestSpecific::Type request; + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestSpecific(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint a, jboolean b, jint c, jbyteArray d, jstring e, jint f) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; - JniByteArray dArr(env, d); - JniUtfString eStr(env, e); + chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type request; + + request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestStructArgumentRequest(onSuccess->Cancel(), onFailure->Cancel(), a, b, static_cast(c), - chip::ByteSpan((const uint8_t *) dArr.data(), dArr.size()), - chip::CharSpan(eStr.c_str(), strlen(eStr.c_str())), f); - SuccessOrExit(err); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, testUnknownCommand)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -16163,46 +9410,34 @@ JNI_METHOD(void, TestClusterCluster, testUnknownCommand)(JNIEnv * env, jobject s CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->TestUnknownCommand(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) @@ -17471,46 +10706,34 @@ JNI_METHOD(void, ThermostatCluster, clearWeeklySchedule)(JNIEnv * env, jobject s CHIP_ERROR err = CHIP_NO_ERROR; ThermostatCluster * cppCluster; + chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ClearWeeklySchedule(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ThermostatCluster, getRelayStatusLog)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -17518,192 +10741,159 @@ JNI_METHOD(void, ThermostatCluster, getRelayStatusLog)(JNIEnv * env, jobject sel CHIP_ERROR err = CHIP_NO_ERROR; ThermostatCluster * cppCluster; + chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetRelayStatusLog(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ThermostatCluster, getWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint daysToReturn, jint modeToReturn) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject daysToReturn, jobject modeToReturn) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ThermostatCluster * cppCluster; + chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type request; + + request.daysToReturn = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(daysToReturn)); + request.modeToReturn = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeToReturn)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GetWeeklySchedule(onSuccess->Cancel(), onFailure->Cancel(), daysToReturn, modeToReturn); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ThermostatCluster, setWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint numberOfTransitionsForSequence, jint dayOfWeekForSequence, - jint modeForSequence, jint payload) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject numberOfTransitionsForSequence, + jobject dayOfWeekForSequence, jobject modeForSequence, jobject payload) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ThermostatCluster * cppCluster; + chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type request; + + request.numberOfTransitionsForSequence = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(numberOfTransitionsForSequence)); + request.dayOfWeekForSequence = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(dayOfWeekForSequence)); + request.modeForSequence = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeForSequence)); + request.payload = chip::app::DataModel::List(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetWeeklySchedule(onSuccess->Cancel(), onFailure->Cancel(), numberOfTransitionsForSequence, - dayOfWeekForSequence, modeForSequence, payload); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ThermostatCluster, setpointRaiseLower) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint mode, jint amount) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject mode, jobject amount) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ThermostatCluster * cppCluster; + chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type request; + + request.mode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(mode)); + request.amount = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(amount)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SetpointRaiseLower(onSuccess->Cancel(), onFailure->Cancel(), static_cast(mode), amount); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) @@ -18161,46 +11351,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, job CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster; + chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ResetCounts(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, WakeOnLanCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -18226,46 +11404,34 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobje CHIP_ERROR err = CHIP_NO_ERROR; WiFiNetworkDiagnosticsCluster * cppCluster; + chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ResetCounts(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, WindowCoveringCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -18282,238 +11448,192 @@ JNI_METHOD(void, WindowCoveringCluster, downOrClose)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->DownOrClose(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, goToLiftPercentage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint liftPercentageValue, jint liftPercent100thsValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject liftPercentageValue, jobject liftPercent100thsValue) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type request; + + request.liftPercentageValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(liftPercentageValue)); + request.liftPercent100thsValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(liftPercent100thsValue)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GoToLiftPercentage(onSuccess->Cancel(), onFailure->Cancel(), liftPercentageValue, liftPercent100thsValue); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, goToLiftValue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint liftValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject liftValue) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::Type request; + + request.liftValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(liftValue)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GoToLiftValue(onSuccess->Cancel(), onFailure->Cancel(), liftValue); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, goToTiltPercentage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint tiltPercentageValue, jint tiltPercent100thsValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject tiltPercentageValue, jobject tiltPercent100thsValue) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type request; + + request.tiltPercentageValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(tiltPercentageValue)); + request.tiltPercent100thsValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(tiltPercent100thsValue)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GoToTiltPercentage(onSuccess->Cancel(), onFailure->Cancel(), tiltPercentageValue, tiltPercent100thsValue); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, goToTiltValue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint tiltValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject tiltValue) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::Type request; + + request.tiltValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(tiltValue)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->GoToTiltValue(onSuccess->Cancel(), onFailure->Cancel(), tiltValue); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, stopMotion)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -18521,46 +11641,34 @@ JNI_METHOD(void, WindowCoveringCluster, stopMotion)(JNIEnv * env, jobject self, CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->StopMotion(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, upOrOpen)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -18568,46 +11676,34 @@ JNI_METHOD(void, WindowCoveringCluster, upOrOpen)(JNIEnv * env, jobject self, jl CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster; + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); cppCluster = reinterpret_cast(clusterPtr); - VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->UpOrOpen(onSuccess->Cancel(), onFailure->Cancel()); - SuccessOrExit(err); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); -exit: - if (err != CHIP_NO_ERROR) - { - jthrowable exception; - jmethodID method; - - err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - - err = chip::AndroidClusterExceptions::GetInstance().CreateIllegalStateException(env, "Error invoking cluster", err, - exception); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); - return; - } - env->CallVoidMethod(callback, method, exception); - } - else - { - onSuccess.release(); - onFailure.release(); - } + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercentageAttribute) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp new file mode 100644 index 00000000000000..4f81a6f70e1004 --- /dev/null +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -0,0 +1,5250 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP +#include "CHIPInvokeCallbacks.h" +#include "CHIPCallbackTypes.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace chip { + +CHIPAccountLoginClusterGetSetupPINResponseCallback::CHIPAccountLoginClusterGetSetupPINResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPAccountLoginClusterGetSetupPINResponseCallback::~CHIPAccountLoginClusterGetSetupPINResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject setupPIN; + + setupPIN = chip::UtfString(env, dataResponse.setupPIN).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, setupPIN); +} +CHIPApplicationLauncherClusterLaunchAppResponseCallback::CHIPApplicationLauncherClusterLaunchAppResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPApplicationLauncherClusterLaunchAppResponseCallback::~CHIPApplicationLauncherClusterLaunchAppResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPApplicationLauncherClusterLaunchAppResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject data; + + data = chip::UtfString(env, dataResponse.data).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, data); +} +CHIPContentLauncherClusterLaunchContentResponseCallback::CHIPContentLauncherClusterLaunchContentResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentLauncherClusterLaunchContentResponseCallback::~CHIPContentLauncherClusterLaunchContentResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPContentLauncherClusterLaunchContentResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject data; + + data = chip::UtfString(env, dataResponse.data).jniValue(); + jobject contentLaunchStatus; + + std::string contentLaunchStatusClassName = "java/lang/Integer"; + std::string contentLaunchStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(contentLaunchStatusClassName.c_str(), + contentLaunchStatusCtorSignature.c_str(), + dataResponse.contentLaunchStatus, contentLaunchStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, data, contentLaunchStatus); +} +CHIPContentLauncherClusterLaunchURLResponseCallback::CHIPContentLauncherClusterLaunchURLResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentLauncherClusterLaunchURLResponseCallback::~CHIPContentLauncherClusterLaunchURLResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPContentLauncherClusterLaunchURLResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject data; + + data = chip::UtfString(env, dataResponse.data).jniValue(); + jobject contentLaunchStatus; + + std::string contentLaunchStatusClassName = "java/lang/Integer"; + std::string contentLaunchStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(contentLaunchStatusClassName.c_str(), + contentLaunchStatusCtorSignature.c_str(), + dataResponse.contentLaunchStatus, contentLaunchStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, data, contentLaunchStatus); +} +CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::~CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;[BLjava/lang/Long;Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject content; + + content = chip::ByteArray(env, dataResponse.content).jniValue(); + jobject timeStamp; + + std::string timeStampClassName = "java/lang/Long"; + std::string timeStampCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(timeStampClassName.c_str(), timeStampCtorSignature.c_str(), + dataResponse.timeStamp, timeStamp); + jobject timeSinceBoot; + + std::string timeSinceBootClassName = "java/lang/Long"; + std::string timeSinceBootCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + timeSinceBootClassName.c_str(), timeSinceBootCtorSignature.c_str(), dataResponse.timeSinceBoot, timeSinceBoot); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, content, timeStamp, timeSinceBoot); +} +CHIPDoorLockClusterClearAllPinsResponseCallback::CHIPDoorLockClusterClearAllPinsResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearAllPinsResponseCallback::~CHIPDoorLockClusterClearAllPinsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearAllPinsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearAllPinsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterClearAllRfidsResponseCallback::CHIPDoorLockClusterClearAllRfidsResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearAllRfidsResponseCallback::~CHIPDoorLockClusterClearAllRfidsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearAllRfidsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearAllRfidsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterClearHolidayScheduleResponseCallback::CHIPDoorLockClusterClearHolidayScheduleResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearHolidayScheduleResponseCallback::~CHIPDoorLockClusterClearHolidayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearHolidayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearHolidayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterClearPinResponseCallback::CHIPDoorLockClusterClearPinResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearPinResponseCallback::~CHIPDoorLockClusterClearPinResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearPinResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearPinResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterClearRfidResponseCallback::CHIPDoorLockClusterClearRfidResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearRfidResponseCallback::~CHIPDoorLockClusterClearRfidResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearRfidResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearRfidResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterClearWeekdayScheduleResponseCallback::CHIPDoorLockClusterClearWeekdayScheduleResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearWeekdayScheduleResponseCallback::~CHIPDoorLockClusterClearWeekdayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearWeekdayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearWeekdayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterClearYeardayScheduleResponseCallback::CHIPDoorLockClusterClearYeardayScheduleResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterClearYeardayScheduleResponseCallback::~CHIPDoorLockClusterClearYeardayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterClearYeardayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::ClearYeardayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterGetHolidayScheduleResponseCallback::CHIPDoorLockClusterGetHolidayScheduleResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetHolidayScheduleResponseCallback::~CHIPDoorLockClusterGetHolidayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetHolidayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject scheduleId; + + std::string scheduleIdClassName = "java/lang/Integer"; + std::string scheduleIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(scheduleIdClassName.c_str(), scheduleIdCtorSignature.c_str(), + dataResponse.scheduleId, scheduleId); + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject localStartTime; + + std::string localStartTimeClassName = "java/lang/Long"; + std::string localStartTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + localStartTimeClassName.c_str(), localStartTimeCtorSignature.c_str(), dataResponse.localStartTime, localStartTime); + jobject localEndTime; + + std::string localEndTimeClassName = "java/lang/Long"; + std::string localEndTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(localEndTimeClassName.c_str(), localEndTimeCtorSignature.c_str(), + dataResponse.localEndTime, localEndTime); + jobject operatingModeDuringHoliday; + + std::string operatingModeDuringHolidayClassName = "java/lang/Integer"; + std::string operatingModeDuringHolidayCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + operatingModeDuringHolidayClassName.c_str(), operatingModeDuringHolidayCtorSignature.c_str(), + dataResponse.operatingModeDuringHoliday, operatingModeDuringHoliday); + + env->CallVoidMethod(javaCallbackRef, javaMethod, scheduleId, status, localStartTime, localEndTime, operatingModeDuringHoliday); +} +CHIPDoorLockClusterGetLogRecordResponseCallback::CHIPDoorLockClusterGetLogRecordResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetLogRecordResponseCallback::~CHIPDoorLockClusterGetLogRecordResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetLogRecordResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetLogRecordResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;[B)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject logEntryId; + + std::string logEntryIdClassName = "java/lang/Integer"; + std::string logEntryIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(logEntryIdClassName.c_str(), logEntryIdCtorSignature.c_str(), + dataResponse.logEntryId, logEntryId); + jobject timestamp; + + std::string timestampClassName = "java/lang/Long"; + std::string timestampCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(timestampClassName.c_str(), timestampCtorSignature.c_str(), + dataResponse.timestamp, timestamp); + jobject eventType; + + std::string eventTypeClassName = "java/lang/Integer"; + std::string eventTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(eventTypeClassName.c_str(), eventTypeCtorSignature.c_str(), + dataResponse.eventType, eventType); + jobject source; + + std::string sourceClassName = "java/lang/Integer"; + std::string sourceCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(sourceClassName.c_str(), sourceCtorSignature.c_str(), + dataResponse.source, source); + jobject eventIdOrAlarmCode; + + std::string eventIdOrAlarmCodeClassName = "java/lang/Integer"; + std::string eventIdOrAlarmCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(eventIdOrAlarmCodeClassName.c_str(), + eventIdOrAlarmCodeCtorSignature.c_str(), + dataResponse.eventIdOrAlarmCode, eventIdOrAlarmCode); + jobject userId; + + std::string userIdClassName = "java/lang/Integer"; + std::string userIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userIdClassName.c_str(), userIdCtorSignature.c_str(), + dataResponse.userId, userId); + jobject pin; + + pin = chip::ByteArray(env, dataResponse.pin).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, logEntryId, timestamp, eventType, source, eventIdOrAlarmCode, userId, pin); +} +CHIPDoorLockClusterGetPinResponseCallback::CHIPDoorLockClusterGetPinResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetPinResponseCallback::~CHIPDoorLockClusterGetPinResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetPinResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetPinResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;[B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject userId; + + std::string userIdClassName = "java/lang/Integer"; + std::string userIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userIdClassName.c_str(), userIdCtorSignature.c_str(), + dataResponse.userId, userId); + jobject userStatus; + + std::string userStatusClassName = "java/lang/Integer"; + std::string userStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userStatusClassName.c_str(), userStatusCtorSignature.c_str(), + dataResponse.userStatus, userStatus); + jobject userType; + + std::string userTypeClassName = "java/lang/Integer"; + std::string userTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userTypeClassName.c_str(), userTypeCtorSignature.c_str(), + dataResponse.userType, userType); + jobject pin; + + pin = chip::ByteArray(env, dataResponse.pin).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, userId, userStatus, userType, pin); +} +CHIPDoorLockClusterGetRfidResponseCallback::CHIPDoorLockClusterGetRfidResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetRfidResponseCallback::~CHIPDoorLockClusterGetRfidResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetRfidResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetRfidResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;[B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject userId; + + std::string userIdClassName = "java/lang/Integer"; + std::string userIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userIdClassName.c_str(), userIdCtorSignature.c_str(), + dataResponse.userId, userId); + jobject userStatus; + + std::string userStatusClassName = "java/lang/Integer"; + std::string userStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userStatusClassName.c_str(), userStatusCtorSignature.c_str(), + dataResponse.userStatus, userStatus); + jobject userType; + + std::string userTypeClassName = "java/lang/Integer"; + std::string userTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userTypeClassName.c_str(), userTypeCtorSignature.c_str(), + dataResponse.userType, userType); + jobject rfid; + + rfid = chip::ByteArray(env, dataResponse.rfid).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, userId, userStatus, userType, rfid); +} +CHIPDoorLockClusterGetUserTypeResponseCallback::CHIPDoorLockClusterGetUserTypeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetUserTypeResponseCallback::~CHIPDoorLockClusterGetUserTypeResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetUserTypeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetUserTypeResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject userId; + + std::string userIdClassName = "java/lang/Integer"; + std::string userIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userIdClassName.c_str(), userIdCtorSignature.c_str(), + dataResponse.userId, userId); + jobject userType; + + std::string userTypeClassName = "java/lang/Integer"; + std::string userTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userTypeClassName.c_str(), userTypeCtorSignature.c_str(), + dataResponse.userType, userType); + + env->CallVoidMethod(javaCallbackRef, javaMethod, userId, userType); +} +CHIPDoorLockClusterGetWeekdayScheduleResponseCallback::CHIPDoorLockClusterGetWeekdayScheduleResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetWeekdayScheduleResponseCallback::~CHIPDoorLockClusterGetWeekdayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetWeekdayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekdayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/" + "lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject scheduleId; + + std::string scheduleIdClassName = "java/lang/Integer"; + std::string scheduleIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(scheduleIdClassName.c_str(), scheduleIdCtorSignature.c_str(), + dataResponse.scheduleId, scheduleId); + jobject userId; + + std::string userIdClassName = "java/lang/Integer"; + std::string userIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userIdClassName.c_str(), userIdCtorSignature.c_str(), + dataResponse.userId, userId); + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject daysMask; + + std::string daysMaskClassName = "java/lang/Integer"; + std::string daysMaskCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(daysMaskClassName.c_str(), daysMaskCtorSignature.c_str(), + dataResponse.daysMask, daysMask); + jobject startHour; + + std::string startHourClassName = "java/lang/Integer"; + std::string startHourCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(startHourClassName.c_str(), startHourCtorSignature.c_str(), + dataResponse.startHour, startHour); + jobject startMinute; + + std::string startMinuteClassName = "java/lang/Integer"; + std::string startMinuteCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(startMinuteClassName.c_str(), startMinuteCtorSignature.c_str(), + dataResponse.startMinute, startMinute); + jobject endHour; + + std::string endHourClassName = "java/lang/Integer"; + std::string endHourCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(endHourClassName.c_str(), endHourCtorSignature.c_str(), + dataResponse.endHour, endHour); + jobject endMinute; + + std::string endMinuteClassName = "java/lang/Integer"; + std::string endMinuteCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(endMinuteClassName.c_str(), endMinuteCtorSignature.c_str(), + dataResponse.endMinute, endMinute); + + env->CallVoidMethod(javaCallbackRef, javaMethod, scheduleId, userId, status, daysMask, startHour, startMinute, endHour, + endMinute); +} +CHIPDoorLockClusterGetYeardayScheduleResponseCallback::CHIPDoorLockClusterGetYeardayScheduleResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetYeardayScheduleResponseCallback::~CHIPDoorLockClusterGetYeardayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetYeardayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetYeardayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject scheduleId; + + std::string scheduleIdClassName = "java/lang/Integer"; + std::string scheduleIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(scheduleIdClassName.c_str(), scheduleIdCtorSignature.c_str(), + dataResponse.scheduleId, scheduleId); + jobject userId; + + std::string userIdClassName = "java/lang/Integer"; + std::string userIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userIdClassName.c_str(), userIdCtorSignature.c_str(), + dataResponse.userId, userId); + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject localStartTime; + + std::string localStartTimeClassName = "java/lang/Long"; + std::string localStartTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + localStartTimeClassName.c_str(), localStartTimeCtorSignature.c_str(), dataResponse.localStartTime, localStartTime); + jobject localEndTime; + + std::string localEndTimeClassName = "java/lang/Long"; + std::string localEndTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(localEndTimeClassName.c_str(), localEndTimeCtorSignature.c_str(), + dataResponse.localEndTime, localEndTime); + + env->CallVoidMethod(javaCallbackRef, javaMethod, scheduleId, userId, status, localStartTime, localEndTime); +} +CHIPDoorLockClusterLockDoorResponseCallback::CHIPDoorLockClusterLockDoorResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterLockDoorResponseCallback::~CHIPDoorLockClusterLockDoorResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterLockDoorResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::LockDoorResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterSetHolidayScheduleResponseCallback::CHIPDoorLockClusterSetHolidayScheduleResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetHolidayScheduleResponseCallback::~CHIPDoorLockClusterSetHolidayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetHolidayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetHolidayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterSetPinResponseCallback::CHIPDoorLockClusterSetPinResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetPinResponseCallback::~CHIPDoorLockClusterSetPinResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetPinResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetPinResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterSetRfidResponseCallback::CHIPDoorLockClusterSetRfidResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetRfidResponseCallback::~CHIPDoorLockClusterSetRfidResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetRfidResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetRfidResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterSetUserTypeResponseCallback::CHIPDoorLockClusterSetUserTypeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetUserTypeResponseCallback::~CHIPDoorLockClusterSetUserTypeResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetUserTypeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetUserTypeResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterSetWeekdayScheduleResponseCallback::CHIPDoorLockClusterSetWeekdayScheduleResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetWeekdayScheduleResponseCallback::~CHIPDoorLockClusterSetWeekdayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetWeekdayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetWeekdayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterSetYeardayScheduleResponseCallback::CHIPDoorLockClusterSetYeardayScheduleResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetYeardayScheduleResponseCallback::~CHIPDoorLockClusterSetYeardayScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetYeardayScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetYeardayScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterUnlockDoorResponseCallback::CHIPDoorLockClusterUnlockDoorResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterUnlockDoorResponseCallback::~CHIPDoorLockClusterUnlockDoorResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterUnlockDoorResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::UnlockDoorResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPDoorLockClusterUnlockWithTimeoutResponseCallback::CHIPDoorLockClusterUnlockWithTimeoutResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterUnlockWithTimeoutResponseCallback::~CHIPDoorLockClusterUnlockWithTimeoutResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterUnlockWithTimeoutResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::UnlockWithTimeoutResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CHIPGeneralCommissioningClusterArmFailSafeResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::~CHIPGeneralCommissioningClusterArmFailSafeResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: + CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: + ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: + CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: + ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPGroupsClusterAddGroupResponseCallback::CHIPGroupsClusterAddGroupResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupsClusterAddGroupResponseCallback::~CHIPGroupsClusterAddGroupResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGroupsClusterAddGroupResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); +} +CHIPGroupsClusterGetGroupMembershipResponseCallback::CHIPGroupsClusterGetGroupMembershipResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupsClusterGetGroupMembershipResponseCallback::~CHIPGroupsClusterGetGroupMembershipResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGroupsClusterGetGroupMembershipResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject capacity; + + std::string capacityClassName = "java/lang/Integer"; + std::string capacityCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(capacityClassName.c_str(), capacityCtorSignature.c_str(), + dataResponse.capacity, capacity); + jobject groupCount; + + std::string groupCountClassName = "java/lang/Integer"; + std::string groupCountCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupCountClassName.c_str(), groupCountCtorSignature.c_str(), + dataResponse.groupCount, groupCount); + jobject groupList; + + groupList = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, capacity, groupCount, groupList); +} +CHIPGroupsClusterRemoveGroupResponseCallback::CHIPGroupsClusterRemoveGroupResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupsClusterRemoveGroupResponseCallback::~CHIPGroupsClusterRemoveGroupResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGroupsClusterRemoveGroupResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); +} +CHIPGroupsClusterViewGroupResponseCallback::CHIPGroupsClusterViewGroupResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupsClusterViewGroupResponseCallback::~CHIPGroupsClusterViewGroupResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGroupsClusterViewGroupResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject groupName; + + groupName = chip::UtfString(env, dataResponse.groupName).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, groupName); +} +CHIPIdentifyClusterIdentifyQueryResponseCallback::CHIPIdentifyClusterIdentifyQueryResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIdentifyClusterIdentifyQueryResponseCallback::~CHIPIdentifyClusterIdentifyQueryResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPIdentifyClusterIdentifyQueryResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject timeout; + + std::string timeoutClassName = "java/lang/Integer"; + std::string timeoutCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(timeoutClassName.c_str(), timeoutCtorSignature.c_str(), + dataResponse.timeout, timeout); + + env->CallVoidMethod(javaCallbackRef, javaMethod, timeout); +} +CHIPKeypadInputClusterSendKeyResponseCallback::CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPKeypadInputClusterSendKeyResponseCallback::~CHIPKeypadInputClusterSendKeyResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPKeypadInputClusterSendKeyResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status); +} +CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::CHIPMediaPlaybackClusterMediaFastForwardResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::~CHIPMediaPlaybackClusterMediaFastForwardResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaNextResponseCallback::CHIPMediaPlaybackClusterMediaNextResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaNextResponseCallback::~CHIPMediaPlaybackClusterMediaNextResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaNextResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaPauseResponseCallback::CHIPMediaPlaybackClusterMediaPauseResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaPauseResponseCallback::~CHIPMediaPlaybackClusterMediaPauseResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaPauseResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaPlayResponseCallback::CHIPMediaPlaybackClusterMediaPlayResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaPlayResponseCallback::~CHIPMediaPlaybackClusterMediaPlayResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaPlayResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaPreviousResponseCallback::CHIPMediaPlaybackClusterMediaPreviousResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaPreviousResponseCallback::~CHIPMediaPlaybackClusterMediaPreviousResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaPreviousResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaRewindResponseCallback::CHIPMediaPlaybackClusterMediaRewindResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaRewindResponseCallback::~CHIPMediaPlaybackClusterMediaRewindResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaRewindResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaSeekResponseCallback::CHIPMediaPlaybackClusterMediaSeekResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaSeekResponseCallback::~CHIPMediaPlaybackClusterMediaSeekResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaSeekResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CHIPMediaPlaybackClusterMediaStartOverResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaStartOverResponseCallback::~CHIPMediaPlaybackClusterMediaStartOverResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPMediaPlaybackClusterMediaStopResponseCallback::CHIPMediaPlaybackClusterMediaStopResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackClusterMediaStopResponseCallback::~CHIPMediaPlaybackClusterMediaStopResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPMediaPlaybackClusterMediaStopResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject mediaPlaybackStatus; + + std::string mediaPlaybackStatusClassName = "java/lang/Integer"; + std::string mediaPlaybackStatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(mediaPlaybackStatusClassName.c_str(), + mediaPlaybackStatusCtorSignature.c_str(), + dataResponse.mediaPlaybackStatus, mediaPlaybackStatus); + + env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); +} +CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback::CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback::~CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::AddThreadNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback::CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback::~CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::NetworkCommissioning::Commands::AddWiFiNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPNetworkCommissioningClusterDisableNetworkResponseCallback::CHIPNetworkCommissioningClusterDisableNetworkResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterDisableNetworkResponseCallback::~CHIPNetworkCommissioningClusterDisableNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterDisableNetworkResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::NetworkCommissioning::Commands::DisableNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPNetworkCommissioningClusterEnableNetworkResponseCallback::CHIPNetworkCommissioningClusterEnableNetworkResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterEnableNetworkResponseCallback::~CHIPNetworkCommissioningClusterEnableNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterEnableNetworkResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::NetworkCommissioning::Commands::EnableNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback::CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback::~CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CHIPNetworkCommissioningClusterScanNetworksResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterScanNetworksResponseCallback::~CHIPNetworkCommissioningClusterScanNetworksResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + jobject wifiScanResults; + + wifiScanResults = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + jobject threadScanResults; + + threadScanResults = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText, wifiScanResults, threadScanResults); +} +CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback:: + CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback:: + ~CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::UpdateThreadNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback::CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback:: + ~CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::UpdateWiFiNetworkResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), + dataResponse.errorCode, errorCode); + jobject debugText; + + debugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); +} +CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback::CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback::~CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject action; + + std::string actionClassName = "java/lang/Integer"; + std::string actionCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(actionClassName.c_str(), actionCtorSignature.c_str(), + dataResponse.action, action); + jobject delayedActionTime; + + std::string delayedActionTimeClassName = "java/lang/Long"; + std::string delayedActionTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(delayedActionTimeClassName.c_str(), + delayedActionTimeCtorSignature.c_str(), + dataResponse.delayedActionTime, delayedActionTime); + + env->CallVoidMethod(javaCallbackRef, javaMethod, action, delayedActionTime); +} +CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback::CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback::~CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject delayedActionTime; + if (!dataResponse.delayedActionTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, delayedActionTime); + } + else + { + + std::string delayedActionTimeClassName = "java/lang/Long"; + std::string delayedActionTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(delayedActionTimeClassName.c_str(), + delayedActionTimeCtorSignature.c_str(), + dataResponse.delayedActionTime.Value(), delayedActionTime); + chip::JniReferences::GetInstance().CreateOptional(delayedActionTime, delayedActionTime); + } + jobject imageURI; + if (!dataResponse.imageURI.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, imageURI); + } + else + { + + imageURI = chip::UtfString(env, dataResponse.imageURI.Value()).jniValue(); + chip::JniReferences::GetInstance().CreateOptional(imageURI, imageURI); + } + jobject softwareVersion; + if (!dataResponse.softwareVersion.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, softwareVersion); + } + else + { + + std::string softwareVersionClassName = "java/lang/Long"; + std::string softwareVersionCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(softwareVersionClassName.c_str(), + softwareVersionCtorSignature.c_str(), + dataResponse.softwareVersion.Value(), softwareVersion); + chip::JniReferences::GetInstance().CreateOptional(softwareVersion, softwareVersion); + } + jobject softwareVersionString; + if (!dataResponse.softwareVersionString.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, softwareVersionString); + } + else + { + + softwareVersionString = chip::UtfString(env, dataResponse.softwareVersionString.Value()).jniValue(); + chip::JniReferences::GetInstance().CreateOptional(softwareVersionString, softwareVersionString); + } + jobject updateToken; + if (!dataResponse.updateToken.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, updateToken); + } + else + { + + updateToken = chip::ByteArray(env, dataResponse.updateToken.Value()).jniValue(); + chip::JniReferences::GetInstance().CreateOptional(updateToken, updateToken); + } + jobject userConsentNeeded; + if (!dataResponse.userConsentNeeded.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, userConsentNeeded); + } + else + { + + std::string userConsentNeededClassName = "java/lang/Boolean"; + std::string userConsentNeededCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(userConsentNeededClassName.c_str(), + userConsentNeededCtorSignature.c_str(), + dataResponse.userConsentNeeded.Value(), userConsentNeeded); + chip::JniReferences::GetInstance().CreateOptional(userConsentNeeded, userConsentNeeded); + } + jobject metadataForRequestor; + if (!dataResponse.metadataForRequestor.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, metadataForRequestor); + } + else + { + + metadataForRequestor = chip::ByteArray(env, dataResponse.metadataForRequestor.Value()).jniValue(); + chip::JniReferences::GetInstance().CreateOptional(metadataForRequestor, metadataForRequestor); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, delayedActionTime, imageURI, softwareVersion, softwareVersionString, + updateToken, userConsentNeeded, metadataForRequestor); +} +CHIPOperationalCredentialsClusterAttestationResponseCallback::CHIPOperationalCredentialsClusterAttestationResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsClusterAttestationResponseCallback::~CHIPOperationalCredentialsClusterAttestationResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOperationalCredentialsClusterAttestationResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B[B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject AttestationElements; + + AttestationElements = chip::ByteArray(env, dataResponse.attestationElements).jniValue(); + jobject Signature; + + Signature = chip::ByteArray(env, dataResponse.signature).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, AttestationElements, Signature); +} +CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: + CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: + ~CHIPOperationalCredentialsClusterCertificateChainResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOperationalCredentialsClusterCertificateChainResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject Certificate; + + Certificate = chip::ByteArray(env, dataResponse.certificate).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, Certificate); +} +CHIPOperationalCredentialsClusterNOCResponseCallback::CHIPOperationalCredentialsClusterNOCResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsClusterNOCResponseCallback::~CHIPOperationalCredentialsClusterNOCResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOperationalCredentialsClusterNOCResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject StatusCode; + + std::string StatusCodeClassName = "java/lang/Integer"; + std::string StatusCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusCodeClassName.c_str(), StatusCodeCtorSignature.c_str(), + dataResponse.statusCode, StatusCode); + jobject FabricIndex; + + std::string FabricIndexClassName = "java/lang/Integer"; + std::string FabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(FabricIndexClassName.c_str(), FabricIndexCtorSignature.c_str(), + dataResponse.fabricIndex, FabricIndex); + jobject DebugText; + + DebugText = chip::UtfString(env, dataResponse.debugText).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, StatusCode, FabricIndex, DebugText); +} +CHIPOperationalCredentialsClusterOpCSRResponseCallback::CHIPOperationalCredentialsClusterOpCSRResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsClusterOpCSRResponseCallback::~CHIPOperationalCredentialsClusterOpCSRResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPOperationalCredentialsClusterOpCSRResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::OperationalCredentials::Commands::OpCSRResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B[B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject NOCSRElements; + + NOCSRElements = chip::ByteArray(env, dataResponse.NOCSRElements).jniValue(); + jobject AttestationSignature; + + AttestationSignature = chip::ByteArray(env, dataResponse.attestationSignature).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, NOCSRElements, AttestationSignature); +} +CHIPScenesClusterAddSceneResponseCallback::CHIPScenesClusterAddSceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterAddSceneResponseCallback::~CHIPScenesClusterAddSceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterAddSceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject sceneId; + + std::string sceneIdClassName = "java/lang/Integer"; + std::string sceneIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(sceneIdClassName.c_str(), sceneIdCtorSignature.c_str(), + dataResponse.sceneId, sceneId); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, sceneId); +} +CHIPScenesClusterGetSceneMembershipResponseCallback::CHIPScenesClusterGetSceneMembershipResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterGetSceneMembershipResponseCallback::~CHIPScenesClusterGetSceneMembershipResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterGetSceneMembershipResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject capacity; + + std::string capacityClassName = "java/lang/Integer"; + std::string capacityCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(capacityClassName.c_str(), capacityCtorSignature.c_str(), + dataResponse.capacity, capacity); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject sceneCount; + + std::string sceneCountClassName = "java/lang/Integer"; + std::string sceneCountCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(sceneCountClassName.c_str(), sceneCountCtorSignature.c_str(), + dataResponse.sceneCount, sceneCount); + jobject sceneList; + + sceneList = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, capacity, groupId, sceneCount, sceneList); +} +CHIPScenesClusterRemoveAllScenesResponseCallback::CHIPScenesClusterRemoveAllScenesResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterRemoveAllScenesResponseCallback::~CHIPScenesClusterRemoveAllScenesResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterRemoveAllScenesResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); +} +CHIPScenesClusterRemoveSceneResponseCallback::CHIPScenesClusterRemoveSceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterRemoveSceneResponseCallback::~CHIPScenesClusterRemoveSceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterRemoveSceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject sceneId; + + std::string sceneIdClassName = "java/lang/Integer"; + std::string sceneIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(sceneIdClassName.c_str(), sceneIdCtorSignature.c_str(), + dataResponse.sceneId, sceneId); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, sceneId); +} +CHIPScenesClusterStoreSceneResponseCallback::CHIPScenesClusterStoreSceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterStoreSceneResponseCallback::~CHIPScenesClusterStoreSceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterStoreSceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject sceneId; + + std::string sceneIdClassName = "java/lang/Integer"; + std::string sceneIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(sceneIdClassName.c_str(), sceneIdCtorSignature.c_str(), + dataResponse.sceneId, sceneId); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, sceneId); +} +CHIPScenesClusterViewSceneResponseCallback::CHIPScenesClusterViewSceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterViewSceneResponseCallback::~CHIPScenesClusterViewSceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterViewSceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject sceneId; + + std::string sceneIdClassName = "java/lang/Integer"; + std::string sceneIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(sceneIdClassName.c_str(), sceneIdCtorSignature.c_str(), + dataResponse.sceneId, sceneId); + jobject transitionTime; + + std::string transitionTimeClassName = "java/lang/Integer"; + std::string transitionTimeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + transitionTimeClassName.c_str(), transitionTimeCtorSignature.c_str(), dataResponse.transitionTime, transitionTime); + jobject sceneName; + + sceneName = chip::UtfString(env, dataResponse.sceneName).jniValue(); + jobject extensionFieldSets; + + extensionFieldSets = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, sceneId, transitionTime, sceneName, extensionFieldSets); +} +CHIPTvChannelClusterChangeChannelResponseCallback::CHIPTvChannelClusterChangeChannelResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTvChannelClusterChangeChannelResponseCallback::~CHIPTvChannelClusterChangeChannelResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTvChannelClusterChangeChannelResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject ChannelMatch; + + ChannelMatch = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + jobject ErrorType; + + std::string ErrorTypeClassName = "java/lang/Integer"; + std::string ErrorTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ErrorTypeClassName.c_str(), ErrorTypeCtorSignature.c_str(), + dataResponse.errorType, ErrorType); + + env->CallVoidMethod(javaCallbackRef, javaMethod, ChannelMatch, ErrorType); +} +CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CHIPTargetNavigatorClusterNavigateTargetResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTargetNavigatorClusterNavigateTargetResponseCallback::~CHIPTargetNavigatorClusterNavigateTargetResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject data; + + data = chip::UtfString(env, dataResponse.data).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, status, data); +} +CHIPTestClusterClusterBooleanResponseCallback::CHIPTestClusterClusterBooleanResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTestClusterClusterBooleanResponseCallback::~CHIPTestClusterClusterBooleanResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTestClusterClusterBooleanResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TestCluster::Commands::BooleanResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Boolean;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject value; + + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + dataResponse.value, value); + + env->CallVoidMethod(javaCallbackRef, javaMethod, value); +} +CHIPTestClusterClusterTestAddArgumentsResponseCallback::CHIPTestClusterClusterTestAddArgumentsResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTestClusterClusterTestAddArgumentsResponseCallback::~CHIPTestClusterClusterTestAddArgumentsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTestClusterClusterTestAddArgumentsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TestCluster::Commands::TestAddArgumentsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject returnValue; + + std::string returnValueClassName = "java/lang/Integer"; + std::string returnValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), + dataResponse.returnValue, returnValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); +} +CHIPTestClusterClusterTestEnumsResponseCallback::CHIPTestClusterClusterTestEnumsResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTestClusterClusterTestEnumsResponseCallback::~CHIPTestClusterClusterTestEnumsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTestClusterClusterTestEnumsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TestCluster::Commands::TestEnumsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject arg1; + + std::string arg1ClassName = "java/lang/Integer"; + std::string arg1CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(arg1ClassName.c_str(), arg1CtorSignature.c_str(), + dataResponse.arg1, arg1); + jobject arg2; + + std::string arg2ClassName = "java/lang/Integer"; + std::string arg2CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(arg2ClassName.c_str(), arg2CtorSignature.c_str(), + dataResponse.arg2, arg2); + + env->CallVoidMethod(javaCallbackRef, javaMethod, arg1, arg2); +} +CHIPTestClusterClusterTestListInt8UReverseResponseCallback::CHIPTestClusterClusterTestListInt8UReverseResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTestClusterClusterTestListInt8UReverseResponseCallback::~CHIPTestClusterClusterTestListInt8UReverseResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTestClusterClusterTestListInt8UReverseResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "()V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject arg1; + + arg1 = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, arg1); +} +CHIPTestClusterClusterTestNullableOptionalResponseCallback::CHIPTestClusterClusterTestNullableOptionalResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTestClusterClusterTestNullableOptionalResponseCallback::~CHIPTestClusterClusterTestNullableOptionalResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTestClusterClusterTestNullableOptionalResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", "(Ljava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject wasPresent; + + std::string wasPresentClassName = "java/lang/Boolean"; + std::string wasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(wasPresentClassName.c_str(), wasPresentCtorSignature.c_str(), + dataResponse.wasPresent, wasPresent); + jobject wasNull; + if (!dataResponse.wasNull.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, wasNull); + } + else + { + + std::string wasNullClassName = "java/lang/Boolean"; + std::string wasNullCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(wasNullClassName.c_str(), wasNullCtorSignature.c_str(), + dataResponse.wasNull.Value(), wasNull); + chip::JniReferences::GetInstance().CreateOptional(wasNull, wasNull); + } + jobject value; + if (!dataResponse.value.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value); + } + else + { + + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + dataResponse.value.Value(), value); + chip::JniReferences::GetInstance().CreateOptional(value, value); + } + jobject originalValue; + if (!dataResponse.originalValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, originalValue); + } + else + { + if (dataResponse.originalValue.Value().IsNull()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, originalValue); + } + else + { + + std::string originalValueClassName = "java/lang/Integer"; + std::string originalValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + originalValueClassName.c_str(), originalValueCtorSignature.c_str(), dataResponse.originalValue.Value().Value(), + originalValue); + chip::JniReferences::GetInstance().CreateOptional(originalValue, originalValue); + } + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, wasPresent, wasNull, value, originalValue); +} +CHIPTestClusterClusterTestSpecificResponseCallback::CHIPTestClusterClusterTestSpecificResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTestClusterClusterTestSpecificResponseCallback::~CHIPTestClusterClusterTestSpecificResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTestClusterClusterTestSpecificResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TestCluster::Commands::TestSpecificResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject returnValue; + + std::string returnValueClassName = "java/lang/Integer"; + std::string returnValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), + dataResponse.returnValue, returnValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); +} +} // namespace chip diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h new file mode 100644 index 00000000000000..ed66dbd7eee44e --- /dev/null +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -0,0 +1,1139 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP +#include "CHIPCallbackTypes.h" + +#include +#include +#include + +namespace chip { + +class CHIPAccountLoginClusterGetSetupPINResponseCallback + : public Callback::Callback +{ +public: + CHIPAccountLoginClusterGetSetupPINResponseCallback(jobject javaCallback); + + ~CHIPAccountLoginClusterGetSetupPINResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPApplicationLauncherClusterLaunchAppResponseCallback + : public Callback::Callback +{ +public: + CHIPApplicationLauncherClusterLaunchAppResponseCallback(jobject javaCallback); + + ~CHIPApplicationLauncherClusterLaunchAppResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPContentLauncherClusterLaunchContentResponseCallback + : public Callback::Callback +{ +public: + CHIPContentLauncherClusterLaunchContentResponseCallback(jobject javaCallback); + + ~CHIPContentLauncherClusterLaunchContentResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPContentLauncherClusterLaunchURLResponseCallback + : public Callback::Callback +{ +public: + CHIPContentLauncherClusterLaunchURLResponseCallback(jobject javaCallback); + + ~CHIPContentLauncherClusterLaunchURLResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback + : public Callback::Callback +{ +public: + CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback(jobject javaCallback); + + ~CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearAllPinsResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearAllPinsResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearAllPinsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::ClearAllPinsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearAllRfidsResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearAllRfidsResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearAllRfidsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::ClearAllRfidsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearHolidayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearHolidayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearHolidayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::ClearHolidayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearPinResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearPinResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearPinResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::ClearPinResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearRfidResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearRfidResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearRfidResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::ClearRfidResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearWeekdayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearWeekdayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearWeekdayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::ClearWeekdayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterClearYeardayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterClearYeardayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterClearYeardayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::ClearYeardayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetHolidayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetHolidayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetHolidayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetLogRecordResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetLogRecordResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetLogRecordResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::GetLogRecordResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetPinResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetPinResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetPinResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetPinResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetRfidResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetRfidResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetRfidResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::GetRfidResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetUserTypeResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetUserTypeResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetUserTypeResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::GetUserTypeResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetWeekdayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetWeekdayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetWeekdayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::GetWeekdayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterGetYeardayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterGetYeardayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterGetYeardayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::GetYeardayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterLockDoorResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterLockDoorResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterLockDoorResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::LockDoorResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterSetHolidayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterSetHolidayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterSetHolidayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::SetHolidayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterSetPinResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterSetPinResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterSetPinResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::SetPinResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterSetRfidResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterSetRfidResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterSetRfidResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::SetRfidResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterSetUserTypeResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterSetUserTypeResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterSetUserTypeResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::SetUserTypeResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterSetWeekdayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterSetWeekdayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterSetWeekdayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::SetWeekdayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterSetYeardayScheduleResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterSetYeardayScheduleResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterSetYeardayScheduleResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::SetYeardayScheduleResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterUnlockDoorResponseCallback : public Callback::Callback +{ +public: + CHIPDoorLockClusterUnlockDoorResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterUnlockDoorResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::DoorLock::Commands::UnlockDoorResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPDoorLockClusterUnlockWithTimeoutResponseCallback + : public Callback::Callback +{ +public: + CHIPDoorLockClusterUnlockWithTimeoutResponseCallback(jobject javaCallback); + + ~CHIPDoorLockClusterUnlockWithTimeoutResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::DoorLock::Commands::UnlockWithTimeoutResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGeneralCommissioningClusterArmFailSafeResponseCallback + : public Callback::Callback +{ +public: + CHIPGeneralCommissioningClusterArmFailSafeResponseCallback(jobject javaCallback); + + ~CHIPGeneralCommissioningClusterArmFailSafeResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback + : public Callback::Callback +{ +public: + CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback); + + ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback + : public Callback::Callback +{ +public: + CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback); + + ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGroupsClusterAddGroupResponseCallback : public Callback::Callback +{ +public: + CHIPGroupsClusterAddGroupResponseCallback(jobject javaCallback); + + ~CHIPGroupsClusterAddGroupResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGroupsClusterGetGroupMembershipResponseCallback + : public Callback::Callback +{ +public: + CHIPGroupsClusterGetGroupMembershipResponseCallback(jobject javaCallback); + + ~CHIPGroupsClusterGetGroupMembershipResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGroupsClusterRemoveGroupResponseCallback : public Callback::Callback +{ +public: + CHIPGroupsClusterRemoveGroupResponseCallback(jobject javaCallback); + + ~CHIPGroupsClusterRemoveGroupResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGroupsClusterViewGroupResponseCallback : public Callback::Callback +{ +public: + CHIPGroupsClusterViewGroupResponseCallback(jobject javaCallback); + + ~CHIPGroupsClusterViewGroupResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPIdentifyClusterIdentifyQueryResponseCallback + : public Callback::Callback +{ +public: + CHIPIdentifyClusterIdentifyQueryResponseCallback(jobject javaCallback); + + ~CHIPIdentifyClusterIdentifyQueryResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPKeypadInputClusterSendKeyResponseCallback : public Callback::Callback +{ +public: + CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback); + + ~CHIPKeypadInputClusterSendKeyResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaFastForwardResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaFastForwardResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaFastForwardResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaNextResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaNextResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaNextResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaPauseResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaPauseResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaPauseResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaPlayResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaPlayResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaPlayResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaPreviousResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaPreviousResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaPreviousResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaRewindResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaRewindResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaRewindResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaSeekResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaSeekResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaSeekResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaStartOverResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaStartOverResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaStartOverResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPMediaPlaybackClusterMediaStopResponseCallback + : public Callback::Callback +{ +public: + CHIPMediaPlaybackClusterMediaStopResponseCallback(jobject javaCallback); + + ~CHIPMediaPlaybackClusterMediaStopResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::AddThreadNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::AddWiFiNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterDisableNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterDisableNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterDisableNetworkResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::DisableNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterEnableNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterEnableNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterEnableNetworkResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::EnableNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterRemoveNetworkResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterScanNetworksResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterScanNetworksResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterScanNetworksResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::UpdateThreadNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback + : public Callback::Callback +{ +public: + CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(jobject javaCallback); + + ~CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::NetworkCommissioning::Commands::UpdateWiFiNetworkResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback + : public Callback::Callback +{ +public: + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(jobject javaCallback); + + ~CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback + : public Callback::Callback +{ +public: + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(jobject javaCallback); + + ~CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPOperationalCredentialsClusterAttestationResponseCallback + : public Callback::Callback +{ +public: + CHIPOperationalCredentialsClusterAttestationResponseCallback(jobject javaCallback); + + ~CHIPOperationalCredentialsClusterAttestationResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPOperationalCredentialsClusterCertificateChainResponseCallback + : public Callback::Callback +{ +public: + CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback); + + ~CHIPOperationalCredentialsClusterCertificateChainResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPOperationalCredentialsClusterNOCResponseCallback + : public Callback::Callback +{ +public: + CHIPOperationalCredentialsClusterNOCResponseCallback(jobject javaCallback); + + ~CHIPOperationalCredentialsClusterNOCResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPOperationalCredentialsClusterOpCSRResponseCallback + : public Callback::Callback +{ +public: + CHIPOperationalCredentialsClusterOpCSRResponseCallback(jobject javaCallback); + + ~CHIPOperationalCredentialsClusterOpCSRResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::OperationalCredentials::Commands::OpCSRResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterAddSceneResponseCallback : public Callback::Callback +{ +public: + CHIPScenesClusterAddSceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterAddSceneResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterGetSceneMembershipResponseCallback + : public Callback::Callback +{ +public: + CHIPScenesClusterGetSceneMembershipResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterGetSceneMembershipResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterRemoveAllScenesResponseCallback + : public Callback::Callback +{ +public: + CHIPScenesClusterRemoveAllScenesResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterRemoveAllScenesResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterRemoveSceneResponseCallback : public Callback::Callback +{ +public: + CHIPScenesClusterRemoveSceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterRemoveSceneResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterStoreSceneResponseCallback : public Callback::Callback +{ +public: + CHIPScenesClusterStoreSceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterStoreSceneResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterViewSceneResponseCallback : public Callback::Callback +{ +public: + CHIPScenesClusterViewSceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterViewSceneResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTvChannelClusterChangeChannelResponseCallback + : public Callback::Callback +{ +public: + CHIPTvChannelClusterChangeChannelResponseCallback(jobject javaCallback); + + ~CHIPTvChannelClusterChangeChannelResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTargetNavigatorClusterNavigateTargetResponseCallback + : public Callback::Callback +{ +public: + CHIPTargetNavigatorClusterNavigateTargetResponseCallback(jobject javaCallback); + + ~CHIPTargetNavigatorClusterNavigateTargetResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTestClusterClusterBooleanResponseCallback : public Callback::Callback +{ +public: + CHIPTestClusterClusterBooleanResponseCallback(jobject javaCallback); + + ~CHIPTestClusterClusterBooleanResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::TestCluster::Commands::BooleanResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTestClusterClusterTestAddArgumentsResponseCallback + : public Callback::Callback +{ +public: + CHIPTestClusterClusterTestAddArgumentsResponseCallback(jobject javaCallback); + + ~CHIPTestClusterClusterTestAddArgumentsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TestCluster::Commands::TestAddArgumentsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTestClusterClusterTestEnumsResponseCallback + : public Callback::Callback +{ +public: + CHIPTestClusterClusterTestEnumsResponseCallback(jobject javaCallback); + + ~CHIPTestClusterClusterTestEnumsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TestCluster::Commands::TestEnumsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTestClusterClusterTestListInt8UReverseResponseCallback + : public Callback::Callback +{ +public: + CHIPTestClusterClusterTestListInt8UReverseResponseCallback(jobject javaCallback); + + ~CHIPTestClusterClusterTestListInt8UReverseResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTestClusterClusterTestNullableOptionalResponseCallback + : public Callback::Callback +{ +public: + CHIPTestClusterClusterTestNullableOptionalResponseCallback(jobject javaCallback); + + ~CHIPTestClusterClusterTestNullableOptionalResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPTestClusterClusterTestSpecificResponseCallback + : public Callback::Callback +{ +public: + CHIPTestClusterClusterTestSpecificResponseCallback(jobject javaCallback); + + ~CHIPTestClusterClusterTestSpecificResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TestCluster::Commands::TestSpecificResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +} // namespace chip diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 9ca0f757d61a91..ccb067acf8a720 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -143,18 +143,18 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public void openBasicCommissioningWindow( - DefaultClusterCallback callback, int commissioningTimeout) { + DefaultClusterCallback callback, Integer commissioningTimeout) { openBasicCommissioningWindow(chipClusterPtr, callback, commissioningTimeout); } public void openCommissioningWindow( DefaultClusterCallback callback, - int commissioningTimeout, + Integer commissioningTimeout, byte[] PAKEVerifier, - int discriminator, - long iterations, + Integer discriminator, + Long iterations, byte[] salt, - int passcodeID) { + Integer passcodeID) { openCommissioningWindow( chipClusterPtr, callback, @@ -171,17 +171,17 @@ public void revokeCommissioning(DefaultClusterCallback callback) { } private native void openBasicCommissioningWindow( - long chipClusterPtr, DefaultClusterCallback callback, int commissioningTimeout); + long chipClusterPtr, DefaultClusterCallback callback, Integer commissioningTimeout); private native void openCommissioningWindow( long chipClusterPtr, DefaultClusterCallback callback, - int commissioningTimeout, + Integer commissioningTimeout, byte[] PAKEVerifier, - int discriminator, - long iterations, + Integer discriminator, + Long iterations, byte[] salt, - int passcodeID); + Integer passcodeID); private native void revokeCommissioning(long chipClusterPtr, DefaultClusterCallback callback); @@ -205,12 +205,12 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeStatus(DefaultClusterCallback callback, int status) { + public void changeStatus(DefaultClusterCallback callback, Integer status) { changeStatus(chipClusterPtr, callback, status); } private native void changeStatus( - long chipClusterPtr, DefaultClusterCallback callback, int status); + long chipClusterPtr, DefaultClusterCallback callback, Integer status); public void readVendorNameAttribute(CharStringAttributeCallback callback) { readVendorNameAttribute(chipClusterPtr, callback); @@ -284,7 +284,7 @@ public static long clusterId() { public void launchApp( LaunchAppResponseCallback callback, String data, - int catalogVendorId, + Integer catalogVendorId, String applicationId) { launchApp(chipClusterPtr, callback, data, catalogVendorId, applicationId); } @@ -293,11 +293,11 @@ private native void launchApp( long chipClusterPtr, LaunchAppResponseCallback callback, String data, - int catalogVendorId, + Integer catalogVendorId, String applicationId); public interface LaunchAppResponseCallback { - void onSuccess(int status, String data); + void onSuccess(Integer status, String data); void onError(Exception error); } @@ -350,19 +350,19 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void renameOutput(DefaultClusterCallback callback, int index, String name) { + public void renameOutput(DefaultClusterCallback callback, Integer index, String name) { renameOutput(chipClusterPtr, callback, index, name); } - public void selectOutput(DefaultClusterCallback callback, int index) { + public void selectOutput(DefaultClusterCallback callback, Integer index) { selectOutput(chipClusterPtr, callback, index); } private native void renameOutput( - long chipClusterPtr, DefaultClusterCallback callback, int index, String name); + long chipClusterPtr, DefaultClusterCallback callback, Integer index, String name); private native void selectOutput( - long chipClusterPtr, DefaultClusterCallback callback, int index); + long chipClusterPtr, DefaultClusterCallback callback, Integer index); public static class AudioOutputListAttribute { public Integer index; @@ -434,7 +434,7 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void barrierControlGoToPercent(DefaultClusterCallback callback, int percentOpen) { + public void barrierControlGoToPercent(DefaultClusterCallback callback, Integer percentOpen) { barrierControlGoToPercent(chipClusterPtr, callback, percentOpen); } @@ -443,7 +443,7 @@ public void barrierControlStop(DefaultClusterCallback callback) { } private native void barrierControlGoToPercent( - long chipClusterPtr, DefaultClusterCallback callback, int percentOpen); + long chipClusterPtr, DefaultClusterCallback callback, Integer percentOpen); private native void barrierControlStop(long chipClusterPtr, DefaultClusterCallback callback); @@ -754,30 +754,38 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public void bind( - DefaultClusterCallback callback, long nodeId, int groupId, int endpointId, long clusterId) { + DefaultClusterCallback callback, + Long nodeId, + Integer groupId, + Integer endpointId, + Long clusterId) { bind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId); } public void unbind( - DefaultClusterCallback callback, long nodeId, int groupId, int endpointId, long clusterId) { + DefaultClusterCallback callback, + Long nodeId, + Integer groupId, + Integer endpointId, + Long clusterId) { unbind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId); } private native void bind( long chipClusterPtr, DefaultClusterCallback callback, - long nodeId, - int groupId, - int endpointId, - long clusterId); + Long nodeId, + Integer groupId, + Integer endpointId, + Long clusterId); private native void unbind( long chipClusterPtr, DefaultClusterCallback callback, - long nodeId, - int groupId, - int endpointId, - long clusterId); + Long nodeId, + Integer groupId, + Integer endpointId, + Long clusterId); public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); @@ -841,114 +849,145 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void disableAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void disableAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { disableAction(chipClusterPtr, callback, actionID, invokeID); } public void disableActionWithDuration( - DefaultClusterCallback callback, int actionID, long invokeID, long duration) { + DefaultClusterCallback callback, Integer actionID, Optional invokeID, Long duration) { disableActionWithDuration(chipClusterPtr, callback, actionID, invokeID, duration); } - public void enableAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void enableAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { enableAction(chipClusterPtr, callback, actionID, invokeID); } public void enableActionWithDuration( - DefaultClusterCallback callback, int actionID, long invokeID, long duration) { + DefaultClusterCallback callback, Integer actionID, Optional invokeID, Long duration) { enableActionWithDuration(chipClusterPtr, callback, actionID, invokeID, duration); } - public void instantAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void instantAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { instantAction(chipClusterPtr, callback, actionID, invokeID); } public void instantActionWithTransition( - DefaultClusterCallback callback, int actionID, long invokeID, int transitionTime) { + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID, + Integer transitionTime) { instantActionWithTransition(chipClusterPtr, callback, actionID, invokeID, transitionTime); } - public void pauseAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void pauseAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { pauseAction(chipClusterPtr, callback, actionID, invokeID); } public void pauseActionWithDuration( - DefaultClusterCallback callback, int actionID, long invokeID, long duration) { + DefaultClusterCallback callback, Integer actionID, Optional invokeID, Long duration) { pauseActionWithDuration(chipClusterPtr, callback, actionID, invokeID, duration); } - public void resumeAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void resumeAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { resumeAction(chipClusterPtr, callback, actionID, invokeID); } - public void startAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void startAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { startAction(chipClusterPtr, callback, actionID, invokeID); } public void startActionWithDuration( - DefaultClusterCallback callback, int actionID, long invokeID, long duration) { + DefaultClusterCallback callback, Integer actionID, Optional invokeID, Long duration) { startActionWithDuration(chipClusterPtr, callback, actionID, invokeID, duration); } - public void stopAction(DefaultClusterCallback callback, int actionID, long invokeID) { + public void stopAction( + DefaultClusterCallback callback, Integer actionID, Optional invokeID) { stopAction(chipClusterPtr, callback, actionID, invokeID); } private native void disableAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); private native void disableActionWithDuration( long chipClusterPtr, DefaultClusterCallback callback, - int actionID, - long invokeID, - long duration); + Integer actionID, + Optional invokeID, + Long duration); private native void enableAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); private native void enableActionWithDuration( long chipClusterPtr, DefaultClusterCallback callback, - int actionID, - long invokeID, - long duration); + Integer actionID, + Optional invokeID, + Long duration); private native void instantAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); private native void instantActionWithTransition( long chipClusterPtr, DefaultClusterCallback callback, - int actionID, - long invokeID, - int transitionTime); + Integer actionID, + Optional invokeID, + Integer transitionTime); private native void pauseAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); private native void pauseActionWithDuration( long chipClusterPtr, DefaultClusterCallback callback, - int actionID, - long invokeID, - long duration); + Integer actionID, + Optional invokeID, + Long duration); private native void resumeAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); private native void startAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); private native void startActionWithDuration( long chipClusterPtr, DefaultClusterCallback callback, - int actionID, - long invokeID, - long duration); + Integer actionID, + Optional invokeID, + Long duration); private native void stopAction( - long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer actionID, + Optional invokeID); public static class ActionListAttribute { public Integer actionID; @@ -1221,13 +1260,13 @@ public static long clusterId() { public void colorLoopSet( DefaultClusterCallback callback, - int updateFlags, - int action, - int direction, - int time, - int startHue, - int optionsMask, - int optionsOverride) { + Integer updateFlags, + Integer action, + Integer direction, + Integer time, + Integer startHue, + Integer optionsMask, + Integer optionsOverride) { colorLoopSet( chipClusterPtr, callback, @@ -1242,20 +1281,20 @@ public void colorLoopSet( public void enhancedMoveHue( DefaultClusterCallback callback, - int moveMode, - int rate, - int optionsMask, - int optionsOverride) { + Integer moveMode, + Integer rate, + Integer optionsMask, + Integer optionsOverride) { enhancedMoveHue(chipClusterPtr, callback, moveMode, rate, optionsMask, optionsOverride); } public void enhancedMoveToHue( DefaultClusterCallback callback, - int enhancedHue, - int direction, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer enhancedHue, + Integer direction, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { enhancedMoveToHue( chipClusterPtr, callback, @@ -1268,11 +1307,11 @@ public void enhancedMoveToHue( public void enhancedMoveToHueAndSaturation( DefaultClusterCallback callback, - int enhancedHue, - int saturation, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer enhancedHue, + Integer saturation, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { enhancedMoveToHueAndSaturation( chipClusterPtr, callback, @@ -1285,11 +1324,11 @@ public void enhancedMoveToHueAndSaturation( public void enhancedStepHue( DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { enhancedStepHue( chipClusterPtr, callback, @@ -1302,21 +1341,21 @@ public void enhancedStepHue( public void moveColor( DefaultClusterCallback callback, - int rateX, - int rateY, - int optionsMask, - int optionsOverride) { + Integer rateX, + Integer rateY, + Integer optionsMask, + Integer optionsOverride) { moveColor(chipClusterPtr, callback, rateX, rateY, optionsMask, optionsOverride); } public void moveColorTemperature( DefaultClusterCallback callback, - int moveMode, - int rate, - int colorTemperatureMinimum, - int colorTemperatureMaximum, - int optionsMask, - int optionsOverride) { + Integer moveMode, + Integer rate, + Integer colorTemperatureMinimum, + Integer colorTemperatureMaximum, + Integer optionsMask, + Integer optionsOverride) { moveColorTemperature( chipClusterPtr, callback, @@ -1330,95 +1369,95 @@ public void moveColorTemperature( public void moveHue( DefaultClusterCallback callback, - int moveMode, - int rate, - int optionsMask, - int optionsOverride) { + Integer moveMode, + Integer rate, + Integer optionsMask, + Integer optionsOverride) { moveHue(chipClusterPtr, callback, moveMode, rate, optionsMask, optionsOverride); } public void moveSaturation( DefaultClusterCallback callback, - int moveMode, - int rate, - int optionsMask, - int optionsOverride) { + Integer moveMode, + Integer rate, + Integer optionsMask, + Integer optionsOverride) { moveSaturation(chipClusterPtr, callback, moveMode, rate, optionsMask, optionsOverride); } public void moveToColor( DefaultClusterCallback callback, - int colorX, - int colorY, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer colorX, + Integer colorY, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { moveToColor( chipClusterPtr, callback, colorX, colorY, transitionTime, optionsMask, optionsOverride); } public void moveToColorTemperature( DefaultClusterCallback callback, - int colorTemperature, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer colorTemperature, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { moveToColorTemperature( chipClusterPtr, callback, colorTemperature, transitionTime, optionsMask, optionsOverride); } public void moveToHue( DefaultClusterCallback callback, - int hue, - int direction, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer hue, + Integer direction, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { moveToHue( chipClusterPtr, callback, hue, direction, transitionTime, optionsMask, optionsOverride); } public void moveToHueAndSaturation( DefaultClusterCallback callback, - int hue, - int saturation, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer hue, + Integer saturation, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { moveToHueAndSaturation( chipClusterPtr, callback, hue, saturation, transitionTime, optionsMask, optionsOverride); } public void moveToSaturation( DefaultClusterCallback callback, - int saturation, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer saturation, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { moveToSaturation( chipClusterPtr, callback, saturation, transitionTime, optionsMask, optionsOverride); } public void stepColor( DefaultClusterCallback callback, - int stepX, - int stepY, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer stepX, + Integer stepY, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { stepColor( chipClusterPtr, callback, stepX, stepY, transitionTime, optionsMask, optionsOverride); } public void stepColorTemperature( DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int colorTemperatureMinimum, - int colorTemperatureMaximum, - int optionsMask, - int optionsOverride) { + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer colorTemperatureMinimum, + Integer colorTemperatureMaximum, + Integer optionsMask, + Integer optionsOverride) { stepColorTemperature( chipClusterPtr, callback, @@ -1433,11 +1472,11 @@ public void stepColorTemperature( public void stepHue( DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { stepHue( chipClusterPtr, callback, @@ -1450,11 +1489,11 @@ public void stepHue( public void stepSaturation( DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionsMask, - int optionsOverride) { + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride) { stepSaturation( chipClusterPtr, callback, @@ -1466,173 +1505,176 @@ public void stepSaturation( } public void stopMoveStep( - DefaultClusterCallback callback, int optionsMask, int optionsOverride) { + DefaultClusterCallback callback, Integer optionsMask, Integer optionsOverride) { stopMoveStep(chipClusterPtr, callback, optionsMask, optionsOverride); } private native void colorLoopSet( long chipClusterPtr, DefaultClusterCallback callback, - int updateFlags, - int action, - int direction, - int time, - int startHue, - int optionsMask, - int optionsOverride); + Integer updateFlags, + Integer action, + Integer direction, + Integer time, + Integer startHue, + Integer optionsMask, + Integer optionsOverride); private native void enhancedMoveHue( long chipClusterPtr, DefaultClusterCallback callback, - int moveMode, - int rate, - int optionsMask, - int optionsOverride); + Integer moveMode, + Integer rate, + Integer optionsMask, + Integer optionsOverride); private native void enhancedMoveToHue( long chipClusterPtr, DefaultClusterCallback callback, - int enhancedHue, - int direction, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer enhancedHue, + Integer direction, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void enhancedMoveToHueAndSaturation( long chipClusterPtr, DefaultClusterCallback callback, - int enhancedHue, - int saturation, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer enhancedHue, + Integer saturation, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void enhancedStepHue( long chipClusterPtr, DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void moveColor( long chipClusterPtr, DefaultClusterCallback callback, - int rateX, - int rateY, - int optionsMask, - int optionsOverride); + Integer rateX, + Integer rateY, + Integer optionsMask, + Integer optionsOverride); private native void moveColorTemperature( long chipClusterPtr, DefaultClusterCallback callback, - int moveMode, - int rate, - int colorTemperatureMinimum, - int colorTemperatureMaximum, - int optionsMask, - int optionsOverride); + Integer moveMode, + Integer rate, + Integer colorTemperatureMinimum, + Integer colorTemperatureMaximum, + Integer optionsMask, + Integer optionsOverride); private native void moveHue( long chipClusterPtr, DefaultClusterCallback callback, - int moveMode, - int rate, - int optionsMask, - int optionsOverride); + Integer moveMode, + Integer rate, + Integer optionsMask, + Integer optionsOverride); private native void moveSaturation( long chipClusterPtr, DefaultClusterCallback callback, - int moveMode, - int rate, - int optionsMask, - int optionsOverride); + Integer moveMode, + Integer rate, + Integer optionsMask, + Integer optionsOverride); private native void moveToColor( long chipClusterPtr, DefaultClusterCallback callback, - int colorX, - int colorY, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer colorX, + Integer colorY, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void moveToColorTemperature( long chipClusterPtr, DefaultClusterCallback callback, - int colorTemperature, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer colorTemperature, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void moveToHue( long chipClusterPtr, DefaultClusterCallback callback, - int hue, - int direction, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer hue, + Integer direction, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void moveToHueAndSaturation( long chipClusterPtr, DefaultClusterCallback callback, - int hue, - int saturation, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer hue, + Integer saturation, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void moveToSaturation( long chipClusterPtr, DefaultClusterCallback callback, - int saturation, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer saturation, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void stepColor( long chipClusterPtr, DefaultClusterCallback callback, - int stepX, - int stepY, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer stepX, + Integer stepY, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void stepColorTemperature( long chipClusterPtr, DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int colorTemperatureMinimum, - int colorTemperatureMaximum, - int optionsMask, - int optionsOverride); + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer colorTemperatureMinimum, + Integer colorTemperatureMaximum, + Integer optionsMask, + Integer optionsOverride); private native void stepHue( long chipClusterPtr, DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void stepSaturation( long chipClusterPtr, DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionsMask, - int optionsOverride); + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionsMask, + Integer optionsOverride); private native void stopMoveStep( - long chipClusterPtr, DefaultClusterCallback callback, int optionsMask, int optionsOverride); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer optionsMask, + Integer optionsOverride); public void readCurrentHueAttribute(IntegerAttributeCallback callback) { readCurrentHueAttribute(chipClusterPtr, callback); @@ -2186,7 +2228,7 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public void launchContent( - LaunchContentResponseCallback callback, boolean autoPlay, String data) { + LaunchContentResponseCallback callback, Boolean autoPlay, String data) { launchContent(chipClusterPtr, callback, autoPlay, data); } @@ -2196,7 +2238,7 @@ public void launchURL( } private native void launchContent( - long chipClusterPtr, LaunchContentResponseCallback callback, boolean autoPlay, String data); + long chipClusterPtr, LaunchContentResponseCallback callback, Boolean autoPlay, String data); private native void launchURL( long chipClusterPtr, @@ -2205,13 +2247,13 @@ private native void launchURL( String displayString); public interface LaunchContentResponseCallback { - void onSuccess(String data, int contentLaunchStatus); + void onSuccess(String data, Integer contentLaunchStatus); void onError(Exception error); } public interface LaunchURLResponseCallback { - void onSuccess(String data, int contentLaunchStatus); + void onSuccess(String data, Integer contentLaunchStatus); void onError(Exception error); } @@ -2361,8 +2403,8 @@ public static long clusterId() { public void retrieveLogsRequest( RetrieveLogsResponseCallback callback, - int intent, - int requestedProtocol, + Integer intent, + Integer requestedProtocol, byte[] transferFileDesignator) { retrieveLogsRequest( chipClusterPtr, callback, intent, requestedProtocol, transferFileDesignator); @@ -2371,12 +2413,12 @@ public void retrieveLogsRequest( private native void retrieveLogsRequest( long chipClusterPtr, RetrieveLogsResponseCallback callback, - int intent, - int requestedProtocol, + Integer intent, + Integer requestedProtocol, byte[] transferFileDesignator); public interface RetrieveLogsResponseCallback { - void onSuccess(int status, byte[] content, long timeStamp, long timeSinceBoot); + void onSuccess(Integer status, byte[] content, Long timeStamp, Long timeSinceBoot); void onError(Exception error); } @@ -2403,55 +2445,56 @@ public void clearAllRfids(ClearAllRfidsResponseCallback callback) { } public void clearHolidaySchedule( - ClearHolidayScheduleResponseCallback callback, int scheduleId) { + ClearHolidayScheduleResponseCallback callback, Integer scheduleId) { clearHolidaySchedule(chipClusterPtr, callback, scheduleId); } - public void clearPin(ClearPinResponseCallback callback, int userId) { + public void clearPin(ClearPinResponseCallback callback, Integer userId) { clearPin(chipClusterPtr, callback, userId); } - public void clearRfid(ClearRfidResponseCallback callback, int userId) { + public void clearRfid(ClearRfidResponseCallback callback, Integer userId) { clearRfid(chipClusterPtr, callback, userId); } public void clearWeekdaySchedule( - ClearWeekdayScheduleResponseCallback callback, int scheduleId, int userId) { + ClearWeekdayScheduleResponseCallback callback, Integer scheduleId, Integer userId) { clearWeekdaySchedule(chipClusterPtr, callback, scheduleId, userId); } public void clearYeardaySchedule( - ClearYeardayScheduleResponseCallback callback, int scheduleId, int userId) { + ClearYeardayScheduleResponseCallback callback, Integer scheduleId, Integer userId) { clearYeardaySchedule(chipClusterPtr, callback, scheduleId, userId); } - public void getHolidaySchedule(GetHolidayScheduleResponseCallback callback, int scheduleId) { + public void getHolidaySchedule( + GetHolidayScheduleResponseCallback callback, Integer scheduleId) { getHolidaySchedule(chipClusterPtr, callback, scheduleId); } - public void getLogRecord(GetLogRecordResponseCallback callback, int logIndex) { + public void getLogRecord(GetLogRecordResponseCallback callback, Integer logIndex) { getLogRecord(chipClusterPtr, callback, logIndex); } - public void getPin(GetPinResponseCallback callback, int userId) { + public void getPin(GetPinResponseCallback callback, Integer userId) { getPin(chipClusterPtr, callback, userId); } - public void getRfid(GetRfidResponseCallback callback, int userId) { + public void getRfid(GetRfidResponseCallback callback, Integer userId) { getRfid(chipClusterPtr, callback, userId); } - public void getUserType(GetUserTypeResponseCallback callback, int userId) { + public void getUserType(GetUserTypeResponseCallback callback, Integer userId) { getUserType(chipClusterPtr, callback, userId); } public void getWeekdaySchedule( - GetWeekdayScheduleResponseCallback callback, int scheduleId, int userId) { + GetWeekdayScheduleResponseCallback callback, Integer scheduleId, Integer userId) { getWeekdaySchedule(chipClusterPtr, callback, scheduleId, userId); } public void getYeardaySchedule( - GetYeardayScheduleResponseCallback callback, int scheduleId, int userId) { + GetYeardayScheduleResponseCallback callback, Integer scheduleId, Integer userId) { getYeardaySchedule(chipClusterPtr, callback, scheduleId, userId); } @@ -2461,10 +2504,10 @@ public void lockDoor(LockDoorResponseCallback callback, byte[] pin) { public void setHolidaySchedule( SetHolidayScheduleResponseCallback callback, - int scheduleId, - long localStartTime, - long localEndTime, - int operatingModeDuringHoliday) { + Integer scheduleId, + Long localStartTime, + Long localEndTime, + Integer operatingModeDuringHoliday) { setHolidaySchedule( chipClusterPtr, callback, @@ -2475,28 +2518,37 @@ public void setHolidaySchedule( } public void setPin( - SetPinResponseCallback callback, int userId, int userStatus, int userType, byte[] pin) { + SetPinResponseCallback callback, + Integer userId, + Integer userStatus, + Integer userType, + byte[] pin) { setPin(chipClusterPtr, callback, userId, userStatus, userType, pin); } public void setRfid( - SetRfidResponseCallback callback, int userId, int userStatus, int userType, byte[] id) { + SetRfidResponseCallback callback, + Integer userId, + Integer userStatus, + Integer userType, + byte[] id) { setRfid(chipClusterPtr, callback, userId, userStatus, userType, id); } - public void setUserType(SetUserTypeResponseCallback callback, int userId, int userType) { + public void setUserType( + SetUserTypeResponseCallback callback, Integer userId, Integer userType) { setUserType(chipClusterPtr, callback, userId, userType); } public void setWeekdaySchedule( SetWeekdayScheduleResponseCallback callback, - int scheduleId, - int userId, - int daysMask, - int startHour, - int startMinute, - int endHour, - int endMinute) { + Integer scheduleId, + Integer userId, + Integer daysMask, + Integer startHour, + Integer startMinute, + Integer endHour, + Integer endMinute) { setWeekdaySchedule( chipClusterPtr, callback, @@ -2511,10 +2563,10 @@ public void setWeekdaySchedule( public void setYeardaySchedule( SetYeardayScheduleResponseCallback callback, - int scheduleId, - int userId, - long localStartTime, - long localEndTime) { + Integer scheduleId, + Integer userId, + Long localStartTime, + Long localEndTime) { setYeardaySchedule( chipClusterPtr, callback, scheduleId, userId, localStartTime, localEndTime); } @@ -2524,7 +2576,7 @@ public void unlockDoor(UnlockDoorResponseCallback callback, byte[] pin) { } public void unlockWithTimeout( - UnlockWithTimeoutResponseCallback callback, int timeoutInSeconds, byte[] pin) { + UnlockWithTimeoutResponseCallback callback, Integer timeoutInSeconds, byte[] pin) { unlockWithTimeout(chipClusterPtr, callback, timeoutInSeconds, pin); } @@ -2533,50 +2585,52 @@ public void unlockWithTimeout( private native void clearAllRfids(long chipClusterPtr, ClearAllRfidsResponseCallback callback); private native void clearHolidaySchedule( - long chipClusterPtr, ClearHolidayScheduleResponseCallback callback, int scheduleId); + long chipClusterPtr, ClearHolidayScheduleResponseCallback callback, Integer scheduleId); private native void clearPin( - long chipClusterPtr, ClearPinResponseCallback callback, int userId); + long chipClusterPtr, ClearPinResponseCallback callback, Integer userId); private native void clearRfid( - long chipClusterPtr, ClearRfidResponseCallback callback, int userId); + long chipClusterPtr, ClearRfidResponseCallback callback, Integer userId); private native void clearWeekdaySchedule( long chipClusterPtr, ClearWeekdayScheduleResponseCallback callback, - int scheduleId, - int userId); + Integer scheduleId, + Integer userId); private native void clearYeardaySchedule( long chipClusterPtr, ClearYeardayScheduleResponseCallback callback, - int scheduleId, - int userId); + Integer scheduleId, + Integer userId); private native void getHolidaySchedule( - long chipClusterPtr, GetHolidayScheduleResponseCallback callback, int scheduleId); + long chipClusterPtr, GetHolidayScheduleResponseCallback callback, Integer scheduleId); private native void getLogRecord( - long chipClusterPtr, GetLogRecordResponseCallback callback, int logIndex); + long chipClusterPtr, GetLogRecordResponseCallback callback, Integer logIndex); - private native void getPin(long chipClusterPtr, GetPinResponseCallback callback, int userId); + private native void getPin( + long chipClusterPtr, GetPinResponseCallback callback, Integer userId); - private native void getRfid(long chipClusterPtr, GetRfidResponseCallback callback, int userId); + private native void getRfid( + long chipClusterPtr, GetRfidResponseCallback callback, Integer userId); private native void getUserType( - long chipClusterPtr, GetUserTypeResponseCallback callback, int userId); + long chipClusterPtr, GetUserTypeResponseCallback callback, Integer userId); private native void getWeekdaySchedule( long chipClusterPtr, GetWeekdayScheduleResponseCallback callback, - int scheduleId, - int userId); + Integer scheduleId, + Integer userId); private native void getYeardaySchedule( long chipClusterPtr, GetYeardayScheduleResponseCallback callback, - int scheduleId, - int userId); + Integer scheduleId, + Integer userId); private native void lockDoor( long chipClusterPtr, LockDoorResponseCallback callback, byte[] pin); @@ -2584,48 +2638,51 @@ private native void lockDoor( private native void setHolidaySchedule( long chipClusterPtr, SetHolidayScheduleResponseCallback callback, - int scheduleId, - long localStartTime, - long localEndTime, - int operatingModeDuringHoliday); + Integer scheduleId, + Long localStartTime, + Long localEndTime, + Integer operatingModeDuringHoliday); private native void setPin( long chipClusterPtr, SetPinResponseCallback callback, - int userId, - int userStatus, - int userType, + Integer userId, + Integer userStatus, + Integer userType, byte[] pin); private native void setRfid( long chipClusterPtr, SetRfidResponseCallback callback, - int userId, - int userStatus, - int userType, + Integer userId, + Integer userStatus, + Integer userType, byte[] id); private native void setUserType( - long chipClusterPtr, SetUserTypeResponseCallback callback, int userId, int userType); + long chipClusterPtr, + SetUserTypeResponseCallback callback, + Integer userId, + Integer userType); private native void setWeekdaySchedule( long chipClusterPtr, SetWeekdayScheduleResponseCallback callback, - int scheduleId, - int userId, - int daysMask, - int startHour, - int startMinute, - int endHour, - int endMinute); + Integer scheduleId, + Integer userId, + Integer daysMask, + Integer startHour, + Integer startMinute, + Integer endHour, + Integer endMinute); private native void setYeardaySchedule( long chipClusterPtr, SetYeardayScheduleResponseCallback callback, - int scheduleId, - int userId, - long localStartTime, - long localEndTime); + Integer scheduleId, + Integer userId, + Long localStartTime, + Long localEndTime); private native void unlockDoor( long chipClusterPtr, UnlockDoorResponseCallback callback, byte[] pin); @@ -2633,164 +2690,168 @@ private native void unlockDoor( private native void unlockWithTimeout( long chipClusterPtr, UnlockWithTimeoutResponseCallback callback, - int timeoutInSeconds, + Integer timeoutInSeconds, byte[] pin); public interface ClearAllPinsResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface ClearAllRfidsResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface ClearHolidayScheduleResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface ClearPinResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface ClearRfidResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface ClearWeekdayScheduleResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface ClearYeardayScheduleResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface GetHolidayScheduleResponseCallback { void onSuccess( - int scheduleId, - int status, - long localStartTime, - long localEndTime, - int operatingModeDuringHoliday); + Integer scheduleId, + Integer status, + Long localStartTime, + Long localEndTime, + Integer operatingModeDuringHoliday); void onError(Exception error); } public interface GetLogRecordResponseCallback { void onSuccess( - int logEntryId, - long timestamp, - int eventType, - int source, - int eventIdOrAlarmCode, - int userId, + Integer logEntryId, + Long timestamp, + Integer eventType, + Integer source, + Integer eventIdOrAlarmCode, + Integer userId, byte[] pin); void onError(Exception error); } public interface GetPinResponseCallback { - void onSuccess(int userId, int userStatus, int userType, byte[] pin); + void onSuccess(Integer userId, Integer userStatus, Integer userType, byte[] pin); void onError(Exception error); } public interface GetRfidResponseCallback { - void onSuccess(int userId, int userStatus, int userType, byte[] rfid); + void onSuccess(Integer userId, Integer userStatus, Integer userType, byte[] rfid); void onError(Exception error); } public interface GetUserTypeResponseCallback { - void onSuccess(int userId, int userType); + void onSuccess(Integer userId, Integer userType); void onError(Exception error); } public interface GetWeekdayScheduleResponseCallback { void onSuccess( - int scheduleId, - int userId, - int status, - int daysMask, - int startHour, - int startMinute, - int endHour, - int endMinute); + Integer scheduleId, + Integer userId, + Integer status, + Integer daysMask, + Integer startHour, + Integer startMinute, + Integer endHour, + Integer endMinute); void onError(Exception error); } public interface GetYeardayScheduleResponseCallback { void onSuccess( - int scheduleId, int userId, int status, long localStartTime, long localEndTime); + Integer scheduleId, + Integer userId, + Integer status, + Long localStartTime, + Long localEndTime); void onError(Exception error); } public interface LockDoorResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface SetHolidayScheduleResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface SetPinResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface SetRfidResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface SetUserTypeResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface SetWeekdayScheduleResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface SetYeardayScheduleResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface UnlockDoorResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } public interface UnlockWithTimeoutResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } @@ -3144,9 +3205,9 @@ public static long clusterId() { public void armFailSafe( ArmFailSafeResponseCallback callback, - int expiryLengthSeconds, - long breadcrumb, - long timeoutMs) { + Integer expiryLengthSeconds, + Long breadcrumb, + Long timeoutMs) { armFailSafe(chipClusterPtr, callback, expiryLengthSeconds, breadcrumb, timeoutMs); } @@ -3156,19 +3217,19 @@ public void commissioningComplete(CommissioningCompleteResponseCallback callback public void setRegulatoryConfig( SetRegulatoryConfigResponseCallback callback, - int location, + Integer location, String countryCode, - long breadcrumb, - long timeoutMs) { + Long breadcrumb, + Long timeoutMs) { setRegulatoryConfig(chipClusterPtr, callback, location, countryCode, breadcrumb, timeoutMs); } private native void armFailSafe( long chipClusterPtr, ArmFailSafeResponseCallback callback, - int expiryLengthSeconds, - long breadcrumb, - long timeoutMs); + Integer expiryLengthSeconds, + Long breadcrumb, + Long timeoutMs); private native void commissioningComplete( long chipClusterPtr, CommissioningCompleteResponseCallback callback); @@ -3176,25 +3237,25 @@ private native void commissioningComplete( private native void setRegulatoryConfig( long chipClusterPtr, SetRegulatoryConfigResponseCallback callback, - int location, + Integer location, String countryCode, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); public interface ArmFailSafeResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface CommissioningCompleteResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface SetRegulatoryConfigResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } @@ -3540,17 +3601,17 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void addGroup(AddGroupResponseCallback callback, int groupId, String groupName) { + public void addGroup(AddGroupResponseCallback callback, Integer groupId, String groupName) { addGroup(chipClusterPtr, callback, groupId, groupName); } public void addGroupIfIdentifying( - DefaultClusterCallback callback, int groupId, String groupName) { + DefaultClusterCallback callback, Integer groupId, String groupName) { addGroupIfIdentifying(chipClusterPtr, callback, groupId, groupName); } public void getGroupMembership( - GetGroupMembershipResponseCallback callback, int groupCount, int groupList) { + GetGroupMembershipResponseCallback callback, Integer groupCount, Integer groupList) { getGroupMembership(chipClusterPtr, callback, groupCount, groupList); } @@ -3558,42 +3619,42 @@ public void removeAllGroups(DefaultClusterCallback callback) { removeAllGroups(chipClusterPtr, callback); } - public void removeGroup(RemoveGroupResponseCallback callback, int groupId) { + public void removeGroup(RemoveGroupResponseCallback callback, Integer groupId) { removeGroup(chipClusterPtr, callback, groupId); } - public void viewGroup(ViewGroupResponseCallback callback, int groupId) { + public void viewGroup(ViewGroupResponseCallback callback, Integer groupId) { viewGroup(chipClusterPtr, callback, groupId); } private native void addGroup( - long chipClusterPtr, AddGroupResponseCallback callback, int groupId, String groupName); + long chipClusterPtr, AddGroupResponseCallback callback, Integer groupId, String groupName); private native void addGroupIfIdentifying( - long chipClusterPtr, DefaultClusterCallback callback, int groupId, String groupName); + long chipClusterPtr, DefaultClusterCallback callback, Integer groupId, String groupName); private native void getGroupMembership( long chipClusterPtr, GetGroupMembershipResponseCallback callback, - int groupCount, - int groupList); + Integer groupCount, + Integer groupList); private native void removeAllGroups(long chipClusterPtr, DefaultClusterCallback callback); private native void removeGroup( - long chipClusterPtr, RemoveGroupResponseCallback callback, int groupId); + long chipClusterPtr, RemoveGroupResponseCallback callback, Integer groupId); private native void viewGroup( - long chipClusterPtr, ViewGroupResponseCallback callback, int groupId); + long chipClusterPtr, ViewGroupResponseCallback callback, Integer groupId); public interface AddGroupResponseCallback { - void onSuccess(int status, int groupId); + void onSuccess(Integer status, Integer groupId); void onError(Exception error); } public interface GetGroupMembershipResponseCallback { - void onSuccess(int capacity, int groupCount + void onSuccess(Integer capacity, Integer groupCount // groupList: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ); @@ -3602,13 +3663,13 @@ void onSuccess(int capacity, int groupCount } public interface RemoveGroupResponseCallback { - void onSuccess(int status, int groupId); + void onSuccess(Integer status, Integer groupId); void onError(Exception error); } public interface ViewGroupResponseCallback { - void onSuccess(int status, int groupId, String groupName); + void onSuccess(Integer status, Integer groupId, String groupName); void onError(Exception error); } @@ -3640,7 +3701,7 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void identify(DefaultClusterCallback callback, int identifyTime) { + public void identify(DefaultClusterCallback callback, Integer identifyTime) { identify(chipClusterPtr, callback, identifyTime); } @@ -3649,23 +3710,23 @@ public void identifyQuery(IdentifyQueryResponseCallback callback) { } public void triggerEffect( - DefaultClusterCallback callback, int effectIdentifier, int effectVariant) { + DefaultClusterCallback callback, Integer effectIdentifier, Integer effectVariant) { triggerEffect(chipClusterPtr, callback, effectIdentifier, effectVariant); } private native void identify( - long chipClusterPtr, DefaultClusterCallback callback, int identifyTime); + long chipClusterPtr, DefaultClusterCallback callback, Integer identifyTime); private native void identifyQuery(long chipClusterPtr, IdentifyQueryResponseCallback callback); private native void triggerEffect( long chipClusterPtr, DefaultClusterCallback callback, - int effectIdentifier, - int effectVariant); + Integer effectIdentifier, + Integer effectVariant); public interface IdentifyQueryResponseCallback { - void onSuccess(int timeout); + void onSuccess(Integer timeout); void onError(Exception error); } @@ -3781,14 +3842,15 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void sendKey(SendKeyResponseCallback callback, int keyCode) { + public void sendKey(SendKeyResponseCallback callback, Integer keyCode) { sendKey(chipClusterPtr, callback, keyCode); } - private native void sendKey(long chipClusterPtr, SendKeyResponseCallback callback, int keyCode); + private native void sendKey( + long chipClusterPtr, SendKeyResponseCallback callback, Integer keyCode); public interface SendKeyResponseCallback { - void onSuccess(int status); + void onSuccess(Integer status); void onError(Exception error); } @@ -3815,48 +3877,51 @@ public static long clusterId() { public void move( DefaultClusterCallback callback, - int moveMode, - int rate, - int optionMask, - int optionOverride) { + Integer moveMode, + Integer rate, + Integer optionMask, + Integer optionOverride) { move(chipClusterPtr, callback, moveMode, rate, optionMask, optionOverride); } public void moveToLevel( DefaultClusterCallback callback, - int level, - int transitionTime, - int optionMask, - int optionOverride) { + Integer level, + Integer transitionTime, + Integer optionMask, + Integer optionOverride) { moveToLevel(chipClusterPtr, callback, level, transitionTime, optionMask, optionOverride); } public void moveToLevelWithOnOff( - DefaultClusterCallback callback, int level, int transitionTime) { + DefaultClusterCallback callback, Integer level, Integer transitionTime) { moveToLevelWithOnOff(chipClusterPtr, callback, level, transitionTime); } - public void moveWithOnOff(DefaultClusterCallback callback, int moveMode, int rate) { + public void moveWithOnOff(DefaultClusterCallback callback, Integer moveMode, Integer rate) { moveWithOnOff(chipClusterPtr, callback, moveMode, rate); } public void step( DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionMask, - int optionOverride) { + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionMask, + Integer optionOverride) { step( chipClusterPtr, callback, stepMode, stepSize, transitionTime, optionMask, optionOverride); } public void stepWithOnOff( - DefaultClusterCallback callback, int stepMode, int stepSize, int transitionTime) { + DefaultClusterCallback callback, + Integer stepMode, + Integer stepSize, + Integer transitionTime) { stepWithOnOff(chipClusterPtr, callback, stepMode, stepSize, transitionTime); } - public void stop(DefaultClusterCallback callback, int optionMask, int optionOverride) { + public void stop(DefaultClusterCallback callback, Integer optionMask, Integer optionOverride) { stop(chipClusterPtr, callback, optionMask, optionOverride); } @@ -3867,43 +3932,49 @@ public void stopWithOnOff(DefaultClusterCallback callback) { private native void move( long chipClusterPtr, DefaultClusterCallback callback, - int moveMode, - int rate, - int optionMask, - int optionOverride); + Integer moveMode, + Integer rate, + Integer optionMask, + Integer optionOverride); private native void moveToLevel( long chipClusterPtr, DefaultClusterCallback callback, - int level, - int transitionTime, - int optionMask, - int optionOverride); + Integer level, + Integer transitionTime, + Integer optionMask, + Integer optionOverride); private native void moveToLevelWithOnOff( - long chipClusterPtr, DefaultClusterCallback callback, int level, int transitionTime); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer level, + Integer transitionTime); private native void moveWithOnOff( - long chipClusterPtr, DefaultClusterCallback callback, int moveMode, int rate); + long chipClusterPtr, DefaultClusterCallback callback, Integer moveMode, Integer rate); private native void step( long chipClusterPtr, DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime, - int optionMask, - int optionOverride); + Integer stepMode, + Integer stepSize, + Integer transitionTime, + Integer optionMask, + Integer optionOverride); private native void stepWithOnOff( long chipClusterPtr, DefaultClusterCallback callback, - int stepMode, - int stepSize, - int transitionTime); + Integer stepMode, + Integer stepSize, + Integer transitionTime); private native void stop( - long chipClusterPtr, DefaultClusterCallback callback, int optionMask, int optionOverride); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer optionMask, + Integer optionOverride); private native void stopWithOnOff(long chipClusterPtr, DefaultClusterCallback callback); @@ -4119,11 +4190,11 @@ public void hideInputStatus(DefaultClusterCallback callback) { hideInputStatus(chipClusterPtr, callback); } - public void renameInput(DefaultClusterCallback callback, int index, String name) { + public void renameInput(DefaultClusterCallback callback, Integer index, String name) { renameInput(chipClusterPtr, callback, index, name); } - public void selectInput(DefaultClusterCallback callback, int index) { + public void selectInput(DefaultClusterCallback callback, Integer index) { selectInput(chipClusterPtr, callback, index); } @@ -4134,10 +4205,10 @@ public void showInputStatus(DefaultClusterCallback callback) { private native void hideInputStatus(long chipClusterPtr, DefaultClusterCallback callback); private native void renameInput( - long chipClusterPtr, DefaultClusterCallback callback, int index, String name); + long chipClusterPtr, DefaultClusterCallback callback, Integer index, String name); private native void selectInput( - long chipClusterPtr, DefaultClusterCallback callback, int index); + long chipClusterPtr, DefaultClusterCallback callback, Integer index); private native void showInputStatus(long chipClusterPtr, DefaultClusterCallback callback); @@ -4242,17 +4313,17 @@ public void mediaRewind(MediaRewindResponseCallback callback) { mediaRewind(chipClusterPtr, callback); } - public void mediaSeek(MediaSeekResponseCallback callback, long position) { + public void mediaSeek(MediaSeekResponseCallback callback, Long position) { mediaSeek(chipClusterPtr, callback, position); } public void mediaSkipBackward( - MediaSkipBackwardResponseCallback callback, long deltaPositionMilliseconds) { + MediaSkipBackwardResponseCallback callback, Long deltaPositionMilliseconds) { mediaSkipBackward(chipClusterPtr, callback, deltaPositionMilliseconds); } public void mediaSkipForward( - MediaSkipForwardResponseCallback callback, long deltaPositionMilliseconds) { + MediaSkipForwardResponseCallback callback, Long deltaPositionMilliseconds) { mediaSkipForward(chipClusterPtr, callback, deltaPositionMilliseconds); } @@ -4278,17 +4349,17 @@ private native void mediaFastForward( private native void mediaRewind(long chipClusterPtr, MediaRewindResponseCallback callback); private native void mediaSeek( - long chipClusterPtr, MediaSeekResponseCallback callback, long position); + long chipClusterPtr, MediaSeekResponseCallback callback, Long position); private native void mediaSkipBackward( long chipClusterPtr, MediaSkipBackwardResponseCallback callback, - long deltaPositionMilliseconds); + Long deltaPositionMilliseconds); private native void mediaSkipForward( long chipClusterPtr, MediaSkipForwardResponseCallback callback, - long deltaPositionMilliseconds); + Long deltaPositionMilliseconds); private native void mediaStartOver( long chipClusterPtr, MediaStartOverResponseCallback callback); @@ -4296,67 +4367,67 @@ private native void mediaStartOver( private native void mediaStop(long chipClusterPtr, MediaStopResponseCallback callback); public interface MediaFastForwardResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaNextResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaPauseResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaPlayResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaPreviousResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaRewindResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaSeekResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaSkipBackwardResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaSkipForwardResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaStartOverResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } public interface MediaStopResponseCallback { - void onSuccess(int mediaPlaybackStatus); + void onSuccess(Integer mediaPlaybackStatus); void onError(Exception error); } @@ -4434,12 +4505,12 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback, int newMode) { + public void changeToMode(DefaultClusterCallback callback, Integer newMode) { changeToMode(chipClusterPtr, callback, newMode); } private native void changeToMode( - long chipClusterPtr, DefaultClusterCallback callback, int newMode); + long chipClusterPtr, DefaultClusterCallback callback, Integer newMode); public static class SupportedModesAttribute { public String label; @@ -4556,8 +4627,8 @@ public static long clusterId() { public void addThreadNetwork( AddThreadNetworkResponseCallback callback, byte[] operationalDataset, - long breadcrumb, - long timeoutMs) { + Long breadcrumb, + Long timeoutMs) { addThreadNetwork(chipClusterPtr, callback, operationalDataset, breadcrumb, timeoutMs); } @@ -4565,39 +4636,39 @@ public void addWiFiNetwork( AddWiFiNetworkResponseCallback callback, byte[] ssid, byte[] credentials, - long breadcrumb, - long timeoutMs) { + Long breadcrumb, + Long timeoutMs) { addWiFiNetwork(chipClusterPtr, callback, ssid, credentials, breadcrumb, timeoutMs); } public void disableNetwork( DisableNetworkResponseCallback callback, byte[] networkID, - long breadcrumb, - long timeoutMs) { + Long breadcrumb, + Long timeoutMs) { disableNetwork(chipClusterPtr, callback, networkID, breadcrumb, timeoutMs); } public void enableNetwork( - EnableNetworkResponseCallback callback, byte[] networkID, long breadcrumb, long timeoutMs) { + EnableNetworkResponseCallback callback, byte[] networkID, Long breadcrumb, Long timeoutMs) { enableNetwork(chipClusterPtr, callback, networkID, breadcrumb, timeoutMs); } public void removeNetwork( - RemoveNetworkResponseCallback callback, byte[] networkID, long breadcrumb, long timeoutMs) { + RemoveNetworkResponseCallback callback, byte[] networkID, Long breadcrumb, Long timeoutMs) { removeNetwork(chipClusterPtr, callback, networkID, breadcrumb, timeoutMs); } public void scanNetworks( - ScanNetworksResponseCallback callback, byte[] ssid, long breadcrumb, long timeoutMs) { + ScanNetworksResponseCallback callback, byte[] ssid, Long breadcrumb, Long timeoutMs) { scanNetworks(chipClusterPtr, callback, ssid, breadcrumb, timeoutMs); } public void updateThreadNetwork( UpdateThreadNetworkResponseCallback callback, byte[] operationalDataset, - long breadcrumb, - long timeoutMs) { + Long breadcrumb, + Long timeoutMs) { updateThreadNetwork(chipClusterPtr, callback, operationalDataset, breadcrumb, timeoutMs); } @@ -4605,8 +4676,8 @@ public void updateWiFiNetwork( UpdateWiFiNetworkResponseCallback callback, byte[] ssid, byte[] credentials, - long breadcrumb, - long timeoutMs) { + Long breadcrumb, + Long timeoutMs) { updateWiFiNetwork(chipClusterPtr, callback, ssid, credentials, breadcrumb, timeoutMs); } @@ -4614,92 +4685,92 @@ private native void addThreadNetwork( long chipClusterPtr, AddThreadNetworkResponseCallback callback, byte[] operationalDataset, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void addWiFiNetwork( long chipClusterPtr, AddWiFiNetworkResponseCallback callback, byte[] ssid, byte[] credentials, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void disableNetwork( long chipClusterPtr, DisableNetworkResponseCallback callback, byte[] networkID, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void enableNetwork( long chipClusterPtr, EnableNetworkResponseCallback callback, byte[] networkID, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void removeNetwork( long chipClusterPtr, RemoveNetworkResponseCallback callback, byte[] networkID, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void scanNetworks( long chipClusterPtr, ScanNetworksResponseCallback callback, byte[] ssid, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void updateThreadNetwork( long chipClusterPtr, UpdateThreadNetworkResponseCallback callback, byte[] operationalDataset, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); private native void updateWiFiNetwork( long chipClusterPtr, UpdateWiFiNetworkResponseCallback callback, byte[] ssid, byte[] credentials, - long breadcrumb, - long timeoutMs); + Long breadcrumb, + Long timeoutMs); public interface AddThreadNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface AddWiFiNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface DisableNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface EnableNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface RemoveNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface ScanNetworksResponseCallback { - void onSuccess(int errorCode, String debugText + void onSuccess(Integer errorCode, String debugText // wifiScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet // threadScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * @@ -4710,13 +4781,13 @@ void onSuccess(int errorCode, String debugText } public interface UpdateThreadNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } public interface UpdateWiFiNetworkResponseCallback { - void onSuccess(int errorCode, String debugText); + void onSuccess(Integer errorCode, String debugText); void onError(Exception error); } @@ -4749,25 +4820,25 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public void applyUpdateRequest( - ApplyUpdateResponseCallback callback, byte[] updateToken, long newVersion) { + ApplyUpdateResponseCallback callback, byte[] updateToken, Long newVersion) { applyUpdateRequest(chipClusterPtr, callback, updateToken, newVersion); } public void notifyUpdateApplied( - DefaultClusterCallback callback, byte[] updateToken, long softwareVersion) { + DefaultClusterCallback callback, byte[] updateToken, Long softwareVersion) { notifyUpdateApplied(chipClusterPtr, callback, updateToken, softwareVersion); } public void queryImage( QueryImageResponseCallback callback, - int vendorId, - int productId, - long softwareVersion, - int protocolsSupported, - int hardwareVersion, - String location, - boolean requestorCanConsent, - byte[] metadataForProvider) { + Integer vendorId, + Integer productId, + Long softwareVersion, + Integer protocolsSupported, + Optional hardwareVersion, + Optional location, + Optional requestorCanConsent, + Optional metadataForProvider) { queryImage( chipClusterPtr, callback, @@ -4785,42 +4856,42 @@ private native void applyUpdateRequest( long chipClusterPtr, ApplyUpdateResponseCallback callback, byte[] updateToken, - long newVersion); + Long newVersion); private native void notifyUpdateApplied( long chipClusterPtr, DefaultClusterCallback callback, byte[] updateToken, - long softwareVersion); + Long softwareVersion); private native void queryImage( long chipClusterPtr, QueryImageResponseCallback callback, - int vendorId, - int productId, - long softwareVersion, - int protocolsSupported, - int hardwareVersion, - String location, - boolean requestorCanConsent, - byte[] metadataForProvider); + Integer vendorId, + Integer productId, + Long softwareVersion, + Integer protocolsSupported, + Optional hardwareVersion, + Optional location, + Optional requestorCanConsent, + Optional metadataForProvider); public interface ApplyUpdateResponseCallback { - void onSuccess(int action, long delayedActionTime); + void onSuccess(Integer action, Long delayedActionTime); void onError(Exception error); } public interface QueryImageResponseCallback { void onSuccess( - int status, - long delayedActionTime, - String imageURI, - long softwareVersion, - String softwareVersionString, - byte[] updateToken, - boolean userConsentNeeded, - byte[] metadataForRequestor); + Integer status, + Optional delayedActionTime, + Optional imageURI, + Optional softwareVersion, + Optional softwareVersionString, + Optional updateToken, + Optional userConsentNeeded, + Optional metadataForRequestor); void onError(Exception error); } @@ -4847,10 +4918,10 @@ public static long clusterId() { public void announceOtaProvider( DefaultClusterCallback callback, - long providerLocation, - int vendorId, - int announcementReason, - byte[] metadataForNode) { + Long providerLocation, + Integer vendorId, + Integer announcementReason, + Optional metadataForNode) { announceOtaProvider( chipClusterPtr, callback, @@ -4863,10 +4934,10 @@ public void announceOtaProvider( private native void announceOtaProvider( long chipClusterPtr, DefaultClusterCallback callback, - long providerLocation, - int vendorId, - int announcementReason, - byte[] metadataForNode); + Long providerLocation, + Integer vendorId, + Integer announcementReason, + Optional metadataForNode); public void readDefaultOtaProviderAttribute(OctetStringAttributeCallback callback) { readDefaultOtaProviderAttribute(chipClusterPtr, callback); @@ -4969,7 +5040,8 @@ public void off(DefaultClusterCallback callback) { off(chipClusterPtr, callback); } - public void offWithEffect(DefaultClusterCallback callback, int effectId, int effectVariant) { + public void offWithEffect( + DefaultClusterCallback callback, Integer effectId, Integer effectVariant) { offWithEffect(chipClusterPtr, callback, effectId, effectVariant); } @@ -4982,7 +5054,10 @@ public void onWithRecallGlobalScene(DefaultClusterCallback callback) { } public void onWithTimedOff( - DefaultClusterCallback callback, int onOffControl, int onTime, int offWaitTime) { + DefaultClusterCallback callback, + Integer onOffControl, + Integer onTime, + Integer offWaitTime) { onWithTimedOff(chipClusterPtr, callback, onOffControl, onTime, offWaitTime); } @@ -4993,7 +5068,10 @@ public void toggle(DefaultClusterCallback callback) { private native void off(long chipClusterPtr, DefaultClusterCallback callback); private native void offWithEffect( - long chipClusterPtr, DefaultClusterCallback callback, int effectId, int effectVariant); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer effectId, + Integer effectVariant); private native void on(long chipClusterPtr, DefaultClusterCallback callback); @@ -5003,9 +5081,9 @@ private native void onWithRecallGlobalScene( private native void onWithTimedOff( long chipClusterPtr, DefaultClusterCallback callback, - int onOffControl, - int onTime, - int offWaitTime); + Integer onOffControl, + Integer onTime, + Integer offWaitTime); private native void toggle(long chipClusterPtr, DefaultClusterCallback callback); @@ -5149,10 +5227,10 @@ public static long clusterId() { public void addNOC( NOCResponseCallback callback, byte[] NOCValue, - byte[] ICACValue, + Optional ICACValue, byte[] IPKValue, - long caseAdminNode, - int adminVendorId) { + Long caseAdminNode, + Integer adminVendorId) { addNOC(chipClusterPtr, callback, NOCValue, ICACValue, IPKValue, caseAdminNode, adminVendorId); } @@ -5165,7 +5243,7 @@ public void attestationRequest(AttestationResponseCallback callback, byte[] atte } public void certificateChainRequest( - CertificateChainResponseCallback callback, int certificateType) { + CertificateChainResponseCallback callback, Integer certificateType) { certificateChainRequest(chipClusterPtr, callback, certificateType); } @@ -5173,7 +5251,7 @@ public void opCSRRequest(OpCSRResponseCallback callback, byte[] CSRNonce) { opCSRRequest(chipClusterPtr, callback, CSRNonce); } - public void removeFabric(NOCResponseCallback callback, int fabricIndex) { + public void removeFabric(NOCResponseCallback callback, Integer fabricIndex) { removeFabric(chipClusterPtr, callback, fabricIndex); } @@ -5186,7 +5264,8 @@ public void updateFabricLabel(NOCResponseCallback callback, String label) { updateFabricLabel(chipClusterPtr, callback, label); } - public void updateNOC(NOCResponseCallback callback, byte[] NOCValue, byte[] ICACValue) { + public void updateNOC( + NOCResponseCallback callback, byte[] NOCValue, Optional ICACValue) { updateNOC(chipClusterPtr, callback, NOCValue, ICACValue); } @@ -5194,10 +5273,10 @@ private native void addNOC( long chipClusterPtr, NOCResponseCallback callback, byte[] NOCValue, - byte[] ICACValue, + Optional ICACValue, byte[] IPKValue, - long caseAdminNode, - int adminVendorId); + Long caseAdminNode, + Integer adminVendorId); private native void addTrustedRootCertificate( long chipClusterPtr, DefaultClusterCallback callback, byte[] rootCertificate); @@ -5206,13 +5285,13 @@ private native void attestationRequest( long chipClusterPtr, AttestationResponseCallback callback, byte[] attestationNonce); private native void certificateChainRequest( - long chipClusterPtr, CertificateChainResponseCallback callback, int certificateType); + long chipClusterPtr, CertificateChainResponseCallback callback, Integer certificateType); private native void opCSRRequest( long chipClusterPtr, OpCSRResponseCallback callback, byte[] CSRNonce); private native void removeFabric( - long chipClusterPtr, NOCResponseCallback callback, int fabricIndex); + long chipClusterPtr, NOCResponseCallback callback, Integer fabricIndex); private native void removeTrustedRootCertificate( long chipClusterPtr, DefaultClusterCallback callback, byte[] trustedRootIdentifier); @@ -5221,7 +5300,10 @@ private native void updateFabricLabel( long chipClusterPtr, NOCResponseCallback callback, String label); private native void updateNOC( - long chipClusterPtr, NOCResponseCallback callback, byte[] NOCValue, byte[] ICACValue); + long chipClusterPtr, + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue); public interface AttestationResponseCallback { void onSuccess(byte[] AttestationElements, byte[] Signature); @@ -5236,7 +5318,7 @@ public interface CertificateChainResponseCallback { } public interface NOCResponseCallback { - void onSuccess(int StatusCode, int FabricIndex, String DebugText); + void onSuccess(Integer StatusCode, Integer FabricIndex, String DebugText); void onError(Exception error); } @@ -5823,13 +5905,13 @@ public static long clusterId() { public void addScene( AddSceneResponseCallback callback, - int groupId, - int sceneId, - int transitionTime, + Integer groupId, + Integer sceneId, + Integer transitionTime, String sceneName, - long clusterId, - int length, - int value) { + Long clusterId, + Integer length, + Integer value) { addScene( chipClusterPtr, callback, @@ -5842,72 +5924,76 @@ public void addScene( value); } - public void getSceneMembership(GetSceneMembershipResponseCallback callback, int groupId) { + public void getSceneMembership(GetSceneMembershipResponseCallback callback, Integer groupId) { getSceneMembership(chipClusterPtr, callback, groupId); } public void recallScene( - DefaultClusterCallback callback, int groupId, int sceneId, int transitionTime) { + DefaultClusterCallback callback, Integer groupId, Integer sceneId, Integer transitionTime) { recallScene(chipClusterPtr, callback, groupId, sceneId, transitionTime); } - public void removeAllScenes(RemoveAllScenesResponseCallback callback, int groupId) { + public void removeAllScenes(RemoveAllScenesResponseCallback callback, Integer groupId) { removeAllScenes(chipClusterPtr, callback, groupId); } - public void removeScene(RemoveSceneResponseCallback callback, int groupId, int sceneId) { + public void removeScene( + RemoveSceneResponseCallback callback, Integer groupId, Integer sceneId) { removeScene(chipClusterPtr, callback, groupId, sceneId); } - public void storeScene(StoreSceneResponseCallback callback, int groupId, int sceneId) { + public void storeScene(StoreSceneResponseCallback callback, Integer groupId, Integer sceneId) { storeScene(chipClusterPtr, callback, groupId, sceneId); } - public void viewScene(ViewSceneResponseCallback callback, int groupId, int sceneId) { + public void viewScene(ViewSceneResponseCallback callback, Integer groupId, Integer sceneId) { viewScene(chipClusterPtr, callback, groupId, sceneId); } private native void addScene( long chipClusterPtr, AddSceneResponseCallback callback, - int groupId, - int sceneId, - int transitionTime, + Integer groupId, + Integer sceneId, + Integer transitionTime, String sceneName, - long clusterId, - int length, - int value); + Long clusterId, + Integer length, + Integer value); private native void getSceneMembership( - long chipClusterPtr, GetSceneMembershipResponseCallback callback, int groupId); + long chipClusterPtr, GetSceneMembershipResponseCallback callback, Integer groupId); private native void recallScene( long chipClusterPtr, DefaultClusterCallback callback, - int groupId, - int sceneId, - int transitionTime); + Integer groupId, + Integer sceneId, + Integer transitionTime); private native void removeAllScenes( - long chipClusterPtr, RemoveAllScenesResponseCallback callback, int groupId); + long chipClusterPtr, RemoveAllScenesResponseCallback callback, Integer groupId); private native void removeScene( - long chipClusterPtr, RemoveSceneResponseCallback callback, int groupId, int sceneId); + long chipClusterPtr, + RemoveSceneResponseCallback callback, + Integer groupId, + Integer sceneId); private native void storeScene( - long chipClusterPtr, StoreSceneResponseCallback callback, int groupId, int sceneId); + long chipClusterPtr, StoreSceneResponseCallback callback, Integer groupId, Integer sceneId); private native void viewScene( - long chipClusterPtr, ViewSceneResponseCallback callback, int groupId, int sceneId); + long chipClusterPtr, ViewSceneResponseCallback callback, Integer groupId, Integer sceneId); public interface AddSceneResponseCallback { - void onSuccess(int status, int groupId, int sceneId); + void onSuccess(Integer status, Integer groupId, Integer sceneId); void onError(Exception error); } public interface GetSceneMembershipResponseCallback { - void onSuccess(int status, int capacity, int groupId, int sceneCount + void onSuccess(Integer status, Integer capacity, Integer groupId, Integer sceneCount // sceneList: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ); @@ -5916,25 +6002,26 @@ void onSuccess(int status, int capacity, int groupId, int sceneCount } public interface RemoveAllScenesResponseCallback { - void onSuccess(int status, int groupId); + void onSuccess(Integer status, Integer groupId); void onError(Exception error); } public interface RemoveSceneResponseCallback { - void onSuccess(int status, int groupId, int sceneId); + void onSuccess(Integer status, Integer groupId, Integer sceneId); void onError(Exception error); } public interface StoreSceneResponseCallback { - void onSuccess(int status, int groupId, int sceneId); + void onSuccess(Integer status, Integer groupId, Integer sceneId); void onError(Exception error); } public interface ViewSceneResponseCallback { - void onSuccess(int status, int groupId, int sceneId, int transitionTime, String sceneName + void onSuccess( + Integer status, Integer groupId, Integer sceneId, Integer transitionTime, String sceneName // extensionFieldSets: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ); @@ -6168,11 +6255,11 @@ public void changeChannel(ChangeChannelResponseCallback callback, String match) } public void changeChannelByNumber( - DefaultClusterCallback callback, int majorNumber, int minorNumber) { + DefaultClusterCallback callback, Integer majorNumber, Integer minorNumber) { changeChannelByNumber(chipClusterPtr, callback, majorNumber, minorNumber); } - public void skipChannel(DefaultClusterCallback callback, int count) { + public void skipChannel(DefaultClusterCallback callback, Integer count) { skipChannel(chipClusterPtr, callback, count); } @@ -6180,16 +6267,18 @@ private native void changeChannel( long chipClusterPtr, ChangeChannelResponseCallback callback, String match); private native void changeChannelByNumber( - long chipClusterPtr, DefaultClusterCallback callback, int majorNumber, int minorNumber); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer majorNumber, + Integer minorNumber); private native void skipChannel( - long chipClusterPtr, DefaultClusterCallback callback, int count); + long chipClusterPtr, DefaultClusterCallback callback, Integer count); public interface ChangeChannelResponseCallback { - void onSuccess( - // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * + void onSuccess( // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet - int ErrorType); + Integer ErrorType); void onError(Exception error); } @@ -6288,15 +6377,16 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void navigateTarget(NavigateTargetResponseCallback callback, int target, String data) { + public void navigateTarget( + NavigateTargetResponseCallback callback, Integer target, String data) { navigateTarget(chipClusterPtr, callback, target, data); } private native void navigateTarget( - long chipClusterPtr, NavigateTargetResponseCallback callback, int target, String data); + long chipClusterPtr, NavigateTargetResponseCallback callback, Integer target, String data); public interface NavigateTargetResponseCallback { - void onSuccess(int status, String data); + void onSuccess(Integer status, String data); void onError(Exception error); } @@ -6440,25 +6530,32 @@ public void test(DefaultClusterCallback callback) { test(chipClusterPtr, callback); } - public void testAddArguments(TestAddArgumentsResponseCallback callback, int arg1, int arg2) { + public void testAddArguments( + TestAddArgumentsResponseCallback callback, Integer arg1, Integer arg2) { testAddArguments(chipClusterPtr, callback, arg1, arg2); } - public void testEnumsRequest(TestEnumsResponseCallback callback, int arg1, int arg2) { + public void testEnumsRequest(TestEnumsResponseCallback callback, Integer arg1, Integer arg2) { testEnumsRequest(chipClusterPtr, callback, arg1, arg2); } - public void testListInt8UArgumentRequest(BooleanResponseCallback callback, int arg1) { + public void testListInt8UArgumentRequest(BooleanResponseCallback callback, Integer arg1) { testListInt8UArgumentRequest(chipClusterPtr, callback, arg1); } public void testListInt8UReverseRequest( - TestListInt8UReverseResponseCallback callback, int arg1) { + TestListInt8UReverseResponseCallback callback, Integer arg1) { testListInt8UReverseRequest(chipClusterPtr, callback, arg1); } public void testListStructArgumentRequest( - BooleanResponseCallback callback, int a, boolean b, int c, byte[] d, String e, int f) { + BooleanResponseCallback callback, + Integer a, + Boolean b, + Integer c, + byte[] d, + String e, + Integer f) { testListStructArgumentRequest(chipClusterPtr, callback, a, b, c, d, e, f); } @@ -6467,7 +6564,7 @@ public void testNotHandled(DefaultClusterCallback callback) { } public void testNullableOptionalRequest( - TestNullableOptionalResponseCallback callback, int arg1) { + TestNullableOptionalResponseCallback callback, Optional arg1) { testNullableOptionalRequest(chipClusterPtr, callback, arg1); } @@ -6476,7 +6573,13 @@ public void testSpecific(TestSpecificResponseCallback callback) { } public void testStructArgumentRequest( - BooleanResponseCallback callback, int a, boolean b, int c, byte[] d, String e, int f) { + BooleanResponseCallback callback, + Integer a, + Boolean b, + Integer c, + byte[] d, + String e, + Integer f) { testStructArgumentRequest(chipClusterPtr, callback, a, b, c, d, e, f); } @@ -6487,67 +6590,66 @@ public void testUnknownCommand(DefaultClusterCallback callback) { private native void test(long chipClusterPtr, DefaultClusterCallback callback); private native void testAddArguments( - long chipClusterPtr, TestAddArgumentsResponseCallback callback, int arg1, int arg2); + long chipClusterPtr, TestAddArgumentsResponseCallback callback, Integer arg1, Integer arg2); private native void testEnumsRequest( - long chipClusterPtr, TestEnumsResponseCallback callback, int arg1, int arg2); + long chipClusterPtr, TestEnumsResponseCallback callback, Integer arg1, Integer arg2); private native void testListInt8UArgumentRequest( - long chipClusterPtr, BooleanResponseCallback callback, int arg1); + long chipClusterPtr, BooleanResponseCallback callback, Integer arg1); private native void testListInt8UReverseRequest( - long chipClusterPtr, TestListInt8UReverseResponseCallback callback, int arg1); + long chipClusterPtr, TestListInt8UReverseResponseCallback callback, Integer arg1); private native void testListStructArgumentRequest( long chipClusterPtr, BooleanResponseCallback callback, - int a, - boolean b, - int c, + Integer a, + Boolean b, + Integer c, byte[] d, String e, - int f); + Integer f); private native void testNotHandled(long chipClusterPtr, DefaultClusterCallback callback); private native void testNullableOptionalRequest( - long chipClusterPtr, TestNullableOptionalResponseCallback callback, int arg1); + long chipClusterPtr, TestNullableOptionalResponseCallback callback, Optional arg1); private native void testSpecific(long chipClusterPtr, TestSpecificResponseCallback callback); private native void testStructArgumentRequest( long chipClusterPtr, BooleanResponseCallback callback, - int a, - boolean b, - int c, + Integer a, + Boolean b, + Integer c, byte[] d, String e, - int f); + Integer f); private native void testUnknownCommand(long chipClusterPtr, DefaultClusterCallback callback); public interface BooleanResponseCallback { - void onSuccess(boolean value); + void onSuccess(Boolean value); void onError(Exception error); } public interface TestAddArgumentsResponseCallback { - void onSuccess(int returnValue); + void onSuccess(Integer returnValue); void onError(Exception error); } public interface TestEnumsResponseCallback { - void onSuccess(int arg1, int arg2); + void onSuccess(Integer arg1, Integer arg2); void onError(Exception error); } public interface TestListInt8UReverseResponseCallback { - void onSuccess( - // arg1: /* TYPE WARNING: array array defaults to */ uint8_t * + void onSuccess( // arg1: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ); @@ -6555,13 +6657,17 @@ void onSuccess( } public interface TestNullableOptionalResponseCallback { - void onSuccess(boolean wasPresent, boolean wasNull, int value, int originalValue); + void onSuccess( + Boolean wasPresent, + Optional wasNull, + Optional value, + Optional originalValue); void onError(Exception error); } public interface TestSpecificResponseCallback { - void onSuccess(int returnValue); + void onSuccess(Integer returnValue); void onError(Exception error); } @@ -7250,16 +7356,16 @@ public void getRelayStatusLog(DefaultClusterCallback callback) { } public void getWeeklySchedule( - DefaultClusterCallback callback, int daysToReturn, int modeToReturn) { + DefaultClusterCallback callback, Integer daysToReturn, Integer modeToReturn) { getWeeklySchedule(chipClusterPtr, callback, daysToReturn, modeToReturn); } public void setWeeklySchedule( DefaultClusterCallback callback, - int numberOfTransitionsForSequence, - int dayOfWeekForSequence, - int modeForSequence, - int payload) { + Integer numberOfTransitionsForSequence, + Integer dayOfWeekForSequence, + Integer modeForSequence, + Integer payload) { setWeeklySchedule( chipClusterPtr, callback, @@ -7269,7 +7375,7 @@ public void setWeeklySchedule( payload); } - public void setpointRaiseLower(DefaultClusterCallback callback, int mode, int amount) { + public void setpointRaiseLower(DefaultClusterCallback callback, Integer mode, Integer amount) { setpointRaiseLower(chipClusterPtr, callback, mode, amount); } @@ -7278,18 +7384,21 @@ public void setpointRaiseLower(DefaultClusterCallback callback, int mode, int am private native void getRelayStatusLog(long chipClusterPtr, DefaultClusterCallback callback); private native void getWeeklySchedule( - long chipClusterPtr, DefaultClusterCallback callback, int daysToReturn, int modeToReturn); + long chipClusterPtr, + DefaultClusterCallback callback, + Integer daysToReturn, + Integer modeToReturn); private native void setWeeklySchedule( long chipClusterPtr, DefaultClusterCallback callback, - int numberOfTransitionsForSequence, - int dayOfWeekForSequence, - int modeForSequence, - int payload); + Integer numberOfTransitionsForSequence, + Integer dayOfWeekForSequence, + Integer modeForSequence, + Integer payload); private native void setpointRaiseLower( - long chipClusterPtr, DefaultClusterCallback callback, int mode, int amount); + long chipClusterPtr, DefaultClusterCallback callback, Integer mode, Integer amount); public void readLocalTemperatureAttribute(IntegerAttributeCallback callback) { readLocalTemperatureAttribute(chipClusterPtr, callback); @@ -8536,20 +8645,24 @@ public void downOrClose(DefaultClusterCallback callback) { } public void goToLiftPercentage( - DefaultClusterCallback callback, int liftPercentageValue, int liftPercent100thsValue) { + DefaultClusterCallback callback, + Integer liftPercentageValue, + Integer liftPercent100thsValue) { goToLiftPercentage(chipClusterPtr, callback, liftPercentageValue, liftPercent100thsValue); } - public void goToLiftValue(DefaultClusterCallback callback, int liftValue) { + public void goToLiftValue(DefaultClusterCallback callback, Integer liftValue) { goToLiftValue(chipClusterPtr, callback, liftValue); } public void goToTiltPercentage( - DefaultClusterCallback callback, int tiltPercentageValue, int tiltPercent100thsValue) { + DefaultClusterCallback callback, + Integer tiltPercentageValue, + Integer tiltPercent100thsValue) { goToTiltPercentage(chipClusterPtr, callback, tiltPercentageValue, tiltPercent100thsValue); } - public void goToTiltValue(DefaultClusterCallback callback, int tiltValue) { + public void goToTiltValue(DefaultClusterCallback callback, Integer tiltValue) { goToTiltValue(chipClusterPtr, callback, tiltValue); } @@ -8566,20 +8679,20 @@ public void upOrOpen(DefaultClusterCallback callback) { private native void goToLiftPercentage( long chipClusterPtr, DefaultClusterCallback callback, - int liftPercentageValue, - int liftPercent100thsValue); + Integer liftPercentageValue, + Integer liftPercent100thsValue); private native void goToLiftValue( - long chipClusterPtr, DefaultClusterCallback callback, int liftValue); + long chipClusterPtr, DefaultClusterCallback callback, Integer liftValue); private native void goToTiltPercentage( long chipClusterPtr, DefaultClusterCallback callback, - int tiltPercentageValue, - int tiltPercent100thsValue); + Integer tiltPercentageValue, + Integer tiltPercent100thsValue); private native void goToTiltValue( - long chipClusterPtr, DefaultClusterCallback callback, int tiltValue); + long chipClusterPtr, DefaultClusterCallback callback, Integer tiltValue); private native void stopMotion(long chipClusterPtr, DefaultClusterCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 2d405e24069506..d7d9492ee33005 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -30,6 +30,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Optional; public class ClusterInfoMapping { @@ -208,7 +209,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, String data) { + public void onSuccess(Integer status, String data) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -343,7 +344,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(String data, int contentLaunchStatus) { + public void onSuccess(String data, Integer contentLaunchStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); responseValues.put(dataResponseValue, data); @@ -370,7 +371,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(String data, int contentLaunchStatus) { + public void onSuccess(String data, Integer contentLaunchStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); responseValues.put(dataResponseValue, data); @@ -552,7 +553,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, byte[] content, long timeStamp, long timeSinceBoot) { + public void onSuccess(Integer status, byte[] content, Long timeStamp, Long timeSinceBoot) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -583,7 +584,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -607,7 +608,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -631,7 +632,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -654,7 +655,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -677,7 +678,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -701,7 +702,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -725,7 +726,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -750,11 +751,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - int scheduleId, - int status, - long localStartTime, - long localEndTime, - int operatingModeDuringHoliday) { + Integer scheduleId, + Integer status, + Long localStartTime, + Long localEndTime, + Integer operatingModeDuringHoliday) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo scheduleIdResponseValue = new CommandResponseInfo("scheduleId", "int"); responseValues.put(scheduleIdResponseValue, scheduleId); @@ -790,12 +791,12 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - int logEntryId, - long timestamp, - int eventType, - int source, - int eventIdOrAlarmCode, - int userId, + Integer logEntryId, + Long timestamp, + Integer eventType, + Integer source, + Integer eventIdOrAlarmCode, + Integer userId, byte[] pin) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo logEntryIdResponseValue = new CommandResponseInfo("logEntryId", "int"); @@ -832,7 +833,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int userId, int userStatus, int userType, byte[] pin) { + public void onSuccess(Integer userId, Integer userStatus, Integer userType, byte[] pin) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo userIdResponseValue = new CommandResponseInfo("userId", "int"); responseValues.put(userIdResponseValue, userId); @@ -861,7 +862,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int userId, int userStatus, int userType, byte[] rfid) { + public void onSuccess(Integer userId, Integer userStatus, Integer userType, byte[] rfid) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo userIdResponseValue = new CommandResponseInfo("userId", "int"); responseValues.put(userIdResponseValue, userId); @@ -891,7 +892,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int userId, int userType) { + public void onSuccess(Integer userId, Integer userType) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo userIdResponseValue = new CommandResponseInfo("userId", "int"); responseValues.put(userIdResponseValue, userId); @@ -918,14 +919,14 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - int scheduleId, - int userId, - int status, - int daysMask, - int startHour, - int startMinute, - int endHour, - int endMinute) { + Integer scheduleId, + Integer userId, + Integer status, + Integer daysMask, + Integer startHour, + Integer startMinute, + Integer endHour, + Integer endMinute) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo scheduleIdResponseValue = new CommandResponseInfo("scheduleId", "int"); responseValues.put(scheduleIdResponseValue, scheduleId); @@ -964,7 +965,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - int scheduleId, int userId, int status, long localStartTime, long localEndTime) { + Integer scheduleId, + Integer userId, + Integer status, + Long localStartTime, + Long localEndTime) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo scheduleIdResponseValue = new CommandResponseInfo("scheduleId", "int"); responseValues.put(scheduleIdResponseValue, scheduleId); @@ -997,7 +1002,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1021,7 +1026,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1044,7 +1049,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1067,7 +1072,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1091,7 +1096,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1115,7 +1120,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1139,7 +1144,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1162,7 +1167,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1186,7 +1191,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1237,7 +1242,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -1263,7 +1268,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -1289,7 +1294,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -1507,7 +1512,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId) { + public void onSuccess(Integer status, Integer groupId) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1533,7 +1538,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int capacity, int groupCount + public void onSuccess(Integer capacity, Integer groupCount // groupList: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ) { @@ -1563,7 +1568,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId) { + public void onSuccess(Integer status, Integer groupId) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1588,7 +1593,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId, String groupName) { + public void onSuccess(Integer status, Integer groupId, String groupName) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1616,7 +1621,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int timeout) { + public void onSuccess(Integer timeout) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo timeoutResponseValue = new CommandResponseInfo("timeout", "int"); responseValues.put(timeoutResponseValue, timeout); @@ -1639,7 +1644,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -1690,7 +1695,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1715,7 +1720,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1740,7 +1745,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1765,7 +1770,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1790,7 +1795,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1815,7 +1820,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1840,7 +1845,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1865,7 +1870,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1890,7 +1895,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1915,7 +1920,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1940,7 +1945,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int mediaPlaybackStatus) { + public void onSuccess(Integer mediaPlaybackStatus) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo mediaPlaybackStatusResponseValue = new CommandResponseInfo("mediaPlaybackStatus", "int"); @@ -1992,7 +1997,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2018,7 +2023,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2044,7 +2049,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2070,7 +2075,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2096,7 +2101,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2122,7 +2127,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText + public void onSuccess(Integer errorCode, String debugText // wifiScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet // threadScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * @@ -2157,7 +2162,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2183,7 +2188,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int errorCode, String debugText) { + public void onSuccess(Integer errorCode, String debugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "int"); responseValues.put(errorCodeResponseValue, errorCode); @@ -2209,7 +2214,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int action, long delayedActionTime) { + public void onSuccess(Integer action, Long delayedActionTime) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo actionResponseValue = new CommandResponseInfo("action", "int"); responseValues.put(actionResponseValue, action); @@ -2237,14 +2242,14 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - int status, - long delayedActionTime, - String imageURI, - long softwareVersion, - String softwareVersionString, - byte[] updateToken, - boolean userConsentNeeded, - byte[] metadataForRequestor) { + Integer status, + Optional delayedActionTime, + Optional imageURI, + Optional softwareVersion, + Optional softwareVersionString, + Optional updateToken, + Optional userConsentNeeded, + Optional metadataForRequestor) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -2340,7 +2345,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int StatusCode, int FabricIndex, String DebugText) { + public void onSuccess(Integer StatusCode, Integer FabricIndex, String DebugText) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo StatusCodeResponseValue = new CommandResponseInfo("StatusCode", "int"); responseValues.put(StatusCodeResponseValue, StatusCode); @@ -2476,7 +2481,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId, int sceneId) { + public void onSuccess(Integer status, Integer groupId, Integer sceneId) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -2504,7 +2509,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int capacity, int groupId, int sceneCount + public void onSuccess(Integer status, Integer capacity, Integer groupId, Integer sceneCount // sceneList: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ) { @@ -2539,7 +2544,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId) { + public void onSuccess(Integer status, Integer groupId) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -2564,7 +2569,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId, int sceneId) { + public void onSuccess(Integer status, Integer groupId, Integer sceneId) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -2591,7 +2596,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId, int sceneId) { + public void onSuccess(Integer status, Integer groupId, Integer sceneId) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -2618,7 +2623,8 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, int groupId, int sceneId, int transitionTime, String sceneName + public void onSuccess( + Integer status, Integer groupId, Integer sceneId, Integer transitionTime, String sceneName // extensionFieldSets: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ) { @@ -2684,10 +2690,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( - // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * + public void onSuccess( // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet - int ErrorType) { + Integer ErrorType) { Map responseValues = new LinkedHashMap<>(); // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet @@ -2740,7 +2745,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int status, String data) { + public void onSuccess(Integer status, String data) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); responseValues.put(statusResponseValue, status); @@ -2794,7 +2799,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(boolean value) { + public void onSuccess(Boolean value) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "boolean"); responseValues.put(valueResponseValue, value); @@ -2818,7 +2823,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int returnValue) { + public void onSuccess(Integer returnValue) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "int"); responseValues.put(returnValueResponseValue, returnValue); @@ -2842,7 +2847,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int arg1, int arg2) { + public void onSuccess(Integer arg1, Integer arg2) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo arg1ResponseValue = new CommandResponseInfo("arg1", "int"); responseValues.put(arg1ResponseValue, arg1); @@ -2868,8 +2873,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( - // arg1: /* TYPE WARNING: array array defaults to */ uint8_t * + public void onSuccess( // arg1: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet ) { Map responseValues = new LinkedHashMap<>(); @@ -2895,7 +2899,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(boolean wasPresent, boolean wasNull, int value, int originalValue) { + public void onSuccess( + Boolean wasPresent, + Optional wasNull, + Optional value, + Optional originalValue) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo wasPresentResponseValue = new CommandResponseInfo("wasPresent", "boolean"); @@ -2927,7 +2935,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(int returnValue) { + public void onSuccess(Integer returnValue) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "int"); responseValues.put(returnValueResponseValue, returnValue); @@ -3577,6 +3585,7 @@ public void combineCommand( destination.get("windowCovering").combineCommands(source.get("windowCovering")); } + @SuppressWarnings("unchecked") public Map> getCommandMap() { Map> commandMap = new HashMap<>(); Map accountLoginClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -3973,7 +3982,7 @@ public Map> getCommandMap() { .disableAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsdisableActionCommandParams); @@ -4004,7 +4013,7 @@ public Map> getCommandMap() { .disableActionWithDuration( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID"), + (Optional) commandArguments.get("invokeID"), (Long) commandArguments.get("duration")); }, () -> new DelegatedDefaultClusterCallback(), @@ -4031,7 +4040,7 @@ public Map> getCommandMap() { .enableAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsenableActionCommandParams); @@ -4062,7 +4071,7 @@ public Map> getCommandMap() { .enableActionWithDuration( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID"), + (Optional) commandArguments.get("invokeID"), (Long) commandArguments.get("duration")); }, () -> new DelegatedDefaultClusterCallback(), @@ -4089,7 +4098,7 @@ public Map> getCommandMap() { .instantAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsinstantActionCommandParams); @@ -4122,7 +4131,7 @@ public Map> getCommandMap() { .instantActionWithTransition( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID"), + (Optional) commandArguments.get("invokeID"), (Integer) commandArguments.get("transitionTime")); }, () -> new DelegatedDefaultClusterCallback(), @@ -4149,7 +4158,7 @@ public Map> getCommandMap() { .pauseAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionspauseActionCommandParams); @@ -4180,7 +4189,7 @@ public Map> getCommandMap() { .pauseActionWithDuration( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID"), + (Optional) commandArguments.get("invokeID"), (Long) commandArguments.get("duration")); }, () -> new DelegatedDefaultClusterCallback(), @@ -4207,7 +4216,7 @@ public Map> getCommandMap() { .resumeAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsresumeActionCommandParams); @@ -4233,7 +4242,7 @@ public Map> getCommandMap() { .startAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsstartActionCommandParams); @@ -4264,7 +4273,7 @@ public Map> getCommandMap() { .startActionWithDuration( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID"), + (Optional) commandArguments.get("invokeID"), (Long) commandArguments.get("duration")); }, () -> new DelegatedDefaultClusterCallback(), @@ -4291,7 +4300,7 @@ public Map> getCommandMap() { .stopAction( (DefaultClusterCallback) callback, (Integer) commandArguments.get("actionID"), - (Long) commandArguments.get("invokeID")); + (Optional) commandArguments.get("invokeID")); }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsstopActionCommandParams); @@ -7018,10 +7027,10 @@ public Map> getCommandMap() { (Integer) commandArguments.get("productId"), (Long) commandArguments.get("softwareVersion"), (Integer) commandArguments.get("protocolsSupported"), - (Integer) commandArguments.get("hardwareVersion"), - (String) commandArguments.get("location"), - (Boolean) commandArguments.get("requestorCanConsent"), - (byte[]) commandArguments.get("metadataForProvider")); + (Optional) commandArguments.get("hardwareVersion"), + (Optional) commandArguments.get("location"), + (Optional) commandArguments.get("requestorCanConsent"), + (Optional) commandArguments.get("metadataForProvider")); }, () -> new DelegatedQueryImageResponseCallback(), otaSoftwareUpdateProviderqueryImageCommandParams); @@ -7068,7 +7077,7 @@ public Map> getCommandMap() { (Long) commandArguments.get("providerLocation"), (Integer) commandArguments.get("vendorId"), (Integer) commandArguments.get("announcementReason"), - (byte[]) commandArguments.get("metadataForNode")); + (Optional) commandArguments.get("metadataForNode")); }, () -> new DelegatedDefaultClusterCallback(), otaSoftwareUpdateRequestorannounceOtaProviderCommandParams); @@ -7220,7 +7229,7 @@ public Map> getCommandMap() { .addNOC( (ChipClusters.OperationalCredentialsCluster.NOCResponseCallback) callback, (byte[]) commandArguments.get("NOCValue"), - (byte[]) commandArguments.get("ICACValue"), + (Optional) commandArguments.get("ICACValue"), (byte[]) commandArguments.get("IPKValue"), (Long) commandArguments.get("caseAdminNode"), (Integer) commandArguments.get("adminVendorId")); @@ -7402,7 +7411,7 @@ public Map> getCommandMap() { .updateNOC( (ChipClusters.OperationalCredentialsCluster.NOCResponseCallback) callback, (byte[]) commandArguments.get("NOCValue"), - (byte[]) commandArguments.get("ICACValue")); + (Optional) commandArguments.get("ICACValue")); }, () -> new DelegatedNOCResponseCallback(), operationalCredentialsupdateNOCCommandParams); @@ -7906,7 +7915,7 @@ public Map> getCommandMap() { .testNullableOptionalRequest( (ChipClusters.TestClusterCluster.TestNullableOptionalResponseCallback) callback, - (Integer) commandArguments.get("arg1")); + (Optional) commandArguments.get("arg1")); }, () -> new DelegatedTestNullableOptionalResponseCallback(), testClustertestNullableOptionalRequestCommandParams); diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 29d0b39b27fb41..6fd6d89955c808 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -196,4 +196,61 @@ CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOpti return CHIP_NO_ERROR; } +CHIP_ERROR JniReferences::GetOptionalValue(jobject optionalObj, jobject & optionalValue) +{ + JNIEnv * env = GetEnvForCurrentThread(); + jclass optionalCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", optionalCls); + VerifyOrReturnError(optionalCls != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); + chip::JniClass jniClass(optionalCls); + + jmethodID isPresentMethod = env->GetMethodID(optionalCls, "isPresent", "()Z"); + VerifyOrReturnError(isPresentMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); + jboolean isPresent = env->CallBooleanMethod(optionalObj, isPresentMethod); + + if (!isPresent) + { + optionalValue = nullptr; + return CHIP_NO_ERROR; + } + + jmethodID getMethod = env->GetMethodID(optionalCls, "get", "()Ljava/lang/Object;"); + VerifyOrReturnError(getMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); + optionalValue = env->CallObjectMethod(optionalObj, getMethod); + return CHIP_NO_ERROR; +} + +jint JniReferences::IntegerToPrimitive(jobject boxedInteger) +{ + JNIEnv * env = GetEnvForCurrentThread(); + jclass boxedTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", boxedTypeCls); + chip::JniClass jniClass(boxedTypeCls); + + jmethodID valueMethod = env->GetMethodID(boxedTypeCls, "intValue", "()I"); + return env->CallIntMethod(boxedInteger, valueMethod); +} + +jlong JniReferences::LongToPrimitive(jobject boxedLong) +{ + JNIEnv * env = GetEnvForCurrentThread(); + jclass boxedTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", boxedTypeCls); + chip::JniClass jniClass(boxedTypeCls); + + jmethodID valueMethod = env->GetMethodID(boxedTypeCls, "longValue", "()J"); + return env->CallLongMethod(boxedLong, valueMethod); +} + +jboolean JniReferences::BooleanToPrimitive(jobject boxedBoolean) +{ + JNIEnv * env = GetEnvForCurrentThread(); + jclass boxedTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", boxedTypeCls); + chip::JniClass jniClass(boxedTypeCls); + + jmethodID valueMethod = env->GetMethodID(boxedTypeCls, "booleanValue", "()Z"); + return env->CallBooleanMethod(boxedBoolean, valueMethod); +} + } // namespace chip diff --git a/src/lib/support/JniReferences.h b/src/lib/support/JniReferences.h index 4bc9145af1edf1..a45cb3f0d15004 100644 --- a/src/lib/support/JniReferences.h +++ b/src/lib/support/JniReferences.h @@ -20,7 +20,6 @@ #include #include #include -#include #include namespace chip { @@ -82,6 +81,46 @@ class JniReferences */ CHIP_ERROR CreateOptional(jobject objectToWrap, jobject & outOptional); + /** + * Retrieve the value of a java.util.Optional, or nullptr if the Optional is empty. + */ + CHIP_ERROR GetOptionalValue(jobject optionalObj, jobject & optionalValue); + + /** + * Get a primitive jint from the Java boxed type Integer, using intValue(). + */ + jint IntegerToPrimitive(jobject boxedObject); + + /** + * Get a primitive jlong from the Java boxed type Long, using longValue(). + */ + jlong LongToPrimitive(jobject boxedObject); + + /** + * Get a primitive jboolean from the Java boxed type Booelan, using booleanValue(). + */ + jboolean BooleanToPrimitive(jobject boxedObject); + + /** + * Creates a boxed type (e.g. java.lang.Integer) based on the the class name ("java/lang/Integer"), constructor JNI signature + * ("(I)V"), and value. + */ + template + CHIP_ERROR CreateBoxedObject(std::string boxedTypeClsName, std::string constructorSignature, T value, jobject & outObj) + { + JNIEnv * env = GetEnvForCurrentThread(); + CHIP_ERROR err = CHIP_NO_ERROR; + jclass boxedTypeCls; + err = GetClassRef(env, boxedTypeClsName.c_str(), boxedTypeCls); + VerifyOrReturnError(err == CHIP_NO_ERROR, err); + + jmethodID boxedTypeConstructor = env->GetMethodID(boxedTypeCls, "", constructorSignature.c_str()); + outObj = env->NewObject(boxedTypeCls, boxedTypeConstructor, value); + env->DeleteGlobalRef(boxedTypeCls); + + return err; + } + private: JniReferences() {} diff --git a/src/lib/support/JniTypeWrappers.h b/src/lib/support/JniTypeWrappers.h index 25d620764ecd02..64d03301333b5a 100644 --- a/src/lib/support/JniTypeWrappers.h +++ b/src/lib/support/JniTypeWrappers.h @@ -17,27 +17,39 @@ #pragma once -#include "JniReferences.h" #include - #include +#include #include -#include +#include namespace chip { /// Exposes the underlying UTF string from a jni string class JniUtfString { public: - JniUtfString(JNIEnv * env, jstring string) : mEnv(env), mString(string) { mChars = env->GetStringUTFChars(string, 0); } + JniUtfString(JNIEnv * env, jstring string) : mEnv(env), mString(string) + { + if (string == nullptr) + { + return; + } + mChars = env->GetStringUTFChars(string, 0); + mDataLength = env->GetStringUTFLength(string); + } ~JniUtfString() { mEnv->ReleaseStringUTFChars(mString, mChars); } const char * c_str() const { return mChars; } + chip::CharSpan charSpan() const { return chip::CharSpan(c_str(), static_cast(size())); } + + jsize size() const { return mDataLength; } + private: JNIEnv * mEnv; jstring mString; const char * mChars; + jsize mDataLength; }; /// Exposes the underlying binary data from a jni byte array @@ -50,10 +62,12 @@ class JniByteArray ~JniByteArray() { mEnv->ReleaseByteArrayElements(mArray, mData, 0); } const jbyte * data() const { return mData; } + chip::ByteSpan byteSpan() const { return chip::ByteSpan(reinterpret_cast(data()), static_cast(size())); } + jsize size() const { return mDataLength; } private: @@ -94,6 +108,14 @@ class ByteArray env->SetByteArrayRegion(mArray, 0, dataLen, data); } } + ByteArray(JNIEnv * env, chip::ByteSpan data) : mEnv(env) + { + mArray = mEnv->NewByteArray(static_cast(data.size())); + if (mArray != nullptr) + { + env->SetByteArrayRegion(mArray, 0, static_cast(data.size()), reinterpret_cast(data.data())); + } + } ~ByteArray() { mEnv->DeleteLocalRef(mArray); } jbyteArray jniValue() { return mArray; } From 1359f6e87ef39ee4396b1ef29b6ae1dcf7e58ce3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 Nov 2021 15:25:17 -0500 Subject: [PATCH 5/5] Make the Objective-C APIs play slightly better with platform conventions. (#11823) Change property names in structs to be lowerCamelCased. This requires three interesting changes: 1) Deal with property names that collide with NSObject properties by renaming them. 2) Deal with property names that start with several all-uppercase letters by lowercasing all but the last one. 3) Define getter names for some of the properties, because some start with 'new', which makes the compiler complain. Also change all the properties to be nonatomic. --- .../CHIP/templates/CHIPClustersObjc-src.zapt | 2 +- .../templates/CHIPCommandPayloadsObjc.zapt | 4 +- .../CHIP/templates/CHIPStructsObjc.zapt | 4 +- src/darwin/Framework/CHIP/templates/helper.js | 36 +- .../partials/CHIPCallbackBridge.zapt | 12 +- .../templates/partials/check_test_value.zapt | 4 +- .../CHIP/templates/partials/decode_value.zapt | 2 +- .../CHIP/templates/partials/encode_value.zapt | 2 +- .../CHIP/templates/partials/test_cluster.zapt | 4 +- .../CHIP/templates/partials/test_value.zapt | 2 +- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 552 +++--- .../CHIP/zap-generated/CHIPClustersObjc.mm | 844 ++++----- .../zap-generated/CHIPCommandPayloadsObjc.h | 1640 ++++++++--------- .../CHIP/zap-generated/CHIPStructsObjc.h | 362 ++-- .../zap-generated/CHIPTestClustersObjc.mm | 310 ++-- .../Framework/CHIPTests/CHIPClustersTests.m | 1008 +++++----- 16 files changed, 2407 insertions(+), 2381 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt index 7c6532ce8de5cb..d597900414d86f 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt @@ -33,7 +33,7 @@ using namespace chip::app::Clusters; ListFreer listFreer; {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type request; {{#chip_cluster_command_arguments}} - {{>encode_value target=(concat "request." (asLowerCamelCase label)) source=(concat "payload." (asUpperCamelCase label)) cluster=parent.parent.name errorCode="return;" depth=0}} + {{>encode_value target=(concat "request." (asLowerCamelCase label)) source=(concat "payload." (asStructPropertyName label)) cluster=parent.parent.name errorCode="return;" depth=0}} {{/chip_cluster_command_arguments}} new CHIP{{>callbackName}}CallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { diff --git a/src/darwin/Framework/CHIP/templates/CHIPCommandPayloadsObjc.zapt b/src/darwin/Framework/CHIP/templates/CHIPCommandPayloadsObjc.zapt index 24d20d7b41fbf7..0d325252a2ab06 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPCommandPayloadsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPCommandPayloadsObjc.zapt @@ -9,8 +9,10 @@ {{#zcl_clusters}} {{#zcl_commands}} @interface CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Payload : NSObject +{{! Override the getter name because some of our properties start with things + like "new" or "init" }} {{#zcl_command_arguments}} -@property (strong) {{asObjectiveCType type parent.parent.name}} {{asUpperCamelCase label}}; +@property (strong, nonatomic{{#unless (isStrEqual (asGetterName label) (asStructPropertyName label))}}, getter={{asGetterName label}}{{/unless}}) {{asObjectiveCType type parent.parent.name}} {{asStructPropertyName label}}; {{/zcl_command_arguments}} @end diff --git a/src/darwin/Framework/CHIP/templates/CHIPStructsObjc.zapt b/src/darwin/Framework/CHIP/templates/CHIPStructsObjc.zapt index 8f9d89750f81ae..f4c87a4f9825e3 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPStructsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPStructsObjc.zapt @@ -8,8 +8,10 @@ {{#zcl_clusters}} {{#zcl_structs}} @interface CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}} : NSObject +{{! Override the getter name because some of our properties start with things + like "new" or "init" }} {{#zcl_struct_items}} -@property (strong) {{asObjectiveCType type parent.parent.name}} {{asUpperCamelCase label}}; +@property (strong, nonatomic{{#unless (isStrEqual (asGetterName label) (asStructPropertyName label))}}, getter={{asGetterName label}}{{/unless}}) {{asObjectiveCType type parent.parent.name}} {{asStructPropertyName label}}; {{/zcl_struct_items}} @end diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index 4adaeeaf04858e..d6e5546a8e0bee 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -23,6 +23,7 @@ const zclHelper = require(zapPath + 'generator/helper-zcl.js') const ChipTypesHelper = require('../../../../../src/app/zap-templates/common/ChipTypesHelper.js'); const StringHelper = require('../../../../../src/app/zap-templates/common/StringHelper.js'); +const appHelper = require('../../../../../src/app/zap-templates/templates/app/helper.js'); // Ideally those clusters clusters endpoints should be retrieved from the // descriptor cluster. @@ -115,12 +116,6 @@ function asTestIndex(index) return index.toString().padStart(6, 0); } -function asUpperCamelCase(label) -{ - let str = string.toCamelCase(label, false); - return str.replace(/[\.:]/g, ''); -} - async function asObjectiveCClass(type, cluster, options) { let pkgId = await templateUtil.ensureZclPackageId(this); @@ -139,7 +134,7 @@ async function asObjectiveCClass(type, cluster, options) } if (isStruct) { - return `CHIP${asUpperCamelCase(cluster)}Cluster${asUpperCamelCase(type)}`; + return `CHIP${appHelper.asUpperCamelCase(cluster)}Cluster${appHelper.asUpperCamelCase(type)}`; } return 'NSNumber'; @@ -168,6 +163,31 @@ function incrementDepth(depth) return depth + 1; } +function asStructPropertyName(prop) +{ + prop = appHelper.asLowerCamelCase(prop); + + // If prop is now "description", we need to rename it, because that's + // reserved. + if (prop == "description") { + return "descriptionString"; + } + + // If prop starts with a sequence of capital letters (which can happen for + // output of asLowerCamelCase if the original string started that way, + // lowercase all but the last one. + return prop.replace(/^([A-Z]+)([A-Z])/, (match, p1, p2) => { return p1.toLowerCase() + p2 }); +} + +function asGetterName(prop) +{ + let propName = asStructPropertyName(prop); + if (propName.match(/^new[A-Z]/) || propName == "count") { + return "get" + appHelper.asUpperCamelCase(prop); + } + return propName; +} + // // Module exports // @@ -180,3 +200,5 @@ exports.asObjectiveCClass = asObjectiveCClass; exports.asObjectiveCType = asObjectiveCType; exports.arrayElementObjectiveCClass = arrayElementObjectiveCClass; exports.incrementDepth = incrementDepth; +exports.asStructPropertyName = asStructPropertyName; +exports.asGetterName = asGetterName; diff --git a/src/darwin/Framework/CHIP/templates/partials/CHIPCallbackBridge.zapt b/src/darwin/Framework/CHIP/templates/partials/CHIPCallbackBridge.zapt index 0ac48ad9367faf..6c3e96d383a341 100644 --- a/src/darwin/Framework/CHIP/templates/partials/CHIPCallbackBridge.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/CHIPCallbackBridge.zapt @@ -40,7 +40,7 @@ void CHIP{{> @partial-block}}Bridge::OnSuccessFn(void * context { id value; {{>decode_value target="value" source=(concat "data." (asLowerCamelCase label)) cluster=parent.parent.name errorCode="OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return;"}} - response[@"{{asUpperCamelCase label}}"] = value; + response[@"{{asStructPropertyName label}}"] = value; } {{/chip_cluster_response_arguments}} DispatchSuccess(context, response); @@ -60,16 +60,16 @@ void CHIP{{> @partial-block}}Bridge::OnSuccessFn(void * context {{! TODO: Add support for nullable types, probably by having a templated ToObjectiveCType function }} {{else if isArray}} {{! TODO: Add support for list members of structs in list attributes }} - @"{{asUpperCamelCase name}}": [[NSMutableArray alloc] init], + @"{{asStructPropertyName name}}": [[NSMutableArray alloc] init], {{else if (isOctetString type)}} - @"{{asUpperCamelCase name}}" : [NSData dataWithBytes:entry.{{asLowerCamelCase name}}.data() length:entry.{{asLowerCamelCase name}}.size()], + @"{{asStructPropertyName name}}" : [NSData dataWithBytes:entry.{{asLowerCamelCase name}}.data() length:entry.{{asLowerCamelCase name}}.size()], {{else if (isCharString type)}} - @"{{asUpperCamelCase name}}" : [[NSString alloc] initWithBytes:entry.{{asLowerCamelCase name}}.data() length:entry.{{asLowerCamelCase name}}.size() encoding:NSUTF8StringEncoding], + @"{{asStructPropertyName name}}" : [[NSString alloc] initWithBytes:entry.{{asLowerCamelCase name}}.data() length:entry.{{asLowerCamelCase name}}.size() encoding:NSUTF8StringEncoding], {{else if isStruct}} {{! TODO: Add support for struct members of structs in list attributes }} - @"{{asUpperCamelCase name}}": @{} + @"{{asStructPropertyName name}}": @{} {{else}} - @"{{asUpperCamelCase name}}" : [NSNumber numberWith{{asObjectiveCNumberType label type false}}:entry.{{asLowerCamelCase name}}], + @"{{asStructPropertyName name}}" : [NSNumber numberWith{{asObjectiveCNumberType label type false}}:entry.{{asLowerCamelCase name}}], {{/if}} {{/chip_attribute_list_entryTypes}} }]; diff --git a/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt b/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt index d35a162a069848..5101dd6790d26d 100644 --- a/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt @@ -24,9 +24,9 @@ {{#if (expectedValueHasProp ../expected (asLowerCamelCase label))}} {{! TODO: This is a hack because right now some of our return values (attribute reads) are using NSDictionary for structs while others (commands) are using generated object types. Just support both for now. }} if ([{{../actual}} isKindOfClass:[NSDictionary class]]) { - {{>check_test_value actual=(concat ../actual '[@"' (asUpperCamelCase label) '"]') expected=(lookup ../expected (asLowerCamelCase label)) cluster=../cluster}} + {{>check_test_value actual=(concat ../actual '[@"' (asStructPropertyName label) '"]') expected=(lookup ../expected (asLowerCamelCase label)) cluster=../cluster}} } else { - {{>check_test_value actual=(concat "[" ../actual (asUpperCamelCase label) "]") expected=(lookup ../expected (asLowerCamelCase label)) cluster=../cluster}} + {{>check_test_value actual=(concat "((CHIP" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../actual ")." (asStructPropertyName label)) expected=(lookup ../expected (asLowerCamelCase label)) cluster=../cluster}} } {{/if}} {{/zcl_struct_items_by_struct_name}} diff --git a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt index fb3688f656356d..40814819241c1c 100644 --- a/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/decode_value.zapt @@ -28,7 +28,7 @@ {{else}} {{#if_is_struct type}} {{#zcl_struct_items_by_struct_name type}} - {{>decode_value target=(concat ../target "." (asUpperCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster}} + {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster}} {{/zcl_struct_items_by_struct_name}} {{else if (isOctetString type)}} {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; diff --git a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt index 9bd3274278c356..5e198542e10b7d 100644 --- a/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/encode_value.zapt @@ -46,7 +46,7 @@ {{else}} {{#if_is_struct type}} {{#zcl_struct_items_by_struct_name type}} - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asUpperCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} {{/zcl_struct_items_by_struct_name}} {{else}} {{#if_chip_enum type}} diff --git a/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt b/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt index 5fd28740cba579..96e15d7e3c91b7 100644 --- a/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt @@ -21,7 +21,7 @@ bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase {{#if isCommand}} __auto_type * payload = [[CHIP{{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase command}}Payload alloc] init]; {{#chip_tests_item_parameters}} - {{>test_value target=(concat "payload." (asUpperCamelCase label)) definedValue=definedValue cluster=parent.cluster}} + {{>test_value target=(concat "payload." (asStructPropertyName label)) definedValue=definedValue cluster=parent.cluster}} {{/chip_tests_item_parameters}} [cluster {{asLowerCamelCase command}}:payload responseHandler:^(NSError * err, NSDictionary * values) { {{else if isSubscribeAttribute}} @@ -68,7 +68,7 @@ bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase {{#chip_tests_item_response_parameters}} {{#if hasExpectedValue}} { - id actualValue = values[@"{{#if parent.isAttribute}}value{{else}}{{asUpperCamelCase name}}{{/if}}"]; + id actualValue = values[@"{{#if parent.isAttribute}}value{{else}}{{asStructPropertyName name}}{{/if}}"]; {{>check_test_value actual="actualValue" expected=expectedValue cluster=../cluster}} } {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/partials/test_value.zapt b/src/darwin/Framework/CHIP/templates/partials/test_value.zapt index 506cd2a1db37c8..28b88a3ea0ab30 100644 --- a/src/darwin/Framework/CHIP/templates/partials/test_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/test_value.zapt @@ -21,7 +21,7 @@ {{#zcl_struct_items_by_struct_name type}} {{! target may be some place where we lost type information (e.g. an id), so add explicit cast when trying to assign to our properties. }} - {{>test_value target=(concat "((CHIP" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../target ")." (asUpperCamelCase label)) definedValue=(lookup ../definedValue name) cluster=../cluster}} + {{>test_value target=(concat "((CHIP" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../target ")." (asStructPropertyName label)) definedValue=(lookup ../definedValue name) cluster=../cluster}} {{/zcl_struct_items_by_struct_name}} {{else if (isCharString type)}} diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 17ae30309e9a96..207d0acd3dfc69 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -111,9 +111,9 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Index" : [NSNumber numberWithUnsignedChar:entry.index], - @"OutputType" : [NSNumber numberWithUnsignedChar:entry.outputType], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"index" : [NSNumber numberWithUnsignedChar:entry.index], + @"outputType" : [NSNumber numberWithUnsignedChar:entry.outputType], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -133,12 +133,12 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"ActionID" : [NSNumber numberWithUnsignedShort:entry.actionID], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], - @"Type" : [NSNumber numberWithUnsignedChar:entry.type], - @"EndpointListID" : [NSNumber numberWithUnsignedShort:entry.endpointListID], - @"SupportedCommands" : [NSNumber numberWithUnsignedShort:entry.supportedCommands], - @"Status" : [NSNumber numberWithUnsignedChar:entry.status], + @"actionID" : [NSNumber numberWithUnsignedShort:entry.actionID], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"type" : [NSNumber numberWithUnsignedChar:entry.type], + @"endpointListID" : [NSNumber numberWithUnsignedShort:entry.endpointListID], + @"supportedCommands" : [NSNumber numberWithUnsignedShort:entry.supportedCommands], + @"status" : [NSNumber numberWithUnsignedChar:entry.status], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -159,10 +159,10 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"EndpointListID" : [NSNumber numberWithUnsignedShort:entry.endpointListID], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], - @"Type" : [NSNumber numberWithUnsignedChar:entry.type], - @"Endpoints" : [NSData dataWithBytes:entry.endpoints.data() length:entry.endpoints.size()], + @"endpointListID" : [NSNumber numberWithUnsignedShort:entry.endpointListID], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"type" : [NSNumber numberWithUnsignedChar:entry.type], + @"endpoints" : [NSData dataWithBytes:entry.endpoints.data() length:entry.endpoints.size()], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -218,8 +218,8 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Type" : [NSNumber numberWithUnsignedInt:entry.type], - @"Revision" : [NSNumber numberWithUnsignedShort:entry.revision], + @"type" : [NSNumber numberWithUnsignedInt:entry.type], + @"revision" : [NSNumber numberWithUnsignedShort:entry.revision], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -293,8 +293,8 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], - @"Value" : [[NSString alloc] initWithBytes:entry.value.data() length:entry.value.size() encoding:NSUTF8StringEncoding], + @"label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], + @"value" : [[NSString alloc] initWithBytes:entry.value.data() length:entry.value.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -315,7 +315,7 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"FailSafeExpiryLengthMs" : [NSNumber numberWithUnsignedInt:entry.failSafeExpiryLengthMs], + @"failSafeExpiryLengthMs" : [NSNumber numberWithUnsignedInt:entry.failSafeExpiryLengthMs], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -336,12 +336,12 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], - @"FabricConnected" : [NSNumber numberWithBool:entry.fabricConnected], - @"OffPremiseServicesReachableIPv4" : [NSNumber numberWithBool:entry.offPremiseServicesReachableIPv4], - @"OffPremiseServicesReachableIPv6" : [NSNumber numberWithBool:entry.offPremiseServicesReachableIPv6], - @"HardwareAddress" : [NSData dataWithBytes:entry.hardwareAddress.data() length:entry.hardwareAddress.size()], - @"Type" : [NSNumber numberWithUnsignedChar:entry.type], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"fabricConnected" : [NSNumber numberWithBool:entry.fabricConnected], + @"offPremiseServicesReachableIPv4" : [NSNumber numberWithBool:entry.offPremiseServicesReachableIPv4], + @"offPremiseServicesReachableIPv6" : [NSNumber numberWithBool:entry.offPremiseServicesReachableIPv6], + @"hardwareAddress" : [NSData dataWithBytes:entry.hardwareAddress.data() length:entry.hardwareAddress.size()], + @"type" : [NSNumber numberWithUnsignedChar:entry.type], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -415,9 +415,9 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"VendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], - @"VendorGroupId" : [NSNumber numberWithUnsignedShort:entry.vendorGroupId], - @"GroupKeySetIndex" : [NSNumber numberWithUnsignedShort:entry.groupKeySetIndex], + @"vendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], + @"vendorGroupId" : [NSNumber numberWithUnsignedShort:entry.vendorGroupId], + @"groupKeySetIndex" : [NSNumber numberWithUnsignedShort:entry.groupKeySetIndex], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -437,11 +437,11 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"VendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], - @"GroupKeyIndex" : [NSNumber numberWithUnsignedShort:entry.groupKeyIndex], - @"GroupKeyRoot" : [NSData dataWithBytes:entry.groupKeyRoot.data() length:entry.groupKeyRoot.size()], - @"GroupKeyEpochStartTime" : [NSNumber numberWithUnsignedLongLong:entry.groupKeyEpochStartTime], - @"GroupKeySecurityPolicy" : [NSNumber numberWithUnsignedChar:entry.groupKeySecurityPolicy], + @"vendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], + @"groupKeyIndex" : [NSNumber numberWithUnsignedShort:entry.groupKeyIndex], + @"groupKeyRoot" : [NSData dataWithBytes:entry.groupKeyRoot.data() length:entry.groupKeyRoot.size()], + @"groupKeyEpochStartTime" : [NSNumber numberWithUnsignedLongLong:entry.groupKeyEpochStartTime], + @"groupKeySecurityPolicy" : [NSNumber numberWithUnsignedChar:entry.groupKeySecurityPolicy], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -461,12 +461,12 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Index" : [NSNumber numberWithUnsignedChar:entry.index], - @"InputType" : [NSNumber numberWithUnsignedChar:entry.inputType], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], - @"Description" : [[NSString alloc] initWithBytes:entry.description.data() - length:entry.description.size() - encoding:NSUTF8StringEncoding], + @"index" : [NSNumber numberWithUnsignedChar:entry.index], + @"inputType" : [NSNumber numberWithUnsignedChar:entry.inputType], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"descriptionString" : [[NSString alloc] initWithBytes:entry.description.data() + length:entry.description.size() + encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -486,9 +486,9 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], - @"Mode" : [NSNumber numberWithUnsignedChar:entry.mode], - @"SemanticTag" : [NSNumber numberWithUnsignedInt:entry.semanticTag], + @"label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], + @"mode" : [NSNumber numberWithUnsignedChar:entry.mode], + @"semanticTag" : [NSNumber numberWithUnsignedInt:entry.semanticTag], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -509,12 +509,12 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"FabricIndex" : [NSNumber numberWithUnsignedChar:entry.fabricIndex], - @"RootPublicKey" : [NSData dataWithBytes:entry.rootPublicKey.data() length:entry.rootPublicKey.size()], - @"VendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], - @"FabricId" : [NSNumber numberWithUnsignedLongLong:entry.fabricId], - @"NodeId" : [NSNumber numberWithUnsignedLongLong:entry.nodeId], - @"Label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], + @"fabricIndex" : [NSNumber numberWithUnsignedChar:entry.fabricIndex], + @"rootPublicKey" : [NSData dataWithBytes:entry.rootPublicKey.data() length:entry.rootPublicKey.size()], + @"vendorId" : [NSNumber numberWithUnsignedShort:entry.vendorId], + @"fabricId" : [NSNumber numberWithUnsignedLongLong:entry.fabricId], + @"nodeId" : [NSNumber numberWithUnsignedLongLong:entry.nodeId], + @"label" : [[NSString alloc] initWithBytes:entry.label.data() length:entry.label.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -571,11 +571,11 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Id" : [NSNumber numberWithUnsignedLongLong:entry.id], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], - @"StackFreeCurrent" : [NSNumber numberWithUnsignedInt:entry.stackFreeCurrent], - @"StackFreeMinimum" : [NSNumber numberWithUnsignedInt:entry.stackFreeMinimum], - @"StackSize" : [NSNumber numberWithUnsignedInt:entry.stackSize], + @"id" : [NSNumber numberWithUnsignedLongLong:entry.id], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"stackFreeCurrent" : [NSNumber numberWithUnsignedInt:entry.stackFreeCurrent], + @"stackFreeMinimum" : [NSNumber numberWithUnsignedInt:entry.stackFreeMinimum], + @"stackSize" : [NSNumber numberWithUnsignedInt:entry.stackSize], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -595,13 +595,13 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"MajorNumber" : [NSNumber numberWithUnsignedShort:entry.majorNumber], - @"MinorNumber" : [NSNumber numberWithUnsignedShort:entry.minorNumber], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], - @"CallSign" : [[NSString alloc] initWithBytes:entry.callSign.data() + @"majorNumber" : [NSNumber numberWithUnsignedShort:entry.majorNumber], + @"minorNumber" : [NSNumber numberWithUnsignedShort:entry.minorNumber], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"callSign" : [[NSString alloc] initWithBytes:entry.callSign.data() length:entry.callSign.size() encoding:NSUTF8StringEncoding], - @"AffiliateCallSign" : [[NSString alloc] initWithBytes:entry.affiliateCallSign.data() + @"affiliateCallSign" : [[NSString alloc] initWithBytes:entry.affiliateCallSign.data() length:entry.affiliateCallSign.size() encoding:NSUTF8StringEncoding], }]; @@ -624,8 +624,8 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"Identifier" : [NSNumber numberWithUnsignedChar:entry.identifier], - @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"identifier" : [NSNumber numberWithUnsignedChar:entry.identifier], + @"name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -681,8 +681,8 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"FabricIndex" : [NSNumber numberWithUnsignedLongLong:entry.fabricIndex], - @"OperationalCert" : [NSData dataWithBytes:entry.operationalCert.data() length:entry.operationalCert.size()], + @"fabricIndex" : [NSNumber numberWithUnsignedLongLong:entry.fabricIndex], + @"operationalCert" : [NSData dataWithBytes:entry.operationalCert.data() length:entry.operationalCert.size()], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -722,20 +722,20 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"ExtAddress" : [NSNumber numberWithUnsignedLongLong:entry.extAddress], - @"Age" : [NSNumber numberWithUnsignedInt:entry.age], - @"Rloc16" : [NSNumber numberWithUnsignedShort:entry.rloc16], - @"LinkFrameCounter" : [NSNumber numberWithUnsignedInt:entry.linkFrameCounter], - @"MleFrameCounter" : [NSNumber numberWithUnsignedInt:entry.mleFrameCounter], - @"Lqi" : [NSNumber numberWithUnsignedChar:entry.lqi], - @"AverageRssi" : [NSNumber numberWithChar:entry.averageRssi], - @"LastRssi" : [NSNumber numberWithChar:entry.lastRssi], - @"FrameErrorRate" : [NSNumber numberWithUnsignedChar:entry.frameErrorRate], - @"MessageErrorRate" : [NSNumber numberWithUnsignedChar:entry.messageErrorRate], - @"RxOnWhenIdle" : [NSNumber numberWithBool:entry.rxOnWhenIdle], - @"FullThreadDevice" : [NSNumber numberWithBool:entry.fullThreadDevice], - @"FullNetworkData" : [NSNumber numberWithBool:entry.fullNetworkData], - @"IsChild" : [NSNumber numberWithBool:entry.isChild], + @"extAddress" : [NSNumber numberWithUnsignedLongLong:entry.extAddress], + @"age" : [NSNumber numberWithUnsignedInt:entry.age], + @"rloc16" : [NSNumber numberWithUnsignedShort:entry.rloc16], + @"linkFrameCounter" : [NSNumber numberWithUnsignedInt:entry.linkFrameCounter], + @"mleFrameCounter" : [NSNumber numberWithUnsignedInt:entry.mleFrameCounter], + @"lqi" : [NSNumber numberWithUnsignedChar:entry.lqi], + @"averageRssi" : [NSNumber numberWithChar:entry.averageRssi], + @"lastRssi" : [NSNumber numberWithChar:entry.lastRssi], + @"frameErrorRate" : [NSNumber numberWithUnsignedChar:entry.frameErrorRate], + @"messageErrorRate" : [NSNumber numberWithUnsignedChar:entry.messageErrorRate], + @"rxOnWhenIdle" : [NSNumber numberWithBool:entry.rxOnWhenIdle], + @"fullThreadDevice" : [NSNumber numberWithBool:entry.fullThreadDevice], + @"fullNetworkData" : [NSNumber numberWithBool:entry.fullNetworkData], + @"isChild" : [NSNumber numberWithBool:entry.isChild], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -756,16 +756,16 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"ExtAddress" : [NSNumber numberWithUnsignedLongLong:entry.extAddress], - @"Rloc16" : [NSNumber numberWithUnsignedShort:entry.rloc16], - @"RouterId" : [NSNumber numberWithUnsignedChar:entry.routerId], - @"NextHop" : [NSNumber numberWithUnsignedChar:entry.nextHop], - @"PathCost" : [NSNumber numberWithUnsignedChar:entry.pathCost], - @"LQIIn" : [NSNumber numberWithUnsignedChar:entry.LQIIn], - @"LQIOut" : [NSNumber numberWithUnsignedChar:entry.LQIOut], - @"Age" : [NSNumber numberWithUnsignedChar:entry.age], - @"Allocated" : [NSNumber numberWithBool:entry.allocated], - @"LinkEstablished" : [NSNumber numberWithBool:entry.linkEstablished], + @"extAddress" : [NSNumber numberWithUnsignedLongLong:entry.extAddress], + @"rloc16" : [NSNumber numberWithUnsignedShort:entry.rloc16], + @"routerId" : [NSNumber numberWithUnsignedChar:entry.routerId], + @"nextHop" : [NSNumber numberWithUnsignedChar:entry.nextHop], + @"pathCost" : [NSNumber numberWithUnsignedChar:entry.pathCost], + @"lqiIn" : [NSNumber numberWithUnsignedChar:entry.LQIIn], + @"lqiOut" : [NSNumber numberWithUnsignedChar:entry.LQIOut], + @"age" : [NSNumber numberWithUnsignedChar:entry.age], + @"allocated" : [NSNumber numberWithBool:entry.allocated], + @"linkEstablished" : [NSNumber numberWithBool:entry.linkEstablished], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -786,8 +786,8 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"RotationTime" : [NSNumber numberWithUnsignedShort:entry.rotationTime], - @"Flags" : [NSNumber numberWithUnsignedShort:entry.flags], + @"rotationTime" : [NSNumber numberWithUnsignedShort:entry.rotationTime], + @"flags" : [NSNumber numberWithUnsignedShort:entry.flags], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -808,18 +808,18 @@ auto & entry = iter.GetValue(); (void) entry; // All our types below might be unsupported [array addObject:@ { - @"ActiveTimestampPresent" : [NSNumber numberWithBool:entry.activeTimestampPresent], - @"PendingTimestampPresent" : [NSNumber numberWithBool:entry.pendingTimestampPresent], - @"MasterKeyPresent" : [NSNumber numberWithBool:entry.masterKeyPresent], - @"NetworkNamePresent" : [NSNumber numberWithBool:entry.networkNamePresent], - @"ExtendedPanIdPresent" : [NSNumber numberWithBool:entry.extendedPanIdPresent], - @"MeshLocalPrefixPresent" : [NSNumber numberWithBool:entry.meshLocalPrefixPresent], - @"DelayPresent" : [NSNumber numberWithBool:entry.delayPresent], - @"PanIdPresent" : [NSNumber numberWithBool:entry.panIdPresent], - @"ChannelPresent" : [NSNumber numberWithBool:entry.channelPresent], - @"PskcPresent" : [NSNumber numberWithBool:entry.pskcPresent], - @"SecurityPolicyPresent" : [NSNumber numberWithBool:entry.securityPolicyPresent], - @"ChannelMaskPresent" : [NSNumber numberWithBool:entry.channelMaskPresent], + @"activeTimestampPresent" : [NSNumber numberWithBool:entry.activeTimestampPresent], + @"pendingTimestampPresent" : [NSNumber numberWithBool:entry.pendingTimestampPresent], + @"masterKeyPresent" : [NSNumber numberWithBool:entry.masterKeyPresent], + @"networkNamePresent" : [NSNumber numberWithBool:entry.networkNamePresent], + @"extendedPanIdPresent" : [NSNumber numberWithBool:entry.extendedPanIdPresent], + @"meshLocalPrefixPresent" : [NSNumber numberWithBool:entry.meshLocalPrefixPresent], + @"delayPresent" : [NSNumber numberWithBool:entry.delayPresent], + @"panIdPresent" : [NSNumber numberWithBool:entry.panIdPresent], + @"channelPresent" : [NSNumber numberWithBool:entry.channelPresent], + @"pskcPresent" : [NSNumber numberWithBool:entry.pskcPresent], + @"securityPolicyPresent" : [NSNumber numberWithBool:entry.securityPolicyPresent], + @"channelMaskPresent" : [NSNumber numberWithBool:entry.channelMaskPresent], }]; } if (iter.GetStatus() != CHIP_NO_ERROR) { @@ -855,7 +855,7 @@ { id value; value = [[NSString alloc] initWithBytes:data.setupPIN.data() length:data.setupPIN.size() encoding:NSUTF8StringEncoding]; - response[@"SetupPIN"] = value; + response[@"setupPIN"] = value; } DispatchSuccess(context, response); }; @@ -867,12 +867,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; - response[@"Data"] = value; + response[@"data"] = value; } DispatchSuccess(context, response); }; @@ -884,12 +884,12 @@ { id value; value = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; - response[@"Data"] = value; + response[@"data"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.contentLaunchStatus]; - response[@"ContentLaunchStatus"] = value; + response[@"contentLaunchStatus"] = value; } DispatchSuccess(context, response); }; @@ -901,12 +901,12 @@ { id value; value = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; - response[@"Data"] = value; + response[@"data"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.contentLaunchStatus]; - response[@"ContentLaunchStatus"] = value; + response[@"contentLaunchStatus"] = value; } DispatchSuccess(context, response); }; @@ -918,22 +918,22 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSData dataWithBytes:data.content.data() length:data.content.size()]; - response[@"Content"] = value; + response[@"content"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.timeStamp]; - response[@"TimeStamp"] = value; + response[@"timeStamp"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.timeSinceBoot]; - response[@"TimeSinceBoot"] = value; + response[@"timeSinceBoot"] = value; } DispatchSuccess(context, response); }; @@ -945,7 +945,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -957,7 +957,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -969,7 +969,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -981,7 +981,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -993,7 +993,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1005,7 +1005,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1017,7 +1017,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1029,27 +1029,27 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.scheduleId]; - response[@"ScheduleId"] = value; + response[@"scheduleId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.localStartTime]; - response[@"LocalStartTime"] = value; + response[@"localStartTime"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.localEndTime]; - response[@"LocalEndTime"] = value; + response[@"localEndTime"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.operatingModeDuringHoliday]; - response[@"OperatingModeDuringHoliday"] = value; + response[@"operatingModeDuringHoliday"] = value; } DispatchSuccess(context, response); }; @@ -1061,37 +1061,37 @@ { id value; value = [NSNumber numberWithUnsignedShort:data.logEntryId]; - response[@"LogEntryId"] = value; + response[@"logEntryId"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.timestamp]; - response[@"Timestamp"] = value; + response[@"timestamp"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.eventType]; - response[@"EventType"] = value; + response[@"eventType"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.source]; - response[@"Source"] = value; + response[@"source"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.eventIdOrAlarmCode]; - response[@"EventIdOrAlarmCode"] = value; + response[@"eventIdOrAlarmCode"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.userId]; - response[@"UserId"] = value; + response[@"userId"] = value; } { id value; value = [NSData dataWithBytes:data.pin.data() length:data.pin.size()]; - response[@"Pin"] = value; + response[@"pin"] = value; } DispatchSuccess(context, response); }; @@ -1103,22 +1103,22 @@ { id value; value = [NSNumber numberWithUnsignedShort:data.userId]; - response[@"UserId"] = value; + response[@"userId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.userStatus]; - response[@"UserStatus"] = value; + response[@"userStatus"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.userType]; - response[@"UserType"] = value; + response[@"userType"] = value; } { id value; value = [NSData dataWithBytes:data.pin.data() length:data.pin.size()]; - response[@"Pin"] = value; + response[@"pin"] = value; } DispatchSuccess(context, response); }; @@ -1130,22 +1130,22 @@ { id value; value = [NSNumber numberWithUnsignedShort:data.userId]; - response[@"UserId"] = value; + response[@"userId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.userStatus]; - response[@"UserStatus"] = value; + response[@"userStatus"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.userType]; - response[@"UserType"] = value; + response[@"userType"] = value; } { id value; value = [NSData dataWithBytes:data.rfid.data() length:data.rfid.size()]; - response[@"Rfid"] = value; + response[@"rfid"] = value; } DispatchSuccess(context, response); }; @@ -1157,12 +1157,12 @@ { id value; value = [NSNumber numberWithUnsignedShort:data.userId]; - response[@"UserId"] = value; + response[@"userId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.userType]; - response[@"UserType"] = value; + response[@"userType"] = value; } DispatchSuccess(context, response); }; @@ -1174,42 +1174,42 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.scheduleId]; - response[@"ScheduleId"] = value; + response[@"scheduleId"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.userId]; - response[@"UserId"] = value; + response[@"userId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.daysMask]; - response[@"DaysMask"] = value; + response[@"daysMask"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.startHour]; - response[@"StartHour"] = value; + response[@"startHour"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.startMinute]; - response[@"StartMinute"] = value; + response[@"startMinute"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.endHour]; - response[@"EndHour"] = value; + response[@"endHour"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.endMinute]; - response[@"EndMinute"] = value; + response[@"endMinute"] = value; } DispatchSuccess(context, response); }; @@ -1221,27 +1221,27 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.scheduleId]; - response[@"ScheduleId"] = value; + response[@"scheduleId"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.userId]; - response[@"UserId"] = value; + response[@"userId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.localStartTime]; - response[@"LocalStartTime"] = value; + response[@"localStartTime"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.localEndTime]; - response[@"LocalEndTime"] = value; + response[@"localEndTime"] = value; } DispatchSuccess(context, response); }; @@ -1253,7 +1253,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1265,7 +1265,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1277,7 +1277,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1289,7 +1289,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1301,7 +1301,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1313,7 +1313,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1325,7 +1325,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1337,7 +1337,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1349,7 +1349,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1361,12 +1361,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1378,12 +1378,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1395,12 +1395,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1412,12 +1412,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } DispatchSuccess(context, response); }; @@ -1429,12 +1429,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.capacity]; - response[@"Capacity"] = value; + response[@"capacity"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.groupCount]; - response[@"GroupCount"] = value; + response[@"groupCount"] = value; } { id value; @@ -1450,7 +1450,7 @@ OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"GroupList"] = value; + response[@"groupList"] = value; } DispatchSuccess(context, response); }; @@ -1462,12 +1462,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } DispatchSuccess(context, response); }; @@ -1479,17 +1479,17 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.groupName.data() length:data.groupName.size() encoding:NSUTF8StringEncoding]; - response[@"GroupName"] = value; + response[@"groupName"] = value; } DispatchSuccess(context, response); }; @@ -1501,7 +1501,7 @@ { id value; value = [NSNumber numberWithUnsignedShort:data.timeout]; - response[@"Timeout"] = value; + response[@"timeout"] = value; } DispatchSuccess(context, response); }; @@ -1513,7 +1513,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } DispatchSuccess(context, response); }; @@ -1525,7 +1525,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1537,7 +1537,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1549,7 +1549,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1561,7 +1561,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1573,7 +1573,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1585,7 +1585,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1597,7 +1597,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1609,7 +1609,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1621,7 +1621,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1633,7 +1633,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1645,7 +1645,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.mediaPlaybackStatus]; - response[@"MediaPlaybackStatus"] = value; + response[@"mediaPlaybackStatus"] = value; } DispatchSuccess(context, response); }; @@ -1657,12 +1657,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1674,12 +1674,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1691,12 +1691,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1708,12 +1708,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1725,12 +1725,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1742,12 +1742,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } { id value; @@ -1756,18 +1756,18 @@ while (iter.Next()) { auto & entry = iter.GetValue(); auto * newElement = [[CHIPNetworkCommissioningClusterWiFiInterfaceScanResult alloc] init]; - newElement.Security = [NSNumber numberWithUnsignedChar:entry.security]; - newElement.Ssid = [NSData dataWithBytes:entry.ssid.data() length:entry.ssid.size()]; - newElement.Bssid = [NSData dataWithBytes:entry.bssid.data() length:entry.bssid.size()]; - newElement.Channel = [NSNumber numberWithUnsignedChar:entry.channel]; - newElement.FrequencyBand = [NSNumber numberWithUnsignedInt:entry.frequencyBand]; + newElement.security = [NSNumber numberWithUnsignedChar:entry.security]; + newElement.ssid = [NSData dataWithBytes:entry.ssid.data() length:entry.ssid.size()]; + newElement.bssid = [NSData dataWithBytes:entry.bssid.data() length:entry.bssid.size()]; + newElement.channel = [NSNumber numberWithUnsignedChar:entry.channel]; + newElement.frequencyBand = [NSNumber numberWithUnsignedInt:entry.frequencyBand]; [value addObject:newElement]; } if (iter.GetStatus() != CHIP_NO_ERROR) { OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"WifiScanResults"] = value; + response[@"wifiScanResults"] = value; } { id value; @@ -1776,7 +1776,7 @@ while (iter.Next()) { auto & entry = iter.GetValue(); auto * newElement = [[CHIPNetworkCommissioningClusterThreadInterfaceScanResult alloc] init]; - newElement.DiscoveryResponse = [NSData dataWithBytes:entry.discoveryResponse.data() + newElement.discoveryResponse = [NSData dataWithBytes:entry.discoveryResponse.data() length:entry.discoveryResponse.size()]; [value addObject:newElement]; } @@ -1784,7 +1784,7 @@ OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"ThreadScanResults"] = value; + response[@"threadScanResults"] = value; } DispatchSuccess(context, response); }; @@ -1796,12 +1796,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1813,12 +1813,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.errorCode]; - response[@"ErrorCode"] = value; + response[@"errorCode"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1830,12 +1830,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.action]; - response[@"Action"] = value; + response[@"action"] = value; } { id value; value = [NSNumber numberWithUnsignedInt:data.delayedActionTime]; - response[@"DelayedActionTime"] = value; + response[@"delayedActionTime"] = value; } DispatchSuccess(context, response); }; @@ -1847,7 +1847,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; @@ -1856,7 +1856,7 @@ } else { value = [NSNull null]; } - response[@"DelayedActionTime"] = value; + response[@"delayedActionTime"] = value; } { id value; @@ -1867,7 +1867,7 @@ } else { value = [NSNull null]; } - response[@"ImageURI"] = value; + response[@"imageURI"] = value; } { id value; @@ -1876,7 +1876,7 @@ } else { value = [NSNull null]; } - response[@"SoftwareVersion"] = value; + response[@"softwareVersion"] = value; } { id value; @@ -1887,7 +1887,7 @@ } else { value = [NSNull null]; } - response[@"SoftwareVersionString"] = value; + response[@"softwareVersionString"] = value; } { id value; @@ -1896,7 +1896,7 @@ } else { value = [NSNull null]; } - response[@"UpdateToken"] = value; + response[@"updateToken"] = value; } { id value; @@ -1905,7 +1905,7 @@ } else { value = [NSNull null]; } - response[@"UserConsentNeeded"] = value; + response[@"userConsentNeeded"] = value; } { id value; @@ -1914,7 +1914,7 @@ } else { value = [NSNull null]; } - response[@"MetadataForRequestor"] = value; + response[@"metadataForRequestor"] = value; } DispatchSuccess(context, response); }; @@ -1926,12 +1926,12 @@ { id value; value = [NSData dataWithBytes:data.attestationElements.data() length:data.attestationElements.size()]; - response[@"AttestationElements"] = value; + response[@"attestationElements"] = value; } { id value; value = [NSData dataWithBytes:data.signature.data() length:data.signature.size()]; - response[@"Signature"] = value; + response[@"signature"] = value; } DispatchSuccess(context, response); }; @@ -1943,7 +1943,7 @@ { id value; value = [NSData dataWithBytes:data.certificate.data() length:data.certificate.size()]; - response[@"Certificate"] = value; + response[@"certificate"] = value; } DispatchSuccess(context, response); }; @@ -1955,17 +1955,17 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.statusCode]; - response[@"StatusCode"] = value; + response[@"statusCode"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.fabricIndex]; - response[@"FabricIndex"] = value; + response[@"fabricIndex"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.debugText.data() length:data.debugText.size() encoding:NSUTF8StringEncoding]; - response[@"DebugText"] = value; + response[@"debugText"] = value; } DispatchSuccess(context, response); }; @@ -1977,12 +1977,12 @@ { id value; value = [NSData dataWithBytes:data.NOCSRElements.data() length:data.NOCSRElements.size()]; - response[@"NOCSRElements"] = value; + response[@"nocsrElements"] = value; } { id value; value = [NSData dataWithBytes:data.attestationSignature.data() length:data.attestationSignature.size()]; - response[@"AttestationSignature"] = value; + response[@"attestationSignature"] = value; } DispatchSuccess(context, response); }; @@ -1994,17 +1994,17 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.sceneId]; - response[@"SceneId"] = value; + response[@"sceneId"] = value; } DispatchSuccess(context, response); }; @@ -2016,22 +2016,22 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.capacity]; - response[@"Capacity"] = value; + response[@"capacity"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.sceneCount]; - response[@"SceneCount"] = value; + response[@"sceneCount"] = value; } { id value; @@ -2047,7 +2047,7 @@ OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"SceneList"] = value; + response[@"sceneList"] = value; } DispatchSuccess(context, response); }; @@ -2059,12 +2059,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } DispatchSuccess(context, response); }; @@ -2076,17 +2076,17 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.sceneId]; - response[@"SceneId"] = value; + response[@"sceneId"] = value; } DispatchSuccess(context, response); }; @@ -2098,17 +2098,17 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.sceneId]; - response[@"SceneId"] = value; + response[@"sceneId"] = value; } DispatchSuccess(context, response); }; @@ -2120,27 +2120,27 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.groupId]; - response[@"GroupId"] = value; + response[@"groupId"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.sceneId]; - response[@"SceneId"] = value; + response[@"sceneId"] = value; } { id value; value = [NSNumber numberWithUnsignedShort:data.transitionTime]; - response[@"TransitionTime"] = value; + response[@"transitionTime"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.sceneName.data() length:data.sceneName.size() encoding:NSUTF8StringEncoding]; - response[@"SceneName"] = value; + response[@"sceneName"] = value; } { id value; @@ -2149,16 +2149,16 @@ while (iter.Next()) { auto & entry = iter.GetValue(); auto * newElement = [[CHIPScenesClusterSceneExtensionFieldSet alloc] init]; - newElement.ClusterId = [NSNumber numberWithUnsignedInt:entry.clusterId]; - newElement.Length = [NSNumber numberWithUnsignedChar:entry.length]; - newElement.Value = [NSNumber numberWithUnsignedChar:entry.value]; + newElement.clusterId = [NSNumber numberWithUnsignedInt:entry.clusterId]; + newElement.length = [NSNumber numberWithUnsignedChar:entry.length]; + newElement.value = [NSNumber numberWithUnsignedChar:entry.value]; [value addObject:newElement]; } if (iter.GetStatus() != CHIP_NO_ERROR) { OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"ExtensionFieldSets"] = value; + response[@"extensionFieldSets"] = value; } DispatchSuccess(context, response); }; @@ -2174,15 +2174,15 @@ while (iter.Next()) { auto & entry = iter.GetValue(); auto * newElement = [[CHIPTvChannelClusterTvChannelInfo alloc] init]; - newElement.MajorNumber = [NSNumber numberWithUnsignedShort:entry.majorNumber]; - newElement.MinorNumber = [NSNumber numberWithUnsignedShort:entry.minorNumber]; - newElement.Name = [[NSString alloc] initWithBytes:entry.name.data() + newElement.majorNumber = [NSNumber numberWithUnsignedShort:entry.majorNumber]; + newElement.minorNumber = [NSNumber numberWithUnsignedShort:entry.minorNumber]; + newElement.name = [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding]; - newElement.CallSign = [[NSString alloc] initWithBytes:entry.callSign.data() + newElement.callSign = [[NSString alloc] initWithBytes:entry.callSign.data() length:entry.callSign.size() encoding:NSUTF8StringEncoding]; - newElement.AffiliateCallSign = [[NSString alloc] initWithBytes:entry.affiliateCallSign.data() + newElement.affiliateCallSign = [[NSString alloc] initWithBytes:entry.affiliateCallSign.data() length:entry.affiliateCallSign.size() encoding:NSUTF8StringEncoding]; [value addObject:newElement]; @@ -2191,12 +2191,12 @@ OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"ChannelMatch"] = value; + response[@"channelMatch"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.errorType]; - response[@"ErrorType"] = value; + response[@"errorType"] = value; } DispatchSuccess(context, response); }; @@ -2208,12 +2208,12 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.status]; - response[@"Status"] = value; + response[@"status"] = value; } { id value; value = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; - response[@"Data"] = value; + response[@"data"] = value; } DispatchSuccess(context, response); }; @@ -2225,7 +2225,7 @@ { id value; value = [NSNumber numberWithBool:data.value]; - response[@"Value"] = value; + response[@"value"] = value; } DispatchSuccess(context, response); }; @@ -2237,7 +2237,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.returnValue]; - response[@"ReturnValue"] = value; + response[@"returnValue"] = value; } DispatchSuccess(context, response); }; @@ -2249,12 +2249,12 @@ { id value; value = [NSNumber numberWithUnsignedShort:data.arg1]; - response[@"Arg1"] = value; + response[@"arg1"] = value; } { id value; value = [NSNumber numberWithUnsignedChar:data.arg2]; - response[@"Arg2"] = value; + response[@"arg2"] = value; } DispatchSuccess(context, response); }; @@ -2277,7 +2277,7 @@ OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); return; } - response[@"Arg1"] = value; + response[@"arg1"] = value; } DispatchSuccess(context, response); }; @@ -2289,7 +2289,7 @@ { id value; value = [NSNumber numberWithBool:data.wasPresent]; - response[@"WasPresent"] = value; + response[@"wasPresent"] = value; } { id value; @@ -2298,7 +2298,7 @@ } else { value = [NSNull null]; } - response[@"WasNull"] = value; + response[@"wasNull"] = value; } { id value; @@ -2307,7 +2307,7 @@ } else { value = [NSNull null]; } - response[@"Value"] = value; + response[@"value"] = value; } { id value; @@ -2320,7 +2320,7 @@ } else { value = [NSNull null]; } - response[@"OriginalValue"] = value; + response[@"originalValue"] = value; } DispatchSuccess(context, response); }; @@ -2332,7 +2332,7 @@ { id value; value = [NSNumber numberWithUnsignedChar:data.returnValue]; - response[@"ReturnValue"] = value; + response[@"returnValue"] = value; } DispatchSuccess(context, response); }; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 1193bcf416723a..bb86da4aa5cb37 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -45,7 +45,7 @@ - (void)getSetupPIN:(CHIPAccountLoginClusterGetSetupPINPayload * _Nonnull)payloa { ListFreer listFreer; AccountLogin::Commands::GetSetupPIN::Type request; - request.tempAccountIdentifier = [self asCharSpan:payload.TempAccountIdentifier]; + request.tempAccountIdentifier = [self asCharSpan:payload.tempAccountIdentifier]; new CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -59,8 +59,8 @@ - (void)login:(CHIPAccountLoginClusterLoginPayload * _Nonnull)payload responseHa { ListFreer listFreer; AccountLogin::Commands::Login::Type request; - request.tempAccountIdentifier = [self asCharSpan:payload.TempAccountIdentifier]; - request.setupPIN = [self asCharSpan:payload.SetupPIN]; + request.tempAccountIdentifier = [self asCharSpan:payload.tempAccountIdentifier]; + request.setupPIN = [self asCharSpan:payload.setupPIN]; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -90,7 +90,7 @@ - (void)openBasicCommissioningWindow:(CHIPAdministratorCommissioningClusterOpenB { ListFreer listFreer; AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type request; - request.commissioningTimeout = payload.CommissioningTimeout.unsignedShortValue; + request.commissioningTimeout = payload.commissioningTimeout.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -104,12 +104,12 @@ - (void)openCommissioningWindow:(CHIPAdministratorCommissioningClusterOpenCommis { ListFreer listFreer; AdministratorCommissioning::Commands::OpenCommissioningWindow::Type request; - request.commissioningTimeout = payload.CommissioningTimeout.unsignedShortValue; - request.PAKEVerifier = [self asByteSpan:payload.PAKEVerifier]; - request.discriminator = payload.Discriminator.unsignedShortValue; - request.iterations = payload.Iterations.unsignedIntValue; - request.salt = [self asByteSpan:payload.Salt]; - request.passcodeID = payload.PasscodeID.unsignedShortValue; + request.commissioningTimeout = payload.commissioningTimeout.unsignedShortValue; + request.PAKEVerifier = [self asByteSpan:payload.pakeVerifier]; + request.discriminator = payload.discriminator.unsignedShortValue; + request.iterations = payload.iterations.unsignedIntValue; + request.salt = [self asByteSpan:payload.salt]; + request.passcodeID = payload.passcodeID.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -152,7 +152,7 @@ - (void)changeStatus:(CHIPApplicationBasicClusterChangeStatusPayload * _Nonnull) { ListFreer listFreer; ApplicationBasic::Commands::ChangeStatus::Type request; - request.status = static_cast>(payload.Status.unsignedCharValue); + request.status = static_cast>(payload.status.unsignedCharValue); new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -231,9 +231,9 @@ - (void)launchApp:(CHIPApplicationLauncherClusterLaunchAppPayload * _Nonnull)pay { ListFreer listFreer; ApplicationLauncher::Commands::LaunchApp::Type request; - request.data = [self asCharSpan:payload.Data]; - request.catalogVendorId = payload.CatalogVendorId.unsignedShortValue; - request.applicationId = [self asCharSpan:payload.ApplicationId]; + request.data = [self asCharSpan:payload.data]; + request.catalogVendorId = payload.catalogVendorId.unsignedShortValue; + request.applicationId = [self asCharSpan:payload.applicationId]; new CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -285,8 +285,8 @@ - (void)renameOutput:(CHIPAudioOutputClusterRenameOutputPayload * _Nonnull)paylo { ListFreer listFreer; AudioOutput::Commands::RenameOutput::Type request; - request.index = payload.Index.unsignedCharValue; - request.name = [self asCharSpan:payload.Name]; + request.index = payload.index.unsignedCharValue; + request.name = [self asCharSpan:payload.name]; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -299,7 +299,7 @@ - (void)selectOutput:(CHIPAudioOutputClusterSelectOutputPayload * _Nonnull)paylo { ListFreer listFreer; AudioOutput::Commands::SelectOutput::Type request; - request.index = payload.Index.unsignedCharValue; + request.index = payload.index.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -344,7 +344,7 @@ - (void)barrierControlGoToPercent:(CHIPBarrierControlClusterBarrierControlGoToPe { ListFreer listFreer; BarrierControl::Commands::BarrierControlGoToPercent::Type request; - request.percentOpen = payload.PercentOpen.unsignedCharValue; + request.percentOpen = payload.percentOpen.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -708,10 +708,10 @@ - (void)bind:(CHIPBindingClusterBindPayload * _Nonnull)payload responseHandler:( { ListFreer listFreer; Binding::Commands::Bind::Type request; - request.nodeId = payload.NodeId.unsignedLongLongValue; - request.groupId = payload.GroupId.unsignedShortValue; - request.endpointId = payload.EndpointId.unsignedShortValue; - request.clusterId = payload.ClusterId.unsignedIntValue; + request.nodeId = payload.nodeId.unsignedLongLongValue; + request.groupId = payload.groupId.unsignedShortValue; + request.endpointId = payload.endpointId.unsignedShortValue; + request.clusterId = payload.clusterId.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -724,10 +724,10 @@ - (void)unbind:(CHIPBindingClusterUnbindPayload * _Nonnull)payload responseHandl { ListFreer listFreer; Binding::Commands::Unbind::Type request; - request.nodeId = payload.NodeId.unsignedLongLongValue; - request.groupId = payload.GroupId.unsignedShortValue; - request.endpointId = payload.EndpointId.unsignedShortValue; - request.clusterId = payload.ClusterId.unsignedIntValue; + request.nodeId = payload.nodeId.unsignedLongLongValue; + request.groupId = payload.groupId.unsignedShortValue; + request.endpointId = payload.endpointId.unsignedShortValue; + request.clusterId = payload.clusterId.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -799,10 +799,10 @@ - (void)disableAction:(CHIPBridgedActionsClusterDisableActionPayload * _Nonnull) { ListFreer listFreer; BridgedActions::Commands::DisableAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -817,12 +817,12 @@ - (void)disableActionWithDuration:(CHIPBridgedActionsClusterDisableActionWithDur { ListFreer listFreer; BridgedActions::Commands::DisableActionWithDuration::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } - request.duration = payload.Duration.unsignedIntValue; + request.duration = payload.duration.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -836,10 +836,10 @@ - (void)enableAction:(CHIPBridgedActionsClusterEnableActionPayload * _Nonnull)pa { ListFreer listFreer; BridgedActions::Commands::EnableAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -854,12 +854,12 @@ - (void)enableActionWithDuration:(CHIPBridgedActionsClusterEnableActionWithDurat { ListFreer listFreer; BridgedActions::Commands::EnableActionWithDuration::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } - request.duration = payload.Duration.unsignedIntValue; + request.duration = payload.duration.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -873,10 +873,10 @@ - (void)instantAction:(CHIPBridgedActionsClusterInstantActionPayload * _Nonnull) { ListFreer listFreer; BridgedActions::Commands::InstantAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -891,12 +891,12 @@ - (void)instantActionWithTransition:(CHIPBridgedActionsClusterInstantActionWithT { ListFreer listFreer; BridgedActions::Commands::InstantActionWithTransition::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } - request.transitionTime = payload.TransitionTime.unsignedShortValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -909,10 +909,10 @@ - (void)pauseAction:(CHIPBridgedActionsClusterPauseActionPayload * _Nonnull)payl { ListFreer listFreer; BridgedActions::Commands::PauseAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -927,12 +927,12 @@ - (void)pauseActionWithDuration:(CHIPBridgedActionsClusterPauseActionWithDuratio { ListFreer listFreer; BridgedActions::Commands::PauseActionWithDuration::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } - request.duration = payload.Duration.unsignedIntValue; + request.duration = payload.duration.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -946,10 +946,10 @@ - (void)resumeAction:(CHIPBridgedActionsClusterResumeActionPayload * _Nonnull)pa { ListFreer listFreer; BridgedActions::Commands::ResumeAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -963,10 +963,10 @@ - (void)startAction:(CHIPBridgedActionsClusterStartActionPayload * _Nonnull)payl { ListFreer listFreer; BridgedActions::Commands::StartAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -981,12 +981,12 @@ - (void)startActionWithDuration:(CHIPBridgedActionsClusterStartActionWithDuratio { ListFreer listFreer; BridgedActions::Commands::StartActionWithDuration::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } - request.duration = payload.Duration.unsignedIntValue; + request.duration = payload.duration.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -999,10 +999,10 @@ - (void)stopAction:(CHIPBridgedActionsClusterStopActionPayload * _Nonnull)payloa { ListFreer listFreer; BridgedActions::Commands::StopAction::Type request; - request.actionID = payload.ActionID.unsignedShortValue; - if (payload.InvokeID != nil) { + request.actionID = payload.actionID.unsignedShortValue; + if (payload.invokeID != nil) { auto & definedValue_0 = request.invokeID.Emplace(); - definedValue_0 = payload.InvokeID.unsignedIntValue; + definedValue_0 = payload.invokeID.unsignedIntValue; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -1183,13 +1183,13 @@ - (void)colorLoopSet:(CHIPColorControlClusterColorLoopSetPayload * _Nonnull)payl ListFreer listFreer; ColorControl::Commands::ColorLoopSet::Type request; request.updateFlags - = static_cast>(payload.UpdateFlags.unsignedCharValue); - request.action = static_cast>(payload.Action.unsignedCharValue); - request.direction = static_cast>(payload.Direction.unsignedCharValue); - request.time = payload.Time.unsignedShortValue; - request.startHue = payload.StartHue.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + = static_cast>(payload.updateFlags.unsignedCharValue); + request.action = static_cast>(payload.action.unsignedCharValue); + request.direction = static_cast>(payload.direction.unsignedCharValue); + request.time = payload.time.unsignedShortValue; + request.startHue = payload.startHue.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1203,10 +1203,10 @@ - (void)enhancedMoveHue:(CHIPColorControlClusterEnhancedMoveHuePayload * _Nonnul { ListFreer listFreer; ColorControl::Commands::EnhancedMoveHue::Type request; - request.moveMode = static_cast>(payload.MoveMode.unsignedCharValue); - request.rate = payload.Rate.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.moveMode = static_cast>(payload.moveMode.unsignedCharValue); + request.rate = payload.rate.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1220,11 +1220,11 @@ - (void)enhancedMoveToHue:(CHIPColorControlClusterEnhancedMoveToHuePayload * _No { ListFreer listFreer; ColorControl::Commands::EnhancedMoveToHue::Type request; - request.enhancedHue = payload.EnhancedHue.unsignedShortValue; - request.direction = static_cast>(payload.Direction.unsignedCharValue); - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.enhancedHue = payload.enhancedHue.unsignedShortValue; + request.direction = static_cast>(payload.direction.unsignedCharValue); + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1238,11 +1238,11 @@ - (void)enhancedMoveToHueAndSaturation:(CHIPColorControlClusterEnhancedMoveToHue { ListFreer listFreer; ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type request; - request.enhancedHue = payload.EnhancedHue.unsignedShortValue; - request.saturation = payload.Saturation.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.enhancedHue = payload.enhancedHue.unsignedShortValue; + request.saturation = payload.saturation.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1256,11 +1256,11 @@ - (void)enhancedStepHue:(CHIPColorControlClusterEnhancedStepHuePayload * _Nonnul { ListFreer listFreer; ColorControl::Commands::EnhancedStepHue::Type request; - request.stepMode = static_cast>(payload.StepMode.unsignedCharValue); - request.stepSize = payload.StepSize.unsignedShortValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.stepMode = static_cast>(payload.stepMode.unsignedCharValue); + request.stepSize = payload.stepSize.unsignedShortValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1273,10 +1273,10 @@ - (void)moveColor:(CHIPColorControlClusterMoveColorPayload * _Nonnull)payload re { ListFreer listFreer; ColorControl::Commands::MoveColor::Type request; - request.rateX = payload.RateX.shortValue; - request.rateY = payload.RateY.shortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.rateX = payload.rateX.shortValue; + request.rateY = payload.rateY.shortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1290,12 +1290,12 @@ - (void)moveColorTemperature:(CHIPColorControlClusterMoveColorTemperaturePayload { ListFreer listFreer; ColorControl::Commands::MoveColorTemperature::Type request; - request.moveMode = static_cast>(payload.MoveMode.unsignedCharValue); - request.rate = payload.Rate.unsignedShortValue; - request.colorTemperatureMinimum = payload.ColorTemperatureMinimum.unsignedShortValue; - request.colorTemperatureMaximum = payload.ColorTemperatureMaximum.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.moveMode = static_cast>(payload.moveMode.unsignedCharValue); + request.rate = payload.rate.unsignedShortValue; + request.colorTemperatureMinimum = payload.colorTemperatureMinimum.unsignedShortValue; + request.colorTemperatureMaximum = payload.colorTemperatureMaximum.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1308,10 +1308,10 @@ - (void)moveHue:(CHIPColorControlClusterMoveHuePayload * _Nonnull)payload respon { ListFreer listFreer; ColorControl::Commands::MoveHue::Type request; - request.moveMode = static_cast>(payload.MoveMode.unsignedCharValue); - request.rate = payload.Rate.unsignedCharValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.moveMode = static_cast>(payload.moveMode.unsignedCharValue); + request.rate = payload.rate.unsignedCharValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1325,10 +1325,10 @@ - (void)moveSaturation:(CHIPColorControlClusterMoveSaturationPayload * _Nonnull) { ListFreer listFreer; ColorControl::Commands::MoveSaturation::Type request; - request.moveMode = static_cast>(payload.MoveMode.unsignedCharValue); - request.rate = payload.Rate.unsignedCharValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.moveMode = static_cast>(payload.moveMode.unsignedCharValue); + request.rate = payload.rate.unsignedCharValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1341,11 +1341,11 @@ - (void)moveToColor:(CHIPColorControlClusterMoveToColorPayload * _Nonnull)payloa { ListFreer listFreer; ColorControl::Commands::MoveToColor::Type request; - request.colorX = payload.ColorX.unsignedShortValue; - request.colorY = payload.ColorY.unsignedShortValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.colorX = payload.colorX.unsignedShortValue; + request.colorY = payload.colorY.unsignedShortValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1359,10 +1359,10 @@ - (void)moveToColorTemperature:(CHIPColorControlClusterMoveToColorTemperaturePay { ListFreer listFreer; ColorControl::Commands::MoveToColorTemperature::Type request; - request.colorTemperature = payload.ColorTemperature.unsignedShortValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.colorTemperature = payload.colorTemperature.unsignedShortValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1375,11 +1375,11 @@ - (void)moveToHue:(CHIPColorControlClusterMoveToHuePayload * _Nonnull)payload re { ListFreer listFreer; ColorControl::Commands::MoveToHue::Type request; - request.hue = payload.Hue.unsignedCharValue; - request.direction = static_cast>(payload.Direction.unsignedCharValue); - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.hue = payload.hue.unsignedCharValue; + request.direction = static_cast>(payload.direction.unsignedCharValue); + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1393,11 +1393,11 @@ - (void)moveToHueAndSaturation:(CHIPColorControlClusterMoveToHueAndSaturationPay { ListFreer listFreer; ColorControl::Commands::MoveToHueAndSaturation::Type request; - request.hue = payload.Hue.unsignedCharValue; - request.saturation = payload.Saturation.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.hue = payload.hue.unsignedCharValue; + request.saturation = payload.saturation.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1411,10 +1411,10 @@ - (void)moveToSaturation:(CHIPColorControlClusterMoveToSaturationPayload * _Nonn { ListFreer listFreer; ColorControl::Commands::MoveToSaturation::Type request; - request.saturation = payload.Saturation.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.saturation = payload.saturation.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1427,11 +1427,11 @@ - (void)stepColor:(CHIPColorControlClusterStepColorPayload * _Nonnull)payload re { ListFreer listFreer; ColorControl::Commands::StepColor::Type request; - request.stepX = payload.StepX.shortValue; - request.stepY = payload.StepY.shortValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.stepX = payload.stepX.shortValue; + request.stepY = payload.stepY.shortValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1445,13 +1445,13 @@ - (void)stepColorTemperature:(CHIPColorControlClusterStepColorTemperaturePayload { ListFreer listFreer; ColorControl::Commands::StepColorTemperature::Type request; - request.stepMode = static_cast>(payload.StepMode.unsignedCharValue); - request.stepSize = payload.StepSize.unsignedShortValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.colorTemperatureMinimum = payload.ColorTemperatureMinimum.unsignedShortValue; - request.colorTemperatureMaximum = payload.ColorTemperatureMaximum.unsignedShortValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.stepMode = static_cast>(payload.stepMode.unsignedCharValue); + request.stepSize = payload.stepSize.unsignedShortValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.colorTemperatureMinimum = payload.colorTemperatureMinimum.unsignedShortValue; + request.colorTemperatureMaximum = payload.colorTemperatureMaximum.unsignedShortValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1464,11 +1464,11 @@ - (void)stepHue:(CHIPColorControlClusterStepHuePayload * _Nonnull)payload respon { ListFreer listFreer; ColorControl::Commands::StepHue::Type request; - request.stepMode = static_cast>(payload.StepMode.unsignedCharValue); - request.stepSize = payload.StepSize.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedCharValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.stepMode = static_cast>(payload.stepMode.unsignedCharValue); + request.stepSize = payload.stepSize.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedCharValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1482,11 +1482,11 @@ - (void)stepSaturation:(CHIPColorControlClusterStepSaturationPayload * _Nonnull) { ListFreer listFreer; ColorControl::Commands::StepSaturation::Type request; - request.stepMode = static_cast>(payload.StepMode.unsignedCharValue); - request.stepSize = payload.StepSize.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedCharValue; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.stepMode = static_cast>(payload.stepMode.unsignedCharValue); + request.stepSize = payload.stepSize.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedCharValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -1499,8 +1499,8 @@ - (void)stopMoveStep:(CHIPColorControlClusterStopMoveStepPayload * _Nonnull)payl { ListFreer listFreer; ColorControl::Commands::StopMoveStep::Type request; - request.optionsMask = payload.OptionsMask.unsignedCharValue; - request.optionsOverride = payload.OptionsOverride.unsignedCharValue; + request.optionsMask = payload.optionsMask.unsignedCharValue; + request.optionsOverride = payload.optionsOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -2159,8 +2159,8 @@ - (void)launchContent:(CHIPContentLauncherClusterLaunchContentPayload * _Nonnull { ListFreer listFreer; ContentLauncher::Commands::LaunchContent::Type request; - request.autoPlay = payload.AutoPlay.boolValue; - request.data = [self asCharSpan:payload.Data]; + request.autoPlay = payload.autoPlay.boolValue; + request.data = [self asCharSpan:payload.data]; new CHIPContentLauncherClusterLaunchContentResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2174,8 +2174,8 @@ - (void)launchURL:(CHIPContentLauncherClusterLaunchURLPayload * _Nonnull)payload { ListFreer listFreer; ContentLauncher::Commands::LaunchURL::Type request; - request.contentURL = [self asCharSpan:payload.ContentURL]; - request.displayString = [self asCharSpan:payload.DisplayString]; + request.contentURL = [self asCharSpan:payload.contentURL]; + request.displayString = [self asCharSpan:payload.displayString]; new CHIPContentLauncherClusterLaunchURLResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2270,10 +2270,10 @@ - (void)retrieveLogsRequest:(CHIPDiagnosticLogsClusterRetrieveLogsRequestPayload { ListFreer listFreer; DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; - request.intent = static_cast>(payload.Intent.unsignedCharValue); + request.intent = static_cast>(payload.intent.unsignedCharValue); request.requestedProtocol - = static_cast>(payload.RequestedProtocol.unsignedCharValue); - request.transferFileDesignator = [self asByteSpan:payload.TransferFileDesignator]; + = static_cast>(payload.requestedProtocol.unsignedCharValue); + request.transferFileDesignator = [self asByteSpan:payload.transferFileDesignator]; new CHIPDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2323,7 +2323,7 @@ - (void)clearHolidaySchedule:(CHIPDoorLockClusterClearHolidaySchedulePayload * _ { ListFreer listFreer; DoorLock::Commands::ClearHolidaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2337,7 +2337,7 @@ - (void)clearPin:(CHIPDoorLockClusterClearPinPayload * _Nonnull)payload response { ListFreer listFreer; DoorLock::Commands::ClearPin::Type request; - request.userId = payload.UserId.unsignedShortValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterClearPinResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2351,7 +2351,7 @@ - (void)clearRfid:(CHIPDoorLockClusterClearRfidPayload * _Nonnull)payload respon { ListFreer listFreer; DoorLock::Commands::ClearRfid::Type request; - request.userId = payload.UserId.unsignedShortValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterClearRfidResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2366,8 +2366,8 @@ - (void)clearWeekdaySchedule:(CHIPDoorLockClusterClearWeekdaySchedulePayload * _ { ListFreer listFreer; DoorLock::Commands::ClearWeekdaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.userId = payload.UserId.unsignedShortValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2382,8 +2382,8 @@ - (void)clearYeardaySchedule:(CHIPDoorLockClusterClearYeardaySchedulePayload * _ { ListFreer listFreer; DoorLock::Commands::ClearYeardaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.userId = payload.UserId.unsignedShortValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2398,7 +2398,7 @@ - (void)getHolidaySchedule:(CHIPDoorLockClusterGetHolidaySchedulePayload * _Nonn { ListFreer listFreer; DoorLock::Commands::GetHolidaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2412,7 +2412,7 @@ - (void)getLogRecord:(CHIPDoorLockClusterGetLogRecordPayload * _Nonnull)payload { ListFreer listFreer; DoorLock::Commands::GetLogRecord::Type request; - request.logIndex = payload.LogIndex.unsignedShortValue; + request.logIndex = payload.logIndex.unsignedShortValue; new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2426,7 +2426,7 @@ - (void)getPin:(CHIPDoorLockClusterGetPinPayload * _Nonnull)payload responseHand { ListFreer listFreer; DoorLock::Commands::GetPin::Type request; - request.userId = payload.UserId.unsignedShortValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterGetPinResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2440,7 +2440,7 @@ - (void)getRfid:(CHIPDoorLockClusterGetRfidPayload * _Nonnull)payload responseHa { ListFreer listFreer; DoorLock::Commands::GetRfid::Type request; - request.userId = payload.UserId.unsignedShortValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterGetRfidResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2454,7 +2454,7 @@ - (void)getUserType:(CHIPDoorLockClusterGetUserTypePayload * _Nonnull)payload re { ListFreer listFreer; DoorLock::Commands::GetUserType::Type request; - request.userId = payload.UserId.unsignedShortValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2469,8 +2469,8 @@ - (void)getWeekdaySchedule:(CHIPDoorLockClusterGetWeekdaySchedulePayload * _Nonn { ListFreer listFreer; DoorLock::Commands::GetWeekdaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.userId = payload.UserId.unsignedShortValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2485,8 +2485,8 @@ - (void)getYeardaySchedule:(CHIPDoorLockClusterGetYeardaySchedulePayload * _Nonn { ListFreer listFreer; DoorLock::Commands::GetYeardaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.userId = payload.UserId.unsignedShortValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.userId = payload.userId.unsignedShortValue; new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2500,7 +2500,7 @@ - (void)lockDoor:(CHIPDoorLockClusterLockDoorPayload * _Nonnull)payload response { ListFreer listFreer; DoorLock::Commands::LockDoor::Type request; - request.pin = [self asByteSpan:payload.Pin]; + request.pin = [self asByteSpan:payload.pin]; new CHIPDoorLockClusterLockDoorResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2515,10 +2515,10 @@ - (void)setHolidaySchedule:(CHIPDoorLockClusterSetHolidaySchedulePayload * _Nonn { ListFreer listFreer; DoorLock::Commands::SetHolidaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.localStartTime = payload.LocalStartTime.unsignedIntValue; - request.localEndTime = payload.LocalEndTime.unsignedIntValue; - request.operatingModeDuringHoliday = payload.OperatingModeDuringHoliday.unsignedCharValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.localStartTime = payload.localStartTime.unsignedIntValue; + request.localEndTime = payload.localEndTime.unsignedIntValue; + request.operatingModeDuringHoliday = payload.operatingModeDuringHoliday.unsignedCharValue; new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2532,10 +2532,10 @@ - (void)setPin:(CHIPDoorLockClusterSetPinPayload * _Nonnull)payload responseHand { ListFreer listFreer; DoorLock::Commands::SetPin::Type request; - request.userId = payload.UserId.unsignedShortValue; - request.userStatus = static_cast>(payload.UserStatus.unsignedCharValue); - request.userType = static_cast>(payload.UserType.unsignedCharValue); - request.pin = [self asByteSpan:payload.Pin]; + request.userId = payload.userId.unsignedShortValue; + request.userStatus = static_cast>(payload.userStatus.unsignedCharValue); + request.userType = static_cast>(payload.userType.unsignedCharValue); + request.pin = [self asByteSpan:payload.pin]; new CHIPDoorLockClusterSetPinResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2549,10 +2549,10 @@ - (void)setRfid:(CHIPDoorLockClusterSetRfidPayload * _Nonnull)payload responseHa { ListFreer listFreer; DoorLock::Commands::SetRfid::Type request; - request.userId = payload.UserId.unsignedShortValue; - request.userStatus = static_cast>(payload.UserStatus.unsignedCharValue); - request.userType = static_cast>(payload.UserType.unsignedCharValue); - request.id = [self asByteSpan:payload.Id]; + request.userId = payload.userId.unsignedShortValue; + request.userStatus = static_cast>(payload.userStatus.unsignedCharValue); + request.userType = static_cast>(payload.userType.unsignedCharValue); + request.id = [self asByteSpan:payload.id]; new CHIPDoorLockClusterSetRfidResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2566,8 +2566,8 @@ - (void)setUserType:(CHIPDoorLockClusterSetUserTypePayload * _Nonnull)payload re { ListFreer listFreer; DoorLock::Commands::SetUserType::Type request; - request.userId = payload.UserId.unsignedShortValue; - request.userType = static_cast>(payload.UserType.unsignedCharValue); + request.userId = payload.userId.unsignedShortValue; + request.userType = static_cast>(payload.userType.unsignedCharValue); new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2582,13 +2582,13 @@ - (void)setWeekdaySchedule:(CHIPDoorLockClusterSetWeekdaySchedulePayload * _Nonn { ListFreer listFreer; DoorLock::Commands::SetWeekdaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.userId = payload.UserId.unsignedShortValue; - request.daysMask = static_cast>(payload.DaysMask.unsignedCharValue); - request.startHour = payload.StartHour.unsignedCharValue; - request.startMinute = payload.StartMinute.unsignedCharValue; - request.endHour = payload.EndHour.unsignedCharValue; - request.endMinute = payload.EndMinute.unsignedCharValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.userId = payload.userId.unsignedShortValue; + request.daysMask = static_cast>(payload.daysMask.unsignedCharValue); + request.startHour = payload.startHour.unsignedCharValue; + request.startMinute = payload.startMinute.unsignedCharValue; + request.endHour = payload.endHour.unsignedCharValue; + request.endMinute = payload.endMinute.unsignedCharValue; new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2603,10 +2603,10 @@ - (void)setYeardaySchedule:(CHIPDoorLockClusterSetYeardaySchedulePayload * _Nonn { ListFreer listFreer; DoorLock::Commands::SetYeardaySchedule::Type request; - request.scheduleId = payload.ScheduleId.unsignedCharValue; - request.userId = payload.UserId.unsignedShortValue; - request.localStartTime = payload.LocalStartTime.unsignedIntValue; - request.localEndTime = payload.LocalEndTime.unsignedIntValue; + request.scheduleId = payload.scheduleId.unsignedCharValue; + request.userId = payload.userId.unsignedShortValue; + request.localStartTime = payload.localStartTime.unsignedIntValue; + request.localEndTime = payload.localEndTime.unsignedIntValue; new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2620,7 +2620,7 @@ - (void)unlockDoor:(CHIPDoorLockClusterUnlockDoorPayload * _Nonnull)payload resp { ListFreer listFreer; DoorLock::Commands::UnlockDoor::Type request; - request.pin = [self asByteSpan:payload.Pin]; + request.pin = [self asByteSpan:payload.pin]; new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2635,8 +2635,8 @@ - (void)unlockWithTimeout:(CHIPDoorLockClusterUnlockWithTimeoutPayload * _Nonnul { ListFreer listFreer; DoorLock::Commands::UnlockWithTimeout::Type request; - request.timeoutInSeconds = payload.TimeoutInSeconds.unsignedShortValue; - request.pin = [self asByteSpan:payload.Pin]; + request.timeoutInSeconds = payload.timeoutInSeconds.unsignedShortValue; + request.pin = [self asByteSpan:payload.pin]; new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2960,9 +2960,9 @@ - (void)armFailSafe:(CHIPGeneralCommissioningClusterArmFailSafePayload * _Nonnul { ListFreer listFreer; GeneralCommissioning::Commands::ArmFailSafe::Type request; - request.expiryLengthSeconds = payload.ExpiryLengthSeconds.unsignedShortValue; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.expiryLengthSeconds = payload.expiryLengthSeconds.unsignedShortValue; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2992,10 +2992,10 @@ - (void)setRegulatoryConfig:(CHIPGeneralCommissioningClusterSetRegulatoryConfigP { ListFreer listFreer; GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; - request.location = static_cast>(payload.Location.unsignedCharValue); - request.countryCode = [self asCharSpan:payload.CountryCode]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.location = static_cast>(payload.location.unsignedCharValue); + request.countryCode = [self asCharSpan:payload.countryCode]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -3162,8 +3162,8 @@ - (void)addGroup:(CHIPGroupsClusterAddGroupPayload * _Nonnull)payload responseHa { ListFreer listFreer; Groups::Commands::AddGroup::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.groupName = [self asCharSpan:payload.GroupName]; + request.groupId = payload.groupId.unsignedShortValue; + request.groupName = [self asCharSpan:payload.groupName]; new CHIPGroupsClusterAddGroupResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -3178,8 +3178,8 @@ - (void)addGroupIfIdentifying:(CHIPGroupsClusterAddGroupIfIdentifyingPayload * _ { ListFreer listFreer; Groups::Commands::AddGroupIfIdentifying::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.groupName = [self asCharSpan:payload.GroupName]; + request.groupId = payload.groupId.unsignedShortValue; + request.groupName = [self asCharSpan:payload.groupName]; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3193,25 +3193,25 @@ - (void)getGroupMembership:(CHIPGroupsClusterGetGroupMembershipPayload * _Nonnul { ListFreer listFreer; Groups::Commands::GetGroupMembership::Type request; - request.groupCount = payload.GroupCount.unsignedCharValue; + request.groupCount = payload.groupCount.unsignedCharValue; { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.GroupList.count != 0) { - auto * listHolder_0 = new ListHolder(payload.GroupList.count); + if (payload.groupList.count != 0) { + auto * listHolder_0 = new ListHolder(payload.groupList.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.GroupList.count; ++i) { - if (![payload.GroupList[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < payload.groupList.count; ++i) { + if (![payload.groupList[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return; } - auto element_0 = (NSNumber *) payload.GroupList[i]; + auto element_0 = (NSNumber *) payload.groupList[i]; listHolder_0->mList[i] = element_0.unsignedShortValue; } - request.groupList = ListType(listHolder_0->mList, payload.GroupList.count); + request.groupList = ListType(listHolder_0->mList, payload.groupList.count); } else { request.groupList = ListType(); } @@ -3241,7 +3241,7 @@ - (void)removeGroup:(CHIPGroupsClusterRemoveGroupPayload * _Nonnull)payload resp { ListFreer listFreer; Groups::Commands::RemoveGroup::Type request; - request.groupId = payload.GroupId.unsignedShortValue; + request.groupId = payload.groupId.unsignedShortValue; new CHIPGroupsClusterRemoveGroupResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -3255,7 +3255,7 @@ - (void)viewGroup:(CHIPGroupsClusterViewGroupPayload * _Nonnull)payload response { ListFreer listFreer; Groups::Commands::ViewGroup::Type request; - request.groupId = payload.GroupId.unsignedShortValue; + request.groupId = payload.groupId.unsignedShortValue; new CHIPGroupsClusterViewGroupResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -3292,7 +3292,7 @@ - (void)identify:(CHIPIdentifyClusterIdentifyPayload * _Nonnull)payload response { ListFreer listFreer; Identify::Commands::Identify::Type request; - request.identifyTime = payload.IdentifyTime.unsignedShortValue; + request.identifyTime = payload.identifyTime.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3319,9 +3319,9 @@ - (void)triggerEffect:(CHIPIdentifyClusterTriggerEffectPayload * _Nonnull)payloa ListFreer listFreer; Identify::Commands::TriggerEffect::Type request; request.effectIdentifier - = static_cast>(payload.EffectIdentifier.unsignedCharValue); + = static_cast>(payload.effectIdentifier.unsignedCharValue); request.effectVariant - = static_cast>(payload.EffectVariant.unsignedCharValue); + = static_cast>(payload.effectVariant.unsignedCharValue); new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3447,7 +3447,7 @@ - (void)sendKey:(CHIPKeypadInputClusterSendKeyPayload * _Nonnull)payload respons { ListFreer listFreer; KeypadInput::Commands::SendKey::Type request; - request.keyCode = static_cast>(payload.KeyCode.unsignedCharValue); + request.keyCode = static_cast>(payload.keyCode.unsignedCharValue); new CHIPKeypadInputClusterSendKeyResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -3477,10 +3477,10 @@ - (void)move:(CHIPLevelControlClusterMovePayload * _Nonnull)payload responseHand { ListFreer listFreer; LevelControl::Commands::Move::Type request; - request.moveMode = static_cast>(payload.MoveMode.unsignedCharValue); - request.rate = payload.Rate.unsignedCharValue; - request.optionMask = payload.OptionMask.unsignedCharValue; - request.optionOverride = payload.OptionOverride.unsignedCharValue; + request.moveMode = static_cast>(payload.moveMode.unsignedCharValue); + request.rate = payload.rate.unsignedCharValue; + request.optionMask = payload.optionMask.unsignedCharValue; + request.optionOverride = payload.optionOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3493,10 +3493,10 @@ - (void)moveToLevel:(CHIPLevelControlClusterMoveToLevelPayload * _Nonnull)payloa { ListFreer listFreer; LevelControl::Commands::MoveToLevel::Type request; - request.level = payload.Level.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionMask = payload.OptionMask.unsignedCharValue; - request.optionOverride = payload.OptionOverride.unsignedCharValue; + request.level = payload.level.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionMask = payload.optionMask.unsignedCharValue; + request.optionOverride = payload.optionOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3510,8 +3510,8 @@ - (void)moveToLevelWithOnOff:(CHIPLevelControlClusterMoveToLevelWithOnOffPayload { ListFreer listFreer; LevelControl::Commands::MoveToLevelWithOnOff::Type request; - request.level = payload.Level.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; + request.level = payload.level.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3525,8 +3525,8 @@ - (void)moveWithOnOff:(CHIPLevelControlClusterMoveWithOnOffPayload * _Nonnull)pa { ListFreer listFreer; LevelControl::Commands::MoveWithOnOff::Type request; - request.moveMode = static_cast>(payload.MoveMode.unsignedCharValue); - request.rate = payload.Rate.unsignedCharValue; + request.moveMode = static_cast>(payload.moveMode.unsignedCharValue); + request.rate = payload.rate.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3539,11 +3539,11 @@ - (void)step:(CHIPLevelControlClusterStepPayload * _Nonnull)payload responseHand { ListFreer listFreer; LevelControl::Commands::Step::Type request; - request.stepMode = static_cast>(payload.StepMode.unsignedCharValue); - request.stepSize = payload.StepSize.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.optionMask = payload.OptionMask.unsignedCharValue; - request.optionOverride = payload.OptionOverride.unsignedCharValue; + request.stepMode = static_cast>(payload.stepMode.unsignedCharValue); + request.stepSize = payload.stepSize.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.optionMask = payload.optionMask.unsignedCharValue; + request.optionOverride = payload.optionOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3557,9 +3557,9 @@ - (void)stepWithOnOff:(CHIPLevelControlClusterStepWithOnOffPayload * _Nonnull)pa { ListFreer listFreer; LevelControl::Commands::StepWithOnOff::Type request; - request.stepMode = static_cast>(payload.StepMode.unsignedCharValue); - request.stepSize = payload.StepSize.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; + request.stepMode = static_cast>(payload.stepMode.unsignedCharValue); + request.stepSize = payload.stepSize.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3572,8 +3572,8 @@ - (void)stop:(CHIPLevelControlClusterStopPayload * _Nonnull)payload responseHand { ListFreer listFreer; LevelControl::Commands::Stop::Type request; - request.optionMask = payload.OptionMask.unsignedCharValue; - request.optionOverride = payload.OptionOverride.unsignedCharValue; + request.optionMask = payload.optionMask.unsignedCharValue; + request.optionOverride = payload.optionOverride.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3864,8 +3864,8 @@ - (void)renameInput:(CHIPMediaInputClusterRenameInputPayload * _Nonnull)payload { ListFreer listFreer; MediaInput::Commands::RenameInput::Type request; - request.index = payload.Index.unsignedCharValue; - request.name = [self asCharSpan:payload.Name]; + request.index = payload.index.unsignedCharValue; + request.name = [self asCharSpan:payload.name]; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -3878,7 +3878,7 @@ - (void)selectInput:(CHIPMediaInputClusterSelectInputPayload * _Nonnull)payload { ListFreer listFreer; MediaInput::Commands::SelectInput::Type request; - request.index = payload.Index.unsignedCharValue; + request.index = payload.index.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4015,7 +4015,7 @@ - (void)mediaSeek:(CHIPMediaPlaybackClusterMediaSeekPayload * _Nonnull)payload r { ListFreer listFreer; MediaPlayback::Commands::MediaSeek::Type request; - request.position = payload.Position.unsignedLongLongValue; + request.position = payload.position.unsignedLongLongValue; new CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4030,7 +4030,7 @@ - (void)mediaSkipBackward:(CHIPMediaPlaybackClusterMediaSkipBackwardPayload * _N { ListFreer listFreer; MediaPlayback::Commands::MediaSkipBackward::Type request; - request.deltaPositionMilliseconds = payload.DeltaPositionMilliseconds.unsignedLongLongValue; + request.deltaPositionMilliseconds = payload.deltaPositionMilliseconds.unsignedLongLongValue; new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4045,7 +4045,7 @@ - (void)mediaSkipForward:(CHIPMediaPlaybackClusterMediaSkipForwardPayload * _Non { ListFreer listFreer; MediaPlayback::Commands::MediaSkipForward::Type request; - request.deltaPositionMilliseconds = payload.DeltaPositionMilliseconds.unsignedLongLongValue; + request.deltaPositionMilliseconds = payload.deltaPositionMilliseconds.unsignedLongLongValue; new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4158,7 +4158,7 @@ - (void)changeToMode:(CHIPModeSelectClusterChangeToModePayload * _Nonnull)payloa { ListFreer listFreer; ModeSelect::Commands::ChangeToMode::Type request; - request.newMode = payload.NewMode.unsignedCharValue; + request.newMode = payload.newMode.unsignedCharValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4256,9 +4256,9 @@ - (void)addThreadNetwork:(CHIPNetworkCommissioningClusterAddThreadNetworkPayload { ListFreer listFreer; NetworkCommissioning::Commands::AddThreadNetwork::Type request; - request.operationalDataset = [self asByteSpan:payload.OperationalDataset]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.operationalDataset = [self asByteSpan:payload.operationalDataset]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4273,10 +4273,10 @@ - (void)addWiFiNetwork:(CHIPNetworkCommissioningClusterAddWiFiNetworkPayload * _ { ListFreer listFreer; NetworkCommissioning::Commands::AddWiFiNetwork::Type request; - request.ssid = [self asByteSpan:payload.Ssid]; - request.credentials = [self asByteSpan:payload.Credentials]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.ssid = [self asByteSpan:payload.ssid]; + request.credentials = [self asByteSpan:payload.credentials]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4291,9 +4291,9 @@ - (void)disableNetwork:(CHIPNetworkCommissioningClusterDisableNetworkPayload * _ { ListFreer listFreer; NetworkCommissioning::Commands::DisableNetwork::Type request; - request.networkID = [self asByteSpan:payload.NetworkID]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.networkID = [self asByteSpan:payload.networkID]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4308,9 +4308,9 @@ - (void)enableNetwork:(CHIPNetworkCommissioningClusterEnableNetworkPayload * _No { ListFreer listFreer; NetworkCommissioning::Commands::EnableNetwork::Type request; - request.networkID = [self asByteSpan:payload.NetworkID]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.networkID = [self asByteSpan:payload.networkID]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4325,9 +4325,9 @@ - (void)removeNetwork:(CHIPNetworkCommissioningClusterRemoveNetworkPayload * _No { ListFreer listFreer; NetworkCommissioning::Commands::RemoveNetwork::Type request; - request.networkID = [self asByteSpan:payload.NetworkID]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.networkID = [self asByteSpan:payload.networkID]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4342,9 +4342,9 @@ - (void)scanNetworks:(CHIPNetworkCommissioningClusterScanNetworksPayload * _Nonn { ListFreer listFreer; NetworkCommissioning::Commands::ScanNetworks::Type request; - request.ssid = [self asByteSpan:payload.Ssid]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.ssid = [self asByteSpan:payload.ssid]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4359,9 +4359,9 @@ - (void)updateThreadNetwork:(CHIPNetworkCommissioningClusterUpdateThreadNetworkP { ListFreer listFreer; NetworkCommissioning::Commands::UpdateThreadNetwork::Type request; - request.operationalDataset = [self asByteSpan:payload.OperationalDataset]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.operationalDataset = [self asByteSpan:payload.operationalDataset]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4377,10 +4377,10 @@ - (void)updateWiFiNetwork:(CHIPNetworkCommissioningClusterUpdateWiFiNetworkPaylo { ListFreer listFreer; NetworkCommissioning::Commands::UpdateWiFiNetwork::Type request; - request.ssid = [self asByteSpan:payload.Ssid]; - request.credentials = [self asByteSpan:payload.Credentials]; - request.breadcrumb = payload.Breadcrumb.unsignedLongLongValue; - request.timeoutMs = payload.TimeoutMs.unsignedIntValue; + request.ssid = [self asByteSpan:payload.ssid]; + request.credentials = [self asByteSpan:payload.credentials]; + request.breadcrumb = payload.breadcrumb.unsignedLongLongValue; + request.timeoutMs = payload.timeoutMs.unsignedIntValue; new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4419,8 +4419,8 @@ - (void)applyUpdateRequest:(CHIPOtaSoftwareUpdateProviderClusterApplyUpdateReque { ListFreer listFreer; OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; - request.updateToken = [self asByteSpan:payload.UpdateToken]; - request.newVersion = payload.NewVersion.unsignedIntValue; + request.updateToken = [self asByteSpan:payload.updateToken]; + request.newVersion = payload.newVersion.unsignedIntValue; new CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4435,8 +4435,8 @@ - (void)notifyUpdateApplied:(CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateApp { ListFreer listFreer; OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; - request.updateToken = [self asByteSpan:payload.UpdateToken]; - request.softwareVersion = payload.SoftwareVersion.unsignedIntValue; + request.updateToken = [self asByteSpan:payload.updateToken]; + request.softwareVersion = payload.softwareVersion.unsignedIntValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4450,47 +4450,47 @@ - (void)queryImage:(CHIPOtaSoftwareUpdateProviderClusterQueryImagePayload * _Non { ListFreer listFreer; OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; - request.vendorId = static_cast>(payload.VendorId.unsignedShortValue); - request.productId = payload.ProductId.unsignedShortValue; - request.softwareVersion = payload.SoftwareVersion.unsignedIntValue; + request.vendorId = static_cast>(payload.vendorId.unsignedShortValue); + request.productId = payload.productId.unsignedShortValue; + request.softwareVersion = payload.softwareVersion.unsignedIntValue; { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.ProtocolsSupported.count != 0) { - auto * listHolder_0 = new ListHolder(payload.ProtocolsSupported.count); + if (payload.protocolsSupported.count != 0) { + auto * listHolder_0 = new ListHolder(payload.protocolsSupported.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.ProtocolsSupported.count; ++i) { - if (![payload.ProtocolsSupported[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < payload.protocolsSupported.count; ++i) { + if (![payload.protocolsSupported[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return; } - auto element_0 = (NSNumber *) payload.ProtocolsSupported[i]; + auto element_0 = (NSNumber *) payload.protocolsSupported[i]; listHolder_0->mList[i] = static_castmList[i])>>(element_0.unsignedCharValue); } - request.protocolsSupported = ListType(listHolder_0->mList, payload.ProtocolsSupported.count); + request.protocolsSupported = ListType(listHolder_0->mList, payload.protocolsSupported.count); } else { request.protocolsSupported = ListType(); } } - if (payload.HardwareVersion != nil) { + if (payload.hardwareVersion != nil) { auto & definedValue_0 = request.hardwareVersion.Emplace(); - definedValue_0 = payload.HardwareVersion.unsignedShortValue; + definedValue_0 = payload.hardwareVersion.unsignedShortValue; } - if (payload.Location != nil) { + if (payload.location != nil) { auto & definedValue_0 = request.location.Emplace(); - definedValue_0 = [self asCharSpan:payload.Location]; + definedValue_0 = [self asCharSpan:payload.location]; } - if (payload.RequestorCanConsent != nil) { + if (payload.requestorCanConsent != nil) { auto & definedValue_0 = request.requestorCanConsent.Emplace(); - definedValue_0 = payload.RequestorCanConsent.boolValue; + definedValue_0 = payload.requestorCanConsent.boolValue; } - if (payload.MetadataForProvider != nil) { + if (payload.metadataForProvider != nil) { auto & definedValue_0 = request.metadataForProvider.Emplace(); - definedValue_0 = [self asByteSpan:payload.MetadataForProvider]; + definedValue_0 = [self asByteSpan:payload.metadataForProvider]; } new CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge( @@ -4522,13 +4522,13 @@ - (void)announceOtaProvider:(CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaPro { ListFreer listFreer; OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; - request.providerLocation = payload.ProviderLocation.unsignedLongLongValue; - request.vendorId = static_cast>(payload.VendorId.unsignedShortValue); + request.providerLocation = payload.providerLocation.unsignedLongLongValue; + request.vendorId = static_cast>(payload.vendorId.unsignedShortValue); request.announcementReason - = static_cast>(payload.AnnouncementReason.unsignedCharValue); - if (payload.MetadataForNode != nil) { + = static_cast>(payload.announcementReason.unsignedCharValue); + if (payload.metadataForNode != nil) { auto & definedValue_0 = request.metadataForNode.Emplace(); - definedValue_0 = [self asByteSpan:payload.MetadataForNode]; + definedValue_0 = [self asByteSpan:payload.metadataForNode]; } new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4653,9 +4653,9 @@ - (void)offWithEffect:(CHIPOnOffClusterOffWithEffectPayload * _Nonnull)payload r { ListFreer listFreer; OnOff::Commands::OffWithEffect::Type request; - request.effectId = static_cast>(payload.EffectId.unsignedCharValue); + request.effectId = static_cast>(payload.effectId.unsignedCharValue); request.effectVariant - = static_cast>(payload.EffectVariant.unsignedCharValue); + = static_cast>(payload.effectVariant.unsignedCharValue); new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4694,9 +4694,9 @@ - (void)onWithTimedOff:(CHIPOnOffClusterOnWithTimedOffPayload * _Nonnull)payload ListFreer listFreer; OnOff::Commands::OnWithTimedOff::Type request; request.onOffControl - = static_cast>(payload.OnOffControl.unsignedCharValue); - request.onTime = payload.OnTime.unsignedShortValue; - request.offWaitTime = payload.OffWaitTime.unsignedShortValue; + = static_cast>(payload.onOffControl.unsignedCharValue); + request.onTime = payload.onTime.unsignedShortValue; + request.offWaitTime = payload.offWaitTime.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4880,14 +4880,14 @@ - (void)addNOC:(CHIPOperationalCredentialsClusterAddNOCPayload * _Nonnull)payloa { ListFreer listFreer; OperationalCredentials::Commands::AddNOC::Type request; - request.NOCValue = [self asByteSpan:payload.NOCValue]; - if (payload.ICACValue != nil) { + request.NOCValue = [self asByteSpan:payload.nocValue]; + if (payload.icacValue != nil) { auto & definedValue_0 = request.ICACValue.Emplace(); - definedValue_0 = [self asByteSpan:payload.ICACValue]; + definedValue_0 = [self asByteSpan:payload.icacValue]; } - request.IPKValue = [self asByteSpan:payload.IPKValue]; - request.caseAdminNode = payload.CaseAdminNode.unsignedLongLongValue; - request.adminVendorId = payload.AdminVendorId.unsignedShortValue; + request.IPKValue = [self asByteSpan:payload.ipkValue]; + request.caseAdminNode = payload.caseAdminNode.unsignedLongLongValue; + request.adminVendorId = payload.adminVendorId.unsignedShortValue; new CHIPOperationalCredentialsClusterNOCResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4902,7 +4902,7 @@ - (void)addTrustedRootCertificate:(CHIPOperationalCredentialsClusterAddTrustedRo { ListFreer listFreer; OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; - request.rootCertificate = [self asByteSpan:payload.RootCertificate]; + request.rootCertificate = [self asByteSpan:payload.rootCertificate]; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4916,7 +4916,7 @@ - (void)attestationRequest:(CHIPOperationalCredentialsClusterAttestationRequestP { ListFreer listFreer; OperationalCredentials::Commands::AttestationRequest::Type request; - request.attestationNonce = [self asByteSpan:payload.AttestationNonce]; + request.attestationNonce = [self asByteSpan:payload.attestationNonce]; new CHIPOperationalCredentialsClusterAttestationResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4931,7 +4931,7 @@ - (void)certificateChainRequest:(CHIPOperationalCredentialsClusterCertificateCha { ListFreer listFreer; OperationalCredentials::Commands::CertificateChainRequest::Type request; - request.certificateType = payload.CertificateType.unsignedCharValue; + request.certificateType = payload.certificateType.unsignedCharValue; new CHIPOperationalCredentialsClusterCertificateChainResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4947,7 +4947,7 @@ - (void)opCSRRequest:(CHIPOperationalCredentialsClusterOpCSRRequestPayload * _No { ListFreer listFreer; OperationalCredentials::Commands::OpCSRRequest::Type request; - request.CSRNonce = [self asByteSpan:payload.CSRNonce]; + request.CSRNonce = [self asByteSpan:payload.csrNonce]; new CHIPOperationalCredentialsClusterOpCSRResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4962,7 +4962,7 @@ - (void)removeFabric:(CHIPOperationalCredentialsClusterRemoveFabricPayload * _No { ListFreer listFreer; OperationalCredentials::Commands::RemoveFabric::Type request; - request.fabricIndex = payload.FabricIndex.unsignedCharValue; + request.fabricIndex = payload.fabricIndex.unsignedCharValue; new CHIPOperationalCredentialsClusterNOCResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4977,7 +4977,7 @@ - (void)removeTrustedRootCertificate:(CHIPOperationalCredentialsClusterRemoveTru { ListFreer listFreer; OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type request; - request.trustedRootIdentifier = [self asByteSpan:payload.TrustedRootIdentifier]; + request.trustedRootIdentifier = [self asByteSpan:payload.trustedRootIdentifier]; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -4991,7 +4991,7 @@ - (void)updateFabricLabel:(CHIPOperationalCredentialsClusterUpdateFabricLabelPay { ListFreer listFreer; OperationalCredentials::Commands::UpdateFabricLabel::Type request; - request.label = [self asCharSpan:payload.Label]; + request.label = [self asCharSpan:payload.label]; new CHIPOperationalCredentialsClusterNOCResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5006,10 +5006,10 @@ - (void)updateNOC:(CHIPOperationalCredentialsClusterUpdateNOCPayload * _Nonnull) { ListFreer listFreer; OperationalCredentials::Commands::UpdateNOC::Type request; - request.NOCValue = [self asByteSpan:payload.NOCValue]; - if (payload.ICACValue != nil) { + request.NOCValue = [self asByteSpan:payload.nocValue]; + if (payload.icacValue != nil) { auto & definedValue_0 = request.ICACValue.Emplace(); - definedValue_0 = [self asByteSpan:payload.ICACValue]; + definedValue_0 = [self asByteSpan:payload.icacValue]; } new CHIPOperationalCredentialsClusterNOCResponseCallbackBridge( @@ -5543,30 +5543,30 @@ - (void)addScene:(CHIPScenesClusterAddScenePayload * _Nonnull)payload responseHa { ListFreer listFreer; Scenes::Commands::AddScene::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.sceneId = payload.SceneId.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; - request.sceneName = [self asCharSpan:payload.SceneName]; + request.groupId = payload.groupId.unsignedShortValue; + request.sceneId = payload.sceneId.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; + request.sceneName = [self asCharSpan:payload.sceneName]; { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.ExtensionFieldSets.count != 0) { - auto * listHolder_0 = new ListHolder(payload.ExtensionFieldSets.count); + if (payload.extensionFieldSets.count != 0) { + auto * listHolder_0 = new ListHolder(payload.extensionFieldSets.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.ExtensionFieldSets.count; ++i) { - if (![payload.ExtensionFieldSets[i] isKindOfClass:[CHIPScenesClusterSceneExtensionFieldSet class]]) { + for (size_t i = 0; i < payload.extensionFieldSets.count; ++i) { + if (![payload.extensionFieldSets[i] isKindOfClass:[CHIPScenesClusterSceneExtensionFieldSet class]]) { // Wrong kind of value. return; } - auto element_0 = (CHIPScenesClusterSceneExtensionFieldSet *) payload.ExtensionFieldSets[i]; - listHolder_0->mList[i].clusterId = element_0.ClusterId.unsignedIntValue; - listHolder_0->mList[i].length = element_0.Length.unsignedCharValue; - listHolder_0->mList[i].value = element_0.Value.unsignedCharValue; + auto element_0 = (CHIPScenesClusterSceneExtensionFieldSet *) payload.extensionFieldSets[i]; + listHolder_0->mList[i].clusterId = element_0.clusterId.unsignedIntValue; + listHolder_0->mList[i].length = element_0.length.unsignedCharValue; + listHolder_0->mList[i].value = element_0.value.unsignedCharValue; } - request.extensionFieldSets = ListType(listHolder_0->mList, payload.ExtensionFieldSets.count); + request.extensionFieldSets = ListType(listHolder_0->mList, payload.extensionFieldSets.count); } else { request.extensionFieldSets = ListType(); } @@ -5585,7 +5585,7 @@ - (void)getSceneMembership:(CHIPScenesClusterGetSceneMembershipPayload * _Nonnul { ListFreer listFreer; Scenes::Commands::GetSceneMembership::Type request; - request.groupId = payload.GroupId.unsignedShortValue; + request.groupId = payload.groupId.unsignedShortValue; new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5599,9 +5599,9 @@ - (void)recallScene:(CHIPScenesClusterRecallScenePayload * _Nonnull)payload resp { ListFreer listFreer; Scenes::Commands::RecallScene::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.sceneId = payload.SceneId.unsignedCharValue; - request.transitionTime = payload.TransitionTime.unsignedShortValue; + request.groupId = payload.groupId.unsignedShortValue; + request.sceneId = payload.sceneId.unsignedCharValue; + request.transitionTime = payload.transitionTime.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -5614,7 +5614,7 @@ - (void)removeAllScenes:(CHIPScenesClusterRemoveAllScenesPayload * _Nonnull)payl { ListFreer listFreer; Scenes::Commands::RemoveAllScenes::Type request; - request.groupId = payload.GroupId.unsignedShortValue; + request.groupId = payload.groupId.unsignedShortValue; new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5628,8 +5628,8 @@ - (void)removeScene:(CHIPScenesClusterRemoveScenePayload * _Nonnull)payload resp { ListFreer listFreer; Scenes::Commands::RemoveScene::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.sceneId = payload.SceneId.unsignedCharValue; + request.groupId = payload.groupId.unsignedShortValue; + request.sceneId = payload.sceneId.unsignedCharValue; new CHIPScenesClusterRemoveSceneResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5643,8 +5643,8 @@ - (void)storeScene:(CHIPScenesClusterStoreScenePayload * _Nonnull)payload respon { ListFreer listFreer; Scenes::Commands::StoreScene::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.sceneId = payload.SceneId.unsignedCharValue; + request.groupId = payload.groupId.unsignedShortValue; + request.sceneId = payload.sceneId.unsignedCharValue; new CHIPScenesClusterStoreSceneResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5658,8 +5658,8 @@ - (void)viewScene:(CHIPScenesClusterViewScenePayload * _Nonnull)payload response { ListFreer listFreer; Scenes::Commands::ViewScene::Type request; - request.groupId = payload.GroupId.unsignedShortValue; - request.sceneId = payload.SceneId.unsignedCharValue; + request.groupId = payload.groupId.unsignedShortValue; + request.sceneId = payload.sceneId.unsignedCharValue; new CHIPScenesClusterViewSceneResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5845,7 +5845,7 @@ - (void)changeChannel:(CHIPTvChannelClusterChangeChannelPayload * _Nonnull)paylo { ListFreer listFreer; TvChannel::Commands::ChangeChannel::Type request; - request.match = [self asCharSpan:payload.Match]; + request.match = [self asCharSpan:payload.match]; new CHIPTvChannelClusterChangeChannelResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -5860,8 +5860,8 @@ - (void)changeChannelByNumber:(CHIPTvChannelClusterChangeChannelByNumberPayload { ListFreer listFreer; TvChannel::Commands::ChangeChannelByNumber::Type request; - request.majorNumber = payload.MajorNumber.unsignedShortValue; - request.minorNumber = payload.MinorNumber.unsignedShortValue; + request.majorNumber = payload.majorNumber.unsignedShortValue; + request.minorNumber = payload.minorNumber.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -5874,7 +5874,7 @@ - (void)skipChannel:(CHIPTvChannelClusterSkipChannelPayload * _Nonnull)payload r { ListFreer listFreer; TvChannel::Commands::SkipChannel::Type request; - request.count = payload.Count.unsignedShortValue; + request.count = payload.count.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -5926,8 +5926,8 @@ - (void)navigateTarget:(CHIPTargetNavigatorClusterNavigateTargetPayload * _Nonnu { ListFreer listFreer; TargetNavigator::Commands::NavigateTarget::Type request; - request.target = payload.Target.unsignedCharValue; - request.data = [self asCharSpan:payload.Data]; + request.target = payload.target.unsignedCharValue; + request.data = [self asCharSpan:payload.data]; new CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -6060,8 +6060,8 @@ - (void)testAddArguments:(CHIPTestClusterClusterTestAddArgumentsPayload * _Nonnu { ListFreer listFreer; TestCluster::Commands::TestAddArguments::Type request; - request.arg1 = payload.Arg1.unsignedCharValue; - request.arg2 = payload.Arg2.unsignedCharValue; + request.arg1 = payload.arg1.unsignedCharValue; + request.arg2 = payload.arg2.unsignedCharValue; new CHIPTestClusterClusterTestAddArgumentsResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -6076,8 +6076,8 @@ - (void)testEnumsRequest:(CHIPTestClusterClusterTestEnumsRequestPayload * _Nonnu { ListFreer listFreer; TestCluster::Commands::TestEnumsRequest::Type request; - request.arg1 = static_cast>(payload.Arg1.unsignedShortValue); - request.arg2 = static_cast>(payload.Arg2.unsignedCharValue); + request.arg1 = static_cast>(payload.arg1.unsignedShortValue); + request.arg2 = static_cast>(payload.arg2.unsignedCharValue); new CHIPTestClusterClusterTestEnumsResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -6095,21 +6095,21 @@ - (void)testListInt8UArgumentRequest:(CHIPTestClusterClusterTestListInt8UArgumen { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.Arg1.count != 0) { - auto * listHolder_0 = new ListHolder(payload.Arg1.count); + if (payload.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(payload.arg1.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.Arg1.count; ++i) { - if (![payload.Arg1[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < payload.arg1.count; ++i) { + if (![payload.arg1[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return; } - auto element_0 = (NSNumber *) payload.Arg1[i]; + auto element_0 = (NSNumber *) payload.arg1[i]; listHolder_0->mList[i] = element_0.unsignedCharValue; } - request.arg1 = ListType(listHolder_0->mList, payload.Arg1.count); + request.arg1 = ListType(listHolder_0->mList, payload.arg1.count); } else { request.arg1 = ListType(); } @@ -6131,21 +6131,21 @@ - (void)testListInt8UReverseRequest:(CHIPTestClusterClusterTestListInt8UReverseR { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.Arg1.count != 0) { - auto * listHolder_0 = new ListHolder(payload.Arg1.count); + if (payload.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(payload.arg1.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.Arg1.count; ++i) { - if (![payload.Arg1[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < payload.arg1.count; ++i) { + if (![payload.arg1[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return; } - auto element_0 = (NSNumber *) payload.Arg1[i]; + auto element_0 = (NSNumber *) payload.arg1[i]; listHolder_0->mList[i] = element_0.unsignedCharValue; } - request.arg1 = ListType(listHolder_0->mList, payload.Arg1.count); + request.arg1 = ListType(listHolder_0->mList, payload.arg1.count); } else { request.arg1 = ListType(); } @@ -6167,28 +6167,28 @@ - (void)testListStructArgumentRequest:(CHIPTestClusterClusterTestListStructArgum { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.Arg1.count != 0) { - auto * listHolder_0 = new ListHolder(payload.Arg1.count); + if (payload.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(payload.arg1.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.Arg1.count; ++i) { - if (![payload.Arg1[i] isKindOfClass:[CHIPTestClusterClusterSimpleStruct class]]) { + for (size_t i = 0; i < payload.arg1.count; ++i) { + if (![payload.arg1[i] isKindOfClass:[CHIPTestClusterClusterSimpleStruct class]]) { // Wrong kind of value. return; } - auto element_0 = (CHIPTestClusterClusterSimpleStruct *) payload.Arg1[i]; - listHolder_0->mList[i].a = element_0.A.unsignedCharValue; - listHolder_0->mList[i].b = element_0.B.boolValue; + auto element_0 = (CHIPTestClusterClusterSimpleStruct *) payload.arg1[i]; + listHolder_0->mList[i].a = element_0.a.unsignedCharValue; + listHolder_0->mList[i].b = element_0.b.boolValue; listHolder_0->mList[i].c - = static_castmList[i].c)>>(element_0.C.unsignedCharValue); - listHolder_0->mList[i].d = [self asByteSpan:element_0.D]; - listHolder_0->mList[i].e = [self asCharSpan:element_0.E]; + = static_castmList[i].c)>>(element_0.c.unsignedCharValue); + listHolder_0->mList[i].d = [self asByteSpan:element_0.d]; + listHolder_0->mList[i].e = [self asCharSpan:element_0.e]; listHolder_0->mList[i].f - = static_castmList[i].f)>>(element_0.F.unsignedCharValue); + = static_castmList[i].f)>>(element_0.f.unsignedCharValue); } - request.arg1 = ListType(listHolder_0->mList, payload.Arg1.count); + request.arg1 = ListType(listHolder_0->mList, payload.arg1.count); } else { request.arg1 = ListType(); } @@ -6220,13 +6220,13 @@ - (void)testNullableOptionalRequest:(CHIPTestClusterClusterTestNullableOptionalR { ListFreer listFreer; TestCluster::Commands::TestNullableOptionalRequest::Type request; - if (payload.Arg1 != nil) { + if (payload.arg1 != nil) { auto & definedValue_0 = request.arg1.Emplace(); - if (payload.Arg1 == nil) { + if (payload.arg1 == nil) { definedValue_0.SetNull(); } else { auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = payload.Arg1.unsignedCharValue; + nonNullValue_1 = payload.arg1.unsignedCharValue; } } @@ -6256,12 +6256,12 @@ - (void)testStructArgumentRequest:(CHIPTestClusterClusterTestStructArgumentReque { ListFreer listFreer; TestCluster::Commands::TestStructArgumentRequest::Type request; - request.arg1.a = payload.Arg1.A.unsignedCharValue; - request.arg1.b = payload.Arg1.B.boolValue; - request.arg1.c = static_cast>(payload.Arg1.C.unsignedCharValue); - request.arg1.d = [self asByteSpan:payload.Arg1.D]; - request.arg1.e = [self asCharSpan:payload.Arg1.E]; - request.arg1.f = static_cast>(payload.Arg1.F.unsignedCharValue); + request.arg1.a = payload.arg1.a.unsignedCharValue; + request.arg1.b = payload.arg1.b.boolValue; + request.arg1.c = static_cast>(payload.arg1.c.unsignedCharValue); + request.arg1.d = [self asByteSpan:payload.arg1.d]; + request.arg1.e = [self asCharSpan:payload.arg1.e]; + request.arg1.f = static_cast>(payload.arg1.f.unsignedCharValue); new CHIPTestClusterClusterBooleanResponseCallbackBridge( self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -7249,9 +7249,9 @@ - (void)getWeeklySchedule:(CHIPThermostatClusterGetWeeklySchedulePayload * _Nonn ListFreer listFreer; Thermostat::Commands::GetWeeklySchedule::Type request; request.daysToReturn - = static_cast>(payload.DaysToReturn.unsignedCharValue); + = static_cast>(payload.daysToReturn.unsignedCharValue); request.modeToReturn - = static_cast>(payload.ModeToReturn.unsignedCharValue); + = static_cast>(payload.modeToReturn.unsignedCharValue); new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -7265,29 +7265,29 @@ - (void)setWeeklySchedule:(CHIPThermostatClusterSetWeeklySchedulePayload * _Nonn { ListFreer listFreer; Thermostat::Commands::SetWeeklySchedule::Type request; - request.numberOfTransitionsForSequence = payload.NumberOfTransitionsForSequence.unsignedCharValue; + request.numberOfTransitionsForSequence = payload.numberOfTransitionsForSequence.unsignedCharValue; request.dayOfWeekForSequence = static_cast>( - payload.DayOfWeekForSequence.unsignedCharValue); + payload.dayOfWeekForSequence.unsignedCharValue); request.modeForSequence - = static_cast>(payload.ModeForSequence.unsignedCharValue); + = static_cast>(payload.modeForSequence.unsignedCharValue); { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (payload.Payload.count != 0) { - auto * listHolder_0 = new ListHolder(payload.Payload.count); + if (payload.payload.count != 0) { + auto * listHolder_0 = new ListHolder(payload.payload.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return; } listFreer.add(listHolder_0); - for (size_t i = 0; i < payload.Payload.count; ++i) { - if (![payload.Payload[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < payload.payload.count; ++i) { + if (![payload.payload[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return; } - auto element_0 = (NSNumber *) payload.Payload[i]; + auto element_0 = (NSNumber *) payload.payload[i]; listHolder_0->mList[i] = element_0.unsignedCharValue; } - request.payload = ListType(listHolder_0->mList, payload.Payload.count); + request.payload = ListType(listHolder_0->mList, payload.payload.count); } else { request.payload = ListType(); } @@ -7305,8 +7305,8 @@ - (void)setpointRaiseLower:(CHIPThermostatClusterSetpointRaiseLowerPayload * _No { ListFreer listFreer; Thermostat::Commands::SetpointRaiseLower::Type request; - request.mode = static_cast>(payload.Mode.unsignedCharValue); - request.amount = payload.Amount.charValue; + request.mode = static_cast>(payload.mode.unsignedCharValue); + request.amount = payload.amount.charValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -8306,8 +8306,8 @@ - (void)goToLiftPercentage:(CHIPWindowCoveringClusterGoToLiftPercentagePayload * { ListFreer listFreer; WindowCovering::Commands::GoToLiftPercentage::Type request; - request.liftPercentageValue = payload.LiftPercentageValue.unsignedCharValue; - request.liftPercent100thsValue = payload.LiftPercent100thsValue.unsignedShortValue; + request.liftPercentageValue = payload.liftPercentageValue.unsignedCharValue; + request.liftPercent100thsValue = payload.liftPercent100thsValue.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -8321,7 +8321,7 @@ - (void)goToLiftValue:(CHIPWindowCoveringClusterGoToLiftValuePayload * _Nonnull) { ListFreer listFreer; WindowCovering::Commands::GoToLiftValue::Type request; - request.liftValue = payload.LiftValue.unsignedShortValue; + request.liftValue = payload.liftValue.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -8335,8 +8335,8 @@ - (void)goToTiltPercentage:(CHIPWindowCoveringClusterGoToTiltPercentagePayload * { ListFreer listFreer; WindowCovering::Commands::GoToTiltPercentage::Type request; - request.tiltPercentageValue = payload.TiltPercentageValue.unsignedCharValue; - request.tiltPercent100thsValue = payload.TiltPercent100thsValue.unsignedShortValue; + request.tiltPercentageValue = payload.tiltPercentageValue.unsignedCharValue; + request.tiltPercent100thsValue = payload.tiltPercent100thsValue.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); @@ -8350,7 +8350,7 @@ - (void)goToTiltValue:(CHIPWindowCoveringClusterGoToTiltValuePayload * _Nonnull) { ListFreer listFreer; WindowCovering::Commands::GoToTiltValue::Type request; - request.tiltValue = payload.TiltValue.unsignedShortValue; + request.tiltValue = payload.tiltValue.unsignedShortValue; new CHIPCommandSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index b55ce8ec5a51de..1d467abc695b52 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -24,186 +24,186 @@ #import @interface CHIPIdentifyClusterIdentifyPayload : NSObject -@property (strong) NSNumber * _Nonnull IdentifyTime; +@property (strong, nonatomic) NSNumber * _Nonnull identifyTime; @end @interface CHIPIdentifyClusterIdentifyQueryResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Timeout; +@property (strong, nonatomic) NSNumber * _Nonnull timeout; @end @interface CHIPIdentifyClusterIdentifyQueryPayload : NSObject @end @interface CHIPIdentifyClusterTriggerEffectPayload : NSObject -@property (strong) NSNumber * _Nonnull EffectIdentifier; -@property (strong) NSNumber * _Nonnull EffectVariant; +@property (strong, nonatomic) NSNumber * _Nonnull effectIdentifier; +@property (strong, nonatomic) NSNumber * _Nonnull effectVariant; @end @interface CHIPGroupsClusterAddGroupPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSString * _Nonnull GroupName; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSString * _Nonnull groupName; @end @interface CHIPGroupsClusterAddGroupResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPGroupsClusterViewGroupPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPGroupsClusterViewGroupResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSString * _Nonnull GroupName; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSString * _Nonnull groupName; @end @interface CHIPGroupsClusterGetGroupMembershipPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupCount; -@property (strong) NSArray * _Nonnull GroupList; +@property (strong, nonatomic) NSNumber * _Nonnull groupCount; +@property (strong, nonatomic) NSArray * _Nonnull groupList; @end @interface CHIPGroupsClusterGetGroupMembershipResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Capacity; -@property (strong) NSNumber * _Nonnull GroupCount; -@property (strong) NSArray * _Nonnull GroupList; +@property (strong, nonatomic) NSNumber * _Nonnull capacity; +@property (strong, nonatomic) NSNumber * _Nonnull groupCount; +@property (strong, nonatomic) NSArray * _Nonnull groupList; @end @interface CHIPGroupsClusterRemoveGroupPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPGroupsClusterRemoveGroupResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPGroupsClusterRemoveAllGroupsPayload : NSObject @end @interface CHIPGroupsClusterAddGroupIfIdentifyingPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSString * _Nonnull GroupName; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSString * _Nonnull groupName; @end @interface CHIPScenesClusterAddScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSString * _Nonnull SceneName; -@property (strong) NSArray * _Nonnull ExtensionFieldSets; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSString * _Nonnull sceneName; +@property (strong, nonatomic) NSArray * _Nonnull extensionFieldSets; @end @interface CHIPScenesClusterAddSceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterViewScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterViewSceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSString * _Nonnull SceneName; -@property (strong) NSArray * _Nonnull ExtensionFieldSets; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSString * _Nonnull sceneName; +@property (strong, nonatomic) NSArray * _Nonnull extensionFieldSets; @end @interface CHIPScenesClusterRemoveScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterRemoveSceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterRemoveAllScenesPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPScenesClusterRemoveAllScenesResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPScenesClusterStoreScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterStoreSceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterRecallScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; -@property (strong) NSNumber * _Nonnull TransitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; @end @interface CHIPScenesClusterGetSceneMembershipPayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; @end @interface CHIPScenesClusterGetSceneMembershipResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull Capacity; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneCount; -@property (strong) NSArray * _Nonnull SceneList; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull capacity; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneCount; +@property (strong, nonatomic) NSArray * _Nonnull sceneList; @end @interface CHIPScenesClusterEnhancedAddScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSString * _Nonnull SceneName; -@property (strong) NSArray * _Nonnull ExtensionFieldSets; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSString * _Nonnull sceneName; +@property (strong, nonatomic) NSArray * _Nonnull extensionFieldSets; @end @interface CHIPScenesClusterEnhancedAddSceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterEnhancedViewScenePayload : NSObject -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; @end @interface CHIPScenesClusterEnhancedViewSceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull SceneId; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSString * _Nonnull SceneName; -@property (strong) NSArray * _Nonnull ExtensionFieldSets; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull sceneId; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSString * _Nonnull sceneName; +@property (strong, nonatomic) NSArray * _Nonnull extensionFieldSets; @end @interface CHIPScenesClusterCopyScenePayload : NSObject -@property (strong) NSNumber * _Nonnull Mode; -@property (strong) NSNumber * _Nonnull GroupIdFrom; -@property (strong) NSNumber * _Nonnull SceneIdFrom; -@property (strong) NSNumber * _Nonnull GroupIdTo; -@property (strong) NSNumber * _Nonnull SceneIdTo; +@property (strong, nonatomic) NSNumber * _Nonnull mode; +@property (strong, nonatomic) NSNumber * _Nonnull groupIdFrom; +@property (strong, nonatomic) NSNumber * _Nonnull sceneIdFrom; +@property (strong, nonatomic) NSNumber * _Nonnull groupIdTo; +@property (strong, nonatomic) NSNumber * _Nonnull sceneIdTo; @end @interface CHIPScenesClusterCopySceneResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull GroupIdFrom; -@property (strong) NSNumber * _Nonnull SceneIdFrom; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull groupIdFrom; +@property (strong, nonatomic) NSNumber * _Nonnull sceneIdFrom; @end @interface CHIPOnOffClusterOffPayload : NSObject @@ -231,83 +231,83 @@ @end @interface CHIPOnOffClusterOffWithEffectPayload : NSObject -@property (strong) NSNumber * _Nonnull EffectId; -@property (strong) NSNumber * _Nonnull EffectVariant; +@property (strong, nonatomic) NSNumber * _Nonnull effectId; +@property (strong, nonatomic) NSNumber * _Nonnull effectVariant; @end @interface CHIPOnOffClusterOnWithRecallGlobalScenePayload : NSObject @end @interface CHIPOnOffClusterOnWithTimedOffPayload : NSObject -@property (strong) NSNumber * _Nonnull OnOffControl; -@property (strong) NSNumber * _Nonnull OnTime; -@property (strong) NSNumber * _Nonnull OffWaitTime; +@property (strong, nonatomic) NSNumber * _Nonnull onOffControl; +@property (strong, nonatomic) NSNumber * _Nonnull onTime; +@property (strong, nonatomic) NSNumber * _Nonnull offWaitTime; @end @interface CHIPLevelControlClusterMoveToLevelPayload : NSObject -@property (strong) NSNumber * _Nonnull Level; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionMask; -@property (strong) NSNumber * _Nonnull OptionOverride; +@property (strong, nonatomic) NSNumber * _Nonnull level; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionOverride; @end @interface CHIPLevelControlClusterMovePayload : NSObject -@property (strong) NSNumber * _Nonnull MoveMode; -@property (strong) NSNumber * _Nonnull Rate; -@property (strong) NSNumber * _Nonnull OptionMask; -@property (strong) NSNumber * _Nonnull OptionOverride; +@property (strong, nonatomic) NSNumber * _Nonnull moveMode; +@property (strong, nonatomic) NSNumber * _Nonnull rate; +@property (strong, nonatomic) NSNumber * _Nonnull optionMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionOverride; @end @interface CHIPLevelControlClusterStepPayload : NSObject -@property (strong) NSNumber * _Nonnull StepMode; -@property (strong) NSNumber * _Nonnull StepSize; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionMask; -@property (strong) NSNumber * _Nonnull OptionOverride; +@property (strong, nonatomic) NSNumber * _Nonnull stepMode; +@property (strong, nonatomic) NSNumber * _Nonnull stepSize; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionOverride; @end @interface CHIPLevelControlClusterStopPayload : NSObject -@property (strong) NSNumber * _Nonnull OptionMask; -@property (strong) NSNumber * _Nonnull OptionOverride; +@property (strong, nonatomic) NSNumber * _Nonnull optionMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionOverride; @end @interface CHIPLevelControlClusterMoveToLevelWithOnOffPayload : NSObject -@property (strong) NSNumber * _Nonnull Level; -@property (strong) NSNumber * _Nonnull TransitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull level; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; @end @interface CHIPLevelControlClusterMoveWithOnOffPayload : NSObject -@property (strong) NSNumber * _Nonnull MoveMode; -@property (strong) NSNumber * _Nonnull Rate; +@property (strong, nonatomic) NSNumber * _Nonnull moveMode; +@property (strong, nonatomic) NSNumber * _Nonnull rate; @end @interface CHIPLevelControlClusterStepWithOnOffPayload : NSObject -@property (strong) NSNumber * _Nonnull StepMode; -@property (strong) NSNumber * _Nonnull StepSize; -@property (strong) NSNumber * _Nonnull TransitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull stepMode; +@property (strong, nonatomic) NSNumber * _Nonnull stepSize; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; @end @interface CHIPLevelControlClusterStopWithOnOffPayload : NSObject @end @interface CHIPAlarmsClusterResetAlarmPayload : NSObject -@property (strong) NSNumber * _Nonnull AlarmCode; -@property (strong) NSNumber * _Nonnull ClusterId; +@property (strong, nonatomic) NSNumber * _Nonnull alarmCode; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; @end @interface CHIPAlarmsClusterAlarmPayload : NSObject -@property (strong) NSNumber * _Nonnull AlarmCode; -@property (strong) NSNumber * _Nonnull ClusterId; +@property (strong, nonatomic) NSNumber * _Nonnull alarmCode; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; @end @interface CHIPAlarmsClusterResetAllAlarmsPayload : NSObject @end @interface CHIPAlarmsClusterGetAlarmResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull AlarmCode; -@property (strong) NSNumber * _Nonnull ClusterId; -@property (strong) NSNumber * _Nonnull TimeStamp; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull alarmCode; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; +@property (strong, nonatomic) NSNumber * _Nonnull timeStamp; @end @interface CHIPAlarmsClusterGetAlarmPayload : NSObject @@ -317,140 +317,140 @@ @end @interface CHIPPowerProfileClusterPowerProfileRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; @end @interface CHIPPowerProfileClusterPowerProfileNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull TotalProfileNum; -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull NumOfTransferredPhases; -@property (strong) NSArray * _Nonnull TransferredPhases; +@property (strong, nonatomic) NSNumber * _Nonnull totalProfileNum; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull numOfTransferredPhases; +@property (strong, nonatomic) NSArray * _Nonnull transferredPhases; @end @interface CHIPPowerProfileClusterPowerProfileStateRequestPayload : NSObject @end @interface CHIPPowerProfileClusterPowerProfileResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull TotalProfileNum; -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull NumOfTransferredPhases; -@property (strong) NSArray * _Nonnull TransferredPhases; +@property (strong, nonatomic) NSNumber * _Nonnull totalProfileNum; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull numOfTransferredPhases; +@property (strong, nonatomic) NSArray * _Nonnull transferredPhases; @end @interface CHIPPowerProfileClusterGetPowerProfilePriceResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull Currency; -@property (strong) NSNumber * _Nonnull Price; -@property (strong) NSNumber * _Nonnull PriceTrailingDigit; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull currency; +@property (strong, nonatomic) NSNumber * _Nonnull price; +@property (strong, nonatomic) NSNumber * _Nonnull priceTrailingDigit; @end @interface CHIPPowerProfileClusterPowerProfileStateResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileCount; -@property (strong) NSArray * _Nonnull PowerProfileRecords; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileCount; +@property (strong, nonatomic) NSArray * _Nonnull powerProfileRecords; @end @interface CHIPPowerProfileClusterGetOverallSchedulePriceResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Currency; -@property (strong) NSNumber * _Nonnull Price; -@property (strong) NSNumber * _Nonnull PriceTrailingDigit; +@property (strong, nonatomic) NSNumber * _Nonnull currency; +@property (strong, nonatomic) NSNumber * _Nonnull price; +@property (strong, nonatomic) NSNumber * _Nonnull priceTrailingDigit; @end @interface CHIPPowerProfileClusterGetPowerProfilePricePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; @end @interface CHIPPowerProfileClusterEnergyPhasesScheduleNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull NumOfScheduledPhases; -@property (strong) NSArray * _Nonnull ScheduledPhases; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull numOfScheduledPhases; +@property (strong, nonatomic) NSArray * _Nonnull scheduledPhases; @end @interface CHIPPowerProfileClusterPowerProfilesStateNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileCount; -@property (strong) NSArray * _Nonnull PowerProfileRecords; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileCount; +@property (strong, nonatomic) NSArray * _Nonnull powerProfileRecords; @end @interface CHIPPowerProfileClusterEnergyPhasesScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull NumOfScheduledPhases; -@property (strong) NSArray * _Nonnull ScheduledPhases; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull numOfScheduledPhases; +@property (strong, nonatomic) NSArray * _Nonnull scheduledPhases; @end @interface CHIPPowerProfileClusterGetOverallSchedulePricePayload : NSObject @end @interface CHIPPowerProfileClusterPowerProfileScheduleConstraintsRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; @end @interface CHIPPowerProfileClusterEnergyPhasesScheduleRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; @end @interface CHIPPowerProfileClusterEnergyPhasesScheduleStateRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; @end @interface CHIPPowerProfileClusterEnergyPhasesScheduleStateResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull NumOfScheduledPhases; -@property (strong) NSArray * _Nonnull ScheduledPhases; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull numOfScheduledPhases; +@property (strong, nonatomic) NSArray * _Nonnull scheduledPhases; @end @interface CHIPPowerProfileClusterGetPowerProfilePriceExtendedResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull Currency; -@property (strong) NSNumber * _Nonnull Price; -@property (strong) NSNumber * _Nonnull PriceTrailingDigit; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull currency; +@property (strong, nonatomic) NSNumber * _Nonnull price; +@property (strong, nonatomic) NSNumber * _Nonnull priceTrailingDigit; @end @interface CHIPPowerProfileClusterEnergyPhasesScheduleStateNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull NumOfScheduledPhases; -@property (strong) NSArray * _Nonnull ScheduledPhases; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull numOfScheduledPhases; +@property (strong, nonatomic) NSArray * _Nonnull scheduledPhases; @end @interface CHIPPowerProfileClusterPowerProfileScheduleConstraintsNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull StartAfter; -@property (strong) NSNumber * _Nonnull StopBefore; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull startAfter; +@property (strong, nonatomic) NSNumber * _Nonnull stopBefore; @end @interface CHIPPowerProfileClusterPowerProfileScheduleConstraintsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull StartAfter; -@property (strong) NSNumber * _Nonnull StopBefore; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull startAfter; +@property (strong, nonatomic) NSNumber * _Nonnull stopBefore; @end @interface CHIPPowerProfileClusterGetPowerProfilePriceExtendedPayload : NSObject -@property (strong) NSNumber * _Nonnull Options; -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull PowerProfileStartTime; +@property (strong, nonatomic) NSNumber * _Nonnull options; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileStartTime; @end @interface CHIPApplianceControlClusterExecutionOfACommandPayload : NSObject -@property (strong) NSNumber * _Nonnull CommandId; +@property (strong, nonatomic) NSNumber * _Nonnull commandId; @end @interface CHIPApplianceControlClusterSignalStateResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ApplianceStatus; -@property (strong) NSNumber * _Nonnull RemoteEnableFlagsAndDeviceStatus2; -@property (strong) NSNumber * _Nonnull ApplianceStatus2; +@property (strong, nonatomic) NSNumber * _Nonnull applianceStatus; +@property (strong, nonatomic) NSNumber * _Nonnull remoteEnableFlagsAndDeviceStatus2; +@property (strong, nonatomic) NSNumber * _Nonnull applianceStatus2; @end @interface CHIPApplianceControlClusterSignalStatePayload : NSObject @end @interface CHIPApplianceControlClusterSignalStateNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull ApplianceStatus; -@property (strong) NSNumber * _Nonnull RemoteEnableFlagsAndDeviceStatus2; -@property (strong) NSNumber * _Nonnull ApplianceStatus2; +@property (strong, nonatomic) NSNumber * _Nonnull applianceStatus; +@property (strong, nonatomic) NSNumber * _Nonnull remoteEnableFlagsAndDeviceStatus2; +@property (strong, nonatomic) NSNumber * _Nonnull applianceStatus2; @end @interface CHIPApplianceControlClusterWriteFunctionsPayload : NSObject -@property (strong) NSNumber * _Nonnull FunctionId; -@property (strong) NSNumber * _Nonnull FunctionDataType; -@property (strong) NSArray * _Nonnull FunctionData; +@property (strong, nonatomic) NSNumber * _Nonnull functionId; +@property (strong, nonatomic) NSNumber * _Nonnull functionDataType; +@property (strong, nonatomic) NSArray * _Nonnull functionData; @end @interface CHIPApplianceControlClusterOverloadPauseResumePayload : NSObject @@ -460,91 +460,91 @@ @end @interface CHIPApplianceControlClusterOverloadWarningPayload : NSObject -@property (strong) NSNumber * _Nonnull WarningEvent; +@property (strong, nonatomic) NSNumber * _Nonnull warningEvent; @end @interface CHIPPollControlClusterCheckInPayload : NSObject @end @interface CHIPPollControlClusterCheckInResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull StartFastPolling; -@property (strong) NSNumber * _Nonnull FastPollTimeout; +@property (strong, nonatomic) NSNumber * _Nonnull startFastPolling; +@property (strong, nonatomic) NSNumber * _Nonnull fastPollTimeout; @end @interface CHIPPollControlClusterFastPollStopPayload : NSObject @end @interface CHIPPollControlClusterSetLongPollIntervalPayload : NSObject -@property (strong) NSNumber * _Nonnull NewLongPollInterval; +@property (strong, nonatomic, getter=getNewLongPollInterval) NSNumber * _Nonnull newLongPollInterval; @end @interface CHIPPollControlClusterSetShortPollIntervalPayload : NSObject -@property (strong) NSNumber * _Nonnull NewShortPollInterval; +@property (strong, nonatomic, getter=getNewShortPollInterval) NSNumber * _Nonnull newShortPollInterval; @end @interface CHIPBridgedActionsClusterInstantActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterInstantActionWithTransitionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; -@property (strong) NSNumber * _Nonnull TransitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; @end @interface CHIPBridgedActionsClusterStartActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterStartActionWithDurationPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; -@property (strong) NSNumber * _Nonnull Duration; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; +@property (strong, nonatomic) NSNumber * _Nonnull duration; @end @interface CHIPBridgedActionsClusterStopActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterPauseActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterPauseActionWithDurationPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; -@property (strong) NSNumber * _Nonnull Duration; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; +@property (strong, nonatomic) NSNumber * _Nonnull duration; @end @interface CHIPBridgedActionsClusterResumeActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterEnableActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterEnableActionWithDurationPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; -@property (strong) NSNumber * _Nonnull Duration; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; +@property (strong, nonatomic) NSNumber * _Nonnull duration; @end @interface CHIPBridgedActionsClusterDisableActionPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; @end @interface CHIPBridgedActionsClusterDisableActionWithDurationPayload : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSNumber * _Nullable InvokeID; -@property (strong) NSNumber * _Nonnull Duration; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSNumber * _Nullable invokeID; +@property (strong, nonatomic) NSNumber * _Nonnull duration; @end @interface CHIPBasicClusterStartUpPayload : NSObject @@ -560,183 +560,183 @@ @end @interface CHIPOtaSoftwareUpdateProviderClusterQueryImagePayload : NSObject -@property (strong) NSNumber * _Nonnull VendorId; -@property (strong) NSNumber * _Nonnull ProductId; -@property (strong) NSNumber * _Nonnull SoftwareVersion; -@property (strong) NSArray * _Nonnull ProtocolsSupported; -@property (strong) NSNumber * _Nullable HardwareVersion; -@property (strong) NSString * _Nullable Location; -@property (strong) NSNumber * _Nullable RequestorCanConsent; -@property (strong) NSData * _Nullable MetadataForProvider; +@property (strong, nonatomic) NSNumber * _Nonnull vendorId; +@property (strong, nonatomic) NSNumber * _Nonnull productId; +@property (strong, nonatomic) NSNumber * _Nonnull softwareVersion; +@property (strong, nonatomic) NSArray * _Nonnull protocolsSupported; +@property (strong, nonatomic) NSNumber * _Nullable hardwareVersion; +@property (strong, nonatomic) NSString * _Nullable location; +@property (strong, nonatomic) NSNumber * _Nullable requestorCanConsent; +@property (strong, nonatomic) NSData * _Nullable metadataForProvider; @end @interface CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestPayload : NSObject -@property (strong) NSData * _Nonnull UpdateToken; -@property (strong) NSNumber * _Nonnull NewVersion; +@property (strong, nonatomic) NSData * _Nonnull updateToken; +@property (strong, nonatomic, getter=getNewVersion) NSNumber * _Nonnull newVersion; @end @interface CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedPayload : NSObject -@property (strong) NSData * _Nonnull UpdateToken; -@property (strong) NSNumber * _Nonnull SoftwareVersion; +@property (strong, nonatomic) NSData * _Nonnull updateToken; +@property (strong, nonatomic) NSNumber * _Nonnull softwareVersion; @end @interface CHIPOtaSoftwareUpdateProviderClusterQueryImageResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nullable DelayedActionTime; -@property (strong) NSString * _Nullable ImageURI; -@property (strong) NSNumber * _Nullable SoftwareVersion; -@property (strong) NSString * _Nullable SoftwareVersionString; -@property (strong) NSData * _Nullable UpdateToken; -@property (strong) NSNumber * _Nullable UserConsentNeeded; -@property (strong) NSData * _Nullable MetadataForRequestor; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nullable delayedActionTime; +@property (strong, nonatomic) NSString * _Nullable imageURI; +@property (strong, nonatomic) NSNumber * _Nullable softwareVersion; +@property (strong, nonatomic) NSString * _Nullable softwareVersionString; +@property (strong, nonatomic) NSData * _Nullable updateToken; +@property (strong, nonatomic) NSNumber * _Nullable userConsentNeeded; +@property (strong, nonatomic) NSData * _Nullable metadataForRequestor; @end @interface CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Action; -@property (strong) NSNumber * _Nonnull DelayedActionTime; +@property (strong, nonatomic) NSNumber * _Nonnull action; +@property (strong, nonatomic) NSNumber * _Nonnull delayedActionTime; @end @interface CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderPayload : NSObject -@property (strong) NSNumber * _Nonnull ProviderLocation; -@property (strong) NSNumber * _Nonnull VendorId; -@property (strong) NSNumber * _Nonnull AnnouncementReason; -@property (strong) NSData * _Nullable MetadataForNode; +@property (strong, nonatomic) NSNumber * _Nonnull providerLocation; +@property (strong, nonatomic) NSNumber * _Nonnull vendorId; +@property (strong, nonatomic) NSNumber * _Nonnull announcementReason; +@property (strong, nonatomic) NSData * _Nullable metadataForNode; @end @interface CHIPGeneralCommissioningClusterArmFailSafePayload : NSObject -@property (strong) NSNumber * _Nonnull ExpiryLengthSeconds; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSNumber * _Nonnull expiryLengthSeconds; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPGeneralCommissioningClusterArmFailSafeResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPGeneralCommissioningClusterSetRegulatoryConfigPayload : NSObject -@property (strong) NSNumber * _Nonnull Location; -@property (strong) NSString * _Nonnull CountryCode; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSNumber * _Nonnull location; +@property (strong, nonatomic) NSString * _Nonnull countryCode; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPGeneralCommissioningClusterSetRegulatoryConfigResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPGeneralCommissioningClusterCommissioningCompletePayload : NSObject @end @interface CHIPGeneralCommissioningClusterCommissioningCompleteResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterScanNetworksPayload : NSObject -@property (strong) NSData * _Nonnull Ssid; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull ssid; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterScanNetworksResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; -@property (strong) NSArray * _Nonnull WifiScanResults; -@property (strong) NSArray * _Nonnull ThreadScanResults; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; +@property (strong, nonatomic) NSArray * _Nonnull wifiScanResults; +@property (strong, nonatomic) NSArray * _Nonnull threadScanResults; @end @interface CHIPNetworkCommissioningClusterAddWiFiNetworkPayload : NSObject -@property (strong) NSData * _Nonnull Ssid; -@property (strong) NSData * _Nonnull Credentials; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull ssid; +@property (strong, nonatomic) NSData * _Nonnull credentials; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterAddWiFiNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterUpdateWiFiNetworkPayload : NSObject -@property (strong) NSData * _Nonnull Ssid; -@property (strong) NSData * _Nonnull Credentials; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull ssid; +@property (strong, nonatomic) NSData * _Nonnull credentials; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterAddThreadNetworkPayload : NSObject -@property (strong) NSData * _Nonnull OperationalDataset; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull operationalDataset; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterAddThreadNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterUpdateThreadNetworkPayload : NSObject -@property (strong) NSData * _Nonnull OperationalDataset; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull operationalDataset; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterUpdateThreadNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterRemoveNetworkPayload : NSObject -@property (strong) NSData * _Nonnull NetworkID; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull networkID; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterRemoveNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterEnableNetworkPayload : NSObject -@property (strong) NSData * _Nonnull NetworkID; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull networkID; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterEnableNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPNetworkCommissioningClusterDisableNetworkPayload : NSObject -@property (strong) NSData * _Nonnull NetworkID; -@property (strong) NSNumber * _Nonnull Breadcrumb; -@property (strong) NSNumber * _Nonnull TimeoutMs; +@property (strong, nonatomic) NSData * _Nonnull networkID; +@property (strong, nonatomic) NSNumber * _Nonnull breadcrumb; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutMs; @end @interface CHIPNetworkCommissioningClusterDisableNetworkResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ErrorCode; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull errorCode; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPDiagnosticLogsClusterRetrieveLogsRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull Intent; -@property (strong) NSNumber * _Nonnull RequestedProtocol; -@property (strong) NSData * _Nonnull TransferFileDesignator; +@property (strong, nonatomic) NSNumber * _Nonnull intent; +@property (strong, nonatomic) NSNumber * _Nonnull requestedProtocol; +@property (strong, nonatomic) NSData * _Nonnull transferFileDesignator; @end @interface CHIPDiagnosticLogsClusterRetrieveLogsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSData * _Nonnull Content; -@property (strong) NSNumber * _Nonnull TimeStamp; -@property (strong) NSNumber * _Nonnull TimeSinceBoot; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSData * _Nonnull content; +@property (strong, nonatomic) NSNumber * _Nonnull timeStamp; +@property (strong, nonatomic) NSNumber * _Nonnull timeSinceBoot; @end @interface CHIPSoftwareDiagnosticsClusterResetWatermarksPayload : NSObject @@ -764,364 +764,364 @@ @end @interface CHIPAdministratorCommissioningClusterOpenCommissioningWindowPayload : NSObject -@property (strong) NSNumber * _Nonnull CommissioningTimeout; -@property (strong) NSData * _Nonnull PAKEVerifier; -@property (strong) NSNumber * _Nonnull Discriminator; -@property (strong) NSNumber * _Nonnull Iterations; -@property (strong) NSData * _Nonnull Salt; -@property (strong) NSNumber * _Nonnull PasscodeID; +@property (strong, nonatomic) NSNumber * _Nonnull commissioningTimeout; +@property (strong, nonatomic) NSData * _Nonnull pakeVerifier; +@property (strong, nonatomic) NSNumber * _Nonnull discriminator; +@property (strong, nonatomic) NSNumber * _Nonnull iterations; +@property (strong, nonatomic) NSData * _Nonnull salt; +@property (strong, nonatomic) NSNumber * _Nonnull passcodeID; @end @interface CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowPayload : NSObject -@property (strong) NSNumber * _Nonnull CommissioningTimeout; +@property (strong, nonatomic) NSNumber * _Nonnull commissioningTimeout; @end @interface CHIPAdministratorCommissioningClusterRevokeCommissioningPayload : NSObject @end @interface CHIPOperationalCredentialsClusterAttestationRequestPayload : NSObject -@property (strong) NSData * _Nonnull AttestationNonce; +@property (strong, nonatomic) NSData * _Nonnull attestationNonce; @end @interface CHIPOperationalCredentialsClusterAttestationResponsePayload : NSObject -@property (strong) NSData * _Nonnull AttestationElements; -@property (strong) NSData * _Nonnull Signature; +@property (strong, nonatomic) NSData * _Nonnull attestationElements; +@property (strong, nonatomic) NSData * _Nonnull signature; @end @interface CHIPOperationalCredentialsClusterCertificateChainRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull CertificateType; +@property (strong, nonatomic) NSNumber * _Nonnull certificateType; @end @interface CHIPOperationalCredentialsClusterCertificateChainResponsePayload : NSObject -@property (strong) NSData * _Nonnull Certificate; +@property (strong, nonatomic) NSData * _Nonnull certificate; @end @interface CHIPOperationalCredentialsClusterOpCSRRequestPayload : NSObject -@property (strong) NSData * _Nonnull CSRNonce; +@property (strong, nonatomic) NSData * _Nonnull csrNonce; @end @interface CHIPOperationalCredentialsClusterOpCSRResponsePayload : NSObject -@property (strong) NSData * _Nonnull NOCSRElements; -@property (strong) NSData * _Nonnull AttestationSignature; +@property (strong, nonatomic) NSData * _Nonnull nocsrElements; +@property (strong, nonatomic) NSData * _Nonnull attestationSignature; @end @interface CHIPOperationalCredentialsClusterAddNOCPayload : NSObject -@property (strong) NSData * _Nonnull NOCValue; -@property (strong) NSData * _Nullable ICACValue; -@property (strong) NSData * _Nonnull IPKValue; -@property (strong) NSNumber * _Nonnull CaseAdminNode; -@property (strong) NSNumber * _Nonnull AdminVendorId; +@property (strong, nonatomic) NSData * _Nonnull nocValue; +@property (strong, nonatomic) NSData * _Nullable icacValue; +@property (strong, nonatomic) NSData * _Nonnull ipkValue; +@property (strong, nonatomic) NSNumber * _Nonnull caseAdminNode; +@property (strong, nonatomic) NSNumber * _Nonnull adminVendorId; @end @interface CHIPOperationalCredentialsClusterUpdateNOCPayload : NSObject -@property (strong) NSData * _Nonnull NOCValue; -@property (strong) NSData * _Nullable ICACValue; +@property (strong, nonatomic) NSData * _Nonnull nocValue; +@property (strong, nonatomic) NSData * _Nullable icacValue; @end @interface CHIPOperationalCredentialsClusterNOCResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull StatusCode; -@property (strong) NSNumber * _Nonnull FabricIndex; -@property (strong) NSString * _Nonnull DebugText; +@property (strong, nonatomic) NSNumber * _Nonnull statusCode; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSString * _Nonnull debugText; @end @interface CHIPOperationalCredentialsClusterUpdateFabricLabelPayload : NSObject -@property (strong) NSString * _Nonnull Label; +@property (strong, nonatomic) NSString * _Nonnull label; @end @interface CHIPOperationalCredentialsClusterRemoveFabricPayload : NSObject -@property (strong) NSNumber * _Nonnull FabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; @end @interface CHIPOperationalCredentialsClusterAddTrustedRootCertificatePayload : NSObject -@property (strong) NSData * _Nonnull RootCertificate; +@property (strong, nonatomic) NSData * _Nonnull rootCertificate; @end @interface CHIPOperationalCredentialsClusterRemoveTrustedRootCertificatePayload : NSObject -@property (strong) NSData * _Nonnull TrustedRootIdentifier; +@property (strong, nonatomic) NSData * _Nonnull trustedRootIdentifier; @end @interface CHIPModeSelectClusterChangeToModePayload : NSObject -@property (strong) NSNumber * _Nonnull NewMode; +@property (strong, nonatomic, getter=getNewMode) NSNumber * _Nonnull newMode; @end @interface CHIPDoorLockClusterLockDoorPayload : NSObject -@property (strong) NSData * _Nonnull Pin; +@property (strong, nonatomic) NSData * _Nonnull pin; @end @interface CHIPDoorLockClusterLockDoorResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterUnlockDoorPayload : NSObject -@property (strong) NSData * _Nonnull Pin; +@property (strong, nonatomic) NSData * _Nonnull pin; @end @interface CHIPDoorLockClusterUnlockDoorResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterTogglePayload : NSObject -@property (strong) NSString * _Nonnull Pin; +@property (strong, nonatomic) NSString * _Nonnull pin; @end @interface CHIPDoorLockClusterToggleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterUnlockWithTimeoutPayload : NSObject -@property (strong) NSNumber * _Nonnull TimeoutInSeconds; -@property (strong) NSData * _Nonnull Pin; +@property (strong, nonatomic) NSNumber * _Nonnull timeoutInSeconds; +@property (strong, nonatomic) NSData * _Nonnull pin; @end @interface CHIPDoorLockClusterUnlockWithTimeoutResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetLogRecordPayload : NSObject -@property (strong) NSNumber * _Nonnull LogIndex; +@property (strong, nonatomic) NSNumber * _Nonnull logIndex; @end @interface CHIPDoorLockClusterGetLogRecordResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull LogEntryId; -@property (strong) NSNumber * _Nonnull Timestamp; -@property (strong) NSNumber * _Nonnull EventType; -@property (strong) NSNumber * _Nonnull Source; -@property (strong) NSNumber * _Nonnull EventIdOrAlarmCode; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSData * _Nonnull Pin; +@property (strong, nonatomic) NSNumber * _Nonnull logEntryId; +@property (strong, nonatomic) NSNumber * _Nonnull timestamp; +@property (strong, nonatomic) NSNumber * _Nonnull eventType; +@property (strong, nonatomic) NSNumber * _Nonnull source; +@property (strong, nonatomic) NSNumber * _Nonnull eventIdOrAlarmCode; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSData * _Nonnull pin; @end @interface CHIPDoorLockClusterSetPinPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserStatus; -@property (strong) NSNumber * _Nonnull UserType; -@property (strong) NSData * _Nonnull Pin; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userStatus; +@property (strong, nonatomic) NSNumber * _Nonnull userType; +@property (strong, nonatomic) NSData * _Nonnull pin; @end @interface CHIPDoorLockClusterSetPinResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetPinPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterGetPinResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserStatus; -@property (strong) NSNumber * _Nonnull UserType; -@property (strong) NSData * _Nonnull Pin; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userStatus; +@property (strong, nonatomic) NSNumber * _Nonnull userType; +@property (strong, nonatomic) NSData * _Nonnull pin; @end @interface CHIPDoorLockClusterClearPinPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterClearPinResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterClearAllPinsPayload : NSObject @end @interface CHIPDoorLockClusterClearAllPinsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterSetUserStatusPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserStatus; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userStatus; @end @interface CHIPDoorLockClusterSetUserStatusResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetUserStatusPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterGetUserStatusResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterSetWeekdaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull DaysMask; -@property (strong) NSNumber * _Nonnull StartHour; -@property (strong) NSNumber * _Nonnull StartMinute; -@property (strong) NSNumber * _Nonnull EndHour; -@property (strong) NSNumber * _Nonnull EndMinute; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull daysMask; +@property (strong, nonatomic) NSNumber * _Nonnull startHour; +@property (strong, nonatomic) NSNumber * _Nonnull startMinute; +@property (strong, nonatomic) NSNumber * _Nonnull endHour; +@property (strong, nonatomic) NSNumber * _Nonnull endMinute; @end @interface CHIPDoorLockClusterSetWeekdayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetWeekdaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterGetWeekdayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull DaysMask; -@property (strong) NSNumber * _Nonnull StartHour; -@property (strong) NSNumber * _Nonnull StartMinute; -@property (strong) NSNumber * _Nonnull EndHour; -@property (strong) NSNumber * _Nonnull EndMinute; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull daysMask; +@property (strong, nonatomic) NSNumber * _Nonnull startHour; +@property (strong, nonatomic) NSNumber * _Nonnull startMinute; +@property (strong, nonatomic) NSNumber * _Nonnull endHour; +@property (strong, nonatomic) NSNumber * _Nonnull endMinute; @end @interface CHIPDoorLockClusterClearWeekdaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterClearWeekdayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterSetYeardaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull LocalStartTime; -@property (strong) NSNumber * _Nonnull LocalEndTime; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull localStartTime; +@property (strong, nonatomic) NSNumber * _Nonnull localEndTime; @end @interface CHIPDoorLockClusterSetYeardayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetYeardaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterGetYeardayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull LocalStartTime; -@property (strong) NSNumber * _Nonnull LocalEndTime; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull localStartTime; +@property (strong, nonatomic) NSNumber * _Nonnull localEndTime; @end @interface CHIPDoorLockClusterClearYeardaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterClearYeardayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterSetHolidaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull LocalStartTime; -@property (strong) NSNumber * _Nonnull LocalEndTime; -@property (strong) NSNumber * _Nonnull OperatingModeDuringHoliday; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull localStartTime; +@property (strong, nonatomic) NSNumber * _Nonnull localEndTime; +@property (strong, nonatomic) NSNumber * _Nonnull operatingModeDuringHoliday; @end @interface CHIPDoorLockClusterSetHolidayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetHolidaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; @end @interface CHIPDoorLockClusterGetHolidayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull LocalStartTime; -@property (strong) NSNumber * _Nonnull LocalEndTime; -@property (strong) NSNumber * _Nonnull OperatingModeDuringHoliday; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull localStartTime; +@property (strong, nonatomic) NSNumber * _Nonnull localEndTime; +@property (strong, nonatomic) NSNumber * _Nonnull operatingModeDuringHoliday; @end @interface CHIPDoorLockClusterClearHolidaySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull ScheduleId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduleId; @end @interface CHIPDoorLockClusterClearHolidayScheduleResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterSetUserTypePayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserType; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userType; @end @interface CHIPDoorLockClusterSetUserTypeResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetUserTypePayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterGetUserTypeResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserType; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userType; @end @interface CHIPDoorLockClusterSetRfidPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserStatus; -@property (strong) NSNumber * _Nonnull UserType; -@property (strong) NSData * _Nonnull Id; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userStatus; +@property (strong, nonatomic) NSNumber * _Nonnull userType; +@property (strong, nonatomic) NSData * _Nonnull id; @end @interface CHIPDoorLockClusterSetRfidResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterGetRfidPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterGetRfidResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSNumber * _Nonnull UserStatus; -@property (strong) NSNumber * _Nonnull UserType; -@property (strong) NSData * _Nonnull Rfid; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSNumber * _Nonnull userStatus; +@property (strong, nonatomic) NSNumber * _Nonnull userType; +@property (strong, nonatomic) NSData * _Nonnull rfid; @end @interface CHIPDoorLockClusterClearRfidPayload : NSObject -@property (strong) NSNumber * _Nonnull UserId; +@property (strong, nonatomic) NSNumber * _Nonnull userId; @end @interface CHIPDoorLockClusterClearRfidResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterClearAllRfidsPayload : NSObject @end @interface CHIPDoorLockClusterClearAllRfidsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPDoorLockClusterOperationEventNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull Source; -@property (strong) NSNumber * _Nonnull EventCode; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSData * _Nonnull Pin; -@property (strong) NSNumber * _Nonnull TimeStamp; -@property (strong) NSString * _Nonnull Data; +@property (strong, nonatomic) NSNumber * _Nonnull source; +@property (strong, nonatomic) NSNumber * _Nonnull eventCode; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSData * _Nonnull pin; +@property (strong, nonatomic) NSNumber * _Nonnull timeStamp; +@property (strong, nonatomic) NSString * _Nonnull data; @end @interface CHIPDoorLockClusterProgrammingEventNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull Source; -@property (strong) NSNumber * _Nonnull EventCode; -@property (strong) NSNumber * _Nonnull UserId; -@property (strong) NSData * _Nonnull Pin; -@property (strong) NSNumber * _Nonnull UserType; -@property (strong) NSNumber * _Nonnull UserStatus; -@property (strong) NSNumber * _Nonnull TimeStamp; -@property (strong) NSString * _Nonnull Data; +@property (strong, nonatomic) NSNumber * _Nonnull source; +@property (strong, nonatomic) NSNumber * _Nonnull eventCode; +@property (strong, nonatomic) NSNumber * _Nonnull userId; +@property (strong, nonatomic) NSData * _Nonnull pin; +@property (strong, nonatomic) NSNumber * _Nonnull userType; +@property (strong, nonatomic) NSNumber * _Nonnull userStatus; +@property (strong, nonatomic) NSNumber * _Nonnull timeStamp; +@property (strong, nonatomic) NSString * _Nonnull data; @end @interface CHIPWindowCoveringClusterUpOrOpenPayload : NSObject @@ -1134,61 +1134,61 @@ @end @interface CHIPWindowCoveringClusterGoToLiftValuePayload : NSObject -@property (strong) NSNumber * _Nonnull LiftValue; +@property (strong, nonatomic) NSNumber * _Nonnull liftValue; @end @interface CHIPWindowCoveringClusterGoToLiftPercentagePayload : NSObject -@property (strong) NSNumber * _Nonnull LiftPercentageValue; -@property (strong) NSNumber * _Nonnull LiftPercent100thsValue; +@property (strong, nonatomic) NSNumber * _Nonnull liftPercentageValue; +@property (strong, nonatomic) NSNumber * _Nonnull liftPercent100thsValue; @end @interface CHIPWindowCoveringClusterGoToTiltValuePayload : NSObject -@property (strong) NSNumber * _Nonnull TiltValue; +@property (strong, nonatomic) NSNumber * _Nonnull tiltValue; @end @interface CHIPWindowCoveringClusterGoToTiltPercentagePayload : NSObject -@property (strong) NSNumber * _Nonnull TiltPercentageValue; -@property (strong) NSNumber * _Nonnull TiltPercent100thsValue; +@property (strong, nonatomic) NSNumber * _Nonnull tiltPercentageValue; +@property (strong, nonatomic) NSNumber * _Nonnull tiltPercent100thsValue; @end @interface CHIPBarrierControlClusterBarrierControlGoToPercentPayload : NSObject -@property (strong) NSNumber * _Nonnull PercentOpen; +@property (strong, nonatomic) NSNumber * _Nonnull percentOpen; @end @interface CHIPBarrierControlClusterBarrierControlStopPayload : NSObject @end @interface CHIPThermostatClusterSetpointRaiseLowerPayload : NSObject -@property (strong) NSNumber * _Nonnull Mode; -@property (strong) NSNumber * _Nonnull Amount; +@property (strong, nonatomic) NSNumber * _Nonnull mode; +@property (strong, nonatomic) NSNumber * _Nonnull amount; @end @interface CHIPThermostatClusterCurrentWeeklySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull NumberOfTransitionsForSequence; -@property (strong) NSNumber * _Nonnull DayOfWeekForSequence; -@property (strong) NSNumber * _Nonnull ModeForSequence; -@property (strong) NSArray * _Nonnull Payload; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfTransitionsForSequence; +@property (strong, nonatomic) NSNumber * _Nonnull dayOfWeekForSequence; +@property (strong, nonatomic) NSNumber * _Nonnull modeForSequence; +@property (strong, nonatomic) NSArray * _Nonnull payload; @end @interface CHIPThermostatClusterSetWeeklySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull NumberOfTransitionsForSequence; -@property (strong) NSNumber * _Nonnull DayOfWeekForSequence; -@property (strong) NSNumber * _Nonnull ModeForSequence; -@property (strong) NSArray * _Nonnull Payload; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfTransitionsForSequence; +@property (strong, nonatomic) NSNumber * _Nonnull dayOfWeekForSequence; +@property (strong, nonatomic) NSNumber * _Nonnull modeForSequence; +@property (strong, nonatomic) NSArray * _Nonnull payload; @end @interface CHIPThermostatClusterRelayStatusLogPayload : NSObject -@property (strong) NSNumber * _Nonnull TimeOfDay; -@property (strong) NSNumber * _Nonnull RelayStatus; -@property (strong) NSNumber * _Nonnull LocalTemperature; -@property (strong) NSNumber * _Nonnull HumidityInPercentage; -@property (strong) NSNumber * _Nonnull Setpoint; -@property (strong) NSNumber * _Nonnull UnreadEntries; +@property (strong, nonatomic) NSNumber * _Nonnull timeOfDay; +@property (strong, nonatomic) NSNumber * _Nonnull relayStatus; +@property (strong, nonatomic) NSNumber * _Nonnull localTemperature; +@property (strong, nonatomic) NSNumber * _Nonnull humidityInPercentage; +@property (strong, nonatomic) NSNumber * _Nonnull setpoint; +@property (strong, nonatomic) NSNumber * _Nonnull unreadEntries; @end @interface CHIPThermostatClusterGetWeeklySchedulePayload : NSObject -@property (strong) NSNumber * _Nonnull DaysToReturn; -@property (strong) NSNumber * _Nonnull ModeToReturn; +@property (strong, nonatomic) NSNumber * _Nonnull daysToReturn; +@property (strong, nonatomic) NSNumber * _Nonnull modeToReturn; @end @interface CHIPThermostatClusterClearWeeklySchedulePayload : NSObject @@ -1198,176 +1198,176 @@ @end @interface CHIPColorControlClusterMoveToHuePayload : NSObject -@property (strong) NSNumber * _Nonnull Hue; -@property (strong) NSNumber * _Nonnull Direction; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull hue; +@property (strong, nonatomic) NSNumber * _Nonnull direction; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveHuePayload : NSObject -@property (strong) NSNumber * _Nonnull MoveMode; -@property (strong) NSNumber * _Nonnull Rate; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull moveMode; +@property (strong, nonatomic) NSNumber * _Nonnull rate; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterStepHuePayload : NSObject -@property (strong) NSNumber * _Nonnull StepMode; -@property (strong) NSNumber * _Nonnull StepSize; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull stepMode; +@property (strong, nonatomic) NSNumber * _Nonnull stepSize; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveToSaturationPayload : NSObject -@property (strong) NSNumber * _Nonnull Saturation; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull saturation; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveSaturationPayload : NSObject -@property (strong) NSNumber * _Nonnull MoveMode; -@property (strong) NSNumber * _Nonnull Rate; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull moveMode; +@property (strong, nonatomic) NSNumber * _Nonnull rate; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterStepSaturationPayload : NSObject -@property (strong) NSNumber * _Nonnull StepMode; -@property (strong) NSNumber * _Nonnull StepSize; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull stepMode; +@property (strong, nonatomic) NSNumber * _Nonnull stepSize; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveToHueAndSaturationPayload : NSObject -@property (strong) NSNumber * _Nonnull Hue; -@property (strong) NSNumber * _Nonnull Saturation; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull hue; +@property (strong, nonatomic) NSNumber * _Nonnull saturation; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveToColorPayload : NSObject -@property (strong) NSNumber * _Nonnull ColorX; -@property (strong) NSNumber * _Nonnull ColorY; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull colorX; +@property (strong, nonatomic) NSNumber * _Nonnull colorY; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveColorPayload : NSObject -@property (strong) NSNumber * _Nonnull RateX; -@property (strong) NSNumber * _Nonnull RateY; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull rateX; +@property (strong, nonatomic) NSNumber * _Nonnull rateY; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterStepColorPayload : NSObject -@property (strong) NSNumber * _Nonnull StepX; -@property (strong) NSNumber * _Nonnull StepY; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull stepX; +@property (strong, nonatomic) NSNumber * _Nonnull stepY; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveToColorTemperaturePayload : NSObject -@property (strong) NSNumber * _Nonnull ColorTemperature; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull colorTemperature; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterEnhancedMoveToHuePayload : NSObject -@property (strong) NSNumber * _Nonnull EnhancedHue; -@property (strong) NSNumber * _Nonnull Direction; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull enhancedHue; +@property (strong, nonatomic) NSNumber * _Nonnull direction; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterEnhancedMoveHuePayload : NSObject -@property (strong) NSNumber * _Nonnull MoveMode; -@property (strong) NSNumber * _Nonnull Rate; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull moveMode; +@property (strong, nonatomic) NSNumber * _Nonnull rate; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterEnhancedStepHuePayload : NSObject -@property (strong) NSNumber * _Nonnull StepMode; -@property (strong) NSNumber * _Nonnull StepSize; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull stepMode; +@property (strong, nonatomic) NSNumber * _Nonnull stepSize; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterEnhancedMoveToHueAndSaturationPayload : NSObject -@property (strong) NSNumber * _Nonnull EnhancedHue; -@property (strong) NSNumber * _Nonnull Saturation; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull enhancedHue; +@property (strong, nonatomic) NSNumber * _Nonnull saturation; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterColorLoopSetPayload : NSObject -@property (strong) NSNumber * _Nonnull UpdateFlags; -@property (strong) NSNumber * _Nonnull Action; -@property (strong) NSNumber * _Nonnull Direction; -@property (strong) NSNumber * _Nonnull Time; -@property (strong) NSNumber * _Nonnull StartHue; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull updateFlags; +@property (strong, nonatomic) NSNumber * _Nonnull action; +@property (strong, nonatomic) NSNumber * _Nonnull direction; +@property (strong, nonatomic) NSNumber * _Nonnull time; +@property (strong, nonatomic) NSNumber * _Nonnull startHue; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterStopMoveStepPayload : NSObject -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterMoveColorTemperaturePayload : NSObject -@property (strong) NSNumber * _Nonnull MoveMode; -@property (strong) NSNumber * _Nonnull Rate; -@property (strong) NSNumber * _Nonnull ColorTemperatureMinimum; -@property (strong) NSNumber * _Nonnull ColorTemperatureMaximum; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull moveMode; +@property (strong, nonatomic) NSNumber * _Nonnull rate; +@property (strong, nonatomic) NSNumber * _Nonnull colorTemperatureMinimum; +@property (strong, nonatomic) NSNumber * _Nonnull colorTemperatureMaximum; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPColorControlClusterStepColorTemperaturePayload : NSObject -@property (strong) NSNumber * _Nonnull StepMode; -@property (strong) NSNumber * _Nonnull StepSize; -@property (strong) NSNumber * _Nonnull TransitionTime; -@property (strong) NSNumber * _Nonnull ColorTemperatureMinimum; -@property (strong) NSNumber * _Nonnull ColorTemperatureMaximum; -@property (strong) NSNumber * _Nonnull OptionsMask; -@property (strong) NSNumber * _Nonnull OptionsOverride; +@property (strong, nonatomic) NSNumber * _Nonnull stepMode; +@property (strong, nonatomic) NSNumber * _Nonnull stepSize; +@property (strong, nonatomic) NSNumber * _Nonnull transitionTime; +@property (strong, nonatomic) NSNumber * _Nonnull colorTemperatureMinimum; +@property (strong, nonatomic) NSNumber * _Nonnull colorTemperatureMaximum; +@property (strong, nonatomic) NSNumber * _Nonnull optionsMask; +@property (strong, nonatomic) NSNumber * _Nonnull optionsOverride; @end @interface CHIPIasZoneClusterZoneEnrollResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull EnrollResponseCode; -@property (strong) NSNumber * _Nonnull ZoneId; +@property (strong, nonatomic) NSNumber * _Nonnull enrollResponseCode; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; @end @interface CHIPIasZoneClusterZoneStatusChangeNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull ZoneStatus; -@property (strong) NSNumber * _Nonnull ExtendedStatus; -@property (strong) NSNumber * _Nonnull ZoneId; -@property (strong) NSNumber * _Nonnull Delay; +@property (strong, nonatomic) NSNumber * _Nonnull zoneStatus; +@property (strong, nonatomic) NSNumber * _Nonnull extendedStatus; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; +@property (strong, nonatomic) NSNumber * _Nonnull delay; @end @interface CHIPIasZoneClusterInitiateNormalOperationModePayload : NSObject @end @interface CHIPIasZoneClusterZoneEnrollRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull ZoneType; -@property (strong) NSNumber * _Nonnull ManufacturerCode; +@property (strong, nonatomic) NSNumber * _Nonnull zoneType; +@property (strong, nonatomic) NSNumber * _Nonnull manufacturerCode; @end @interface CHIPIasZoneClusterInitiateTestModePayload : NSObject -@property (strong) NSNumber * _Nonnull TestModeDuration; -@property (strong) NSNumber * _Nonnull CurrentZoneSensitivityLevel; +@property (strong, nonatomic) NSNumber * _Nonnull testModeDuration; +@property (strong, nonatomic) NSNumber * _Nonnull currentZoneSensitivityLevel; @end @interface CHIPIasZoneClusterInitiateNormalOperationModeResponsePayload : NSObject @@ -1377,234 +1377,234 @@ @end @interface CHIPIasAceClusterArmPayload : NSObject -@property (strong) NSNumber * _Nonnull ArmMode; -@property (strong) NSString * _Nonnull ArmDisarmCode; -@property (strong) NSNumber * _Nonnull ZoneId; +@property (strong, nonatomic) NSNumber * _Nonnull armMode; +@property (strong, nonatomic) NSString * _Nonnull armDisarmCode; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; @end @interface CHIPIasAceClusterArmResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ArmNotification; +@property (strong, nonatomic) NSNumber * _Nonnull armNotification; @end @interface CHIPIasAceClusterBypassPayload : NSObject -@property (strong) NSNumber * _Nonnull NumberOfZones; -@property (strong) NSArray * _Nonnull ZoneIds; -@property (strong) NSString * _Nonnull ArmDisarmCode; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfZones; +@property (strong, nonatomic) NSArray * _Nonnull zoneIds; +@property (strong, nonatomic) NSString * _Nonnull armDisarmCode; @end @interface CHIPIasAceClusterGetZoneIdMapResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Section0; -@property (strong) NSNumber * _Nonnull Section1; -@property (strong) NSNumber * _Nonnull Section2; -@property (strong) NSNumber * _Nonnull Section3; -@property (strong) NSNumber * _Nonnull Section4; -@property (strong) NSNumber * _Nonnull Section5; -@property (strong) NSNumber * _Nonnull Section6; -@property (strong) NSNumber * _Nonnull Section7; -@property (strong) NSNumber * _Nonnull Section8; -@property (strong) NSNumber * _Nonnull Section9; -@property (strong) NSNumber * _Nonnull Section10; -@property (strong) NSNumber * _Nonnull Section11; -@property (strong) NSNumber * _Nonnull Section12; -@property (strong) NSNumber * _Nonnull Section13; -@property (strong) NSNumber * _Nonnull Section14; -@property (strong) NSNumber * _Nonnull Section15; +@property (strong, nonatomic) NSNumber * _Nonnull section0; +@property (strong, nonatomic) NSNumber * _Nonnull section1; +@property (strong, nonatomic) NSNumber * _Nonnull section2; +@property (strong, nonatomic) NSNumber * _Nonnull section3; +@property (strong, nonatomic) NSNumber * _Nonnull section4; +@property (strong, nonatomic) NSNumber * _Nonnull section5; +@property (strong, nonatomic) NSNumber * _Nonnull section6; +@property (strong, nonatomic) NSNumber * _Nonnull section7; +@property (strong, nonatomic) NSNumber * _Nonnull section8; +@property (strong, nonatomic) NSNumber * _Nonnull section9; +@property (strong, nonatomic) NSNumber * _Nonnull section10; +@property (strong, nonatomic) NSNumber * _Nonnull section11; +@property (strong, nonatomic) NSNumber * _Nonnull section12; +@property (strong, nonatomic) NSNumber * _Nonnull section13; +@property (strong, nonatomic) NSNumber * _Nonnull section14; +@property (strong, nonatomic) NSNumber * _Nonnull section15; @end @interface CHIPIasAceClusterEmergencyPayload : NSObject @end @interface CHIPIasAceClusterGetZoneInformationResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ZoneId; -@property (strong) NSNumber * _Nonnull ZoneType; -@property (strong) NSNumber * _Nonnull IeeeAddress; -@property (strong) NSString * _Nonnull ZoneLabel; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; +@property (strong, nonatomic) NSNumber * _Nonnull zoneType; +@property (strong, nonatomic) NSNumber * _Nonnull ieeeAddress; +@property (strong, nonatomic) NSString * _Nonnull zoneLabel; @end @interface CHIPIasAceClusterFirePayload : NSObject @end @interface CHIPIasAceClusterZoneStatusChangedPayload : NSObject -@property (strong) NSNumber * _Nonnull ZoneId; -@property (strong) NSNumber * _Nonnull ZoneStatus; -@property (strong) NSNumber * _Nonnull AudibleNotification; -@property (strong) NSString * _Nonnull ZoneLabel; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; +@property (strong, nonatomic) NSNumber * _Nonnull zoneStatus; +@property (strong, nonatomic) NSNumber * _Nonnull audibleNotification; +@property (strong, nonatomic) NSString * _Nonnull zoneLabel; @end @interface CHIPIasAceClusterPanicPayload : NSObject @end @interface CHIPIasAceClusterPanelStatusChangedPayload : NSObject -@property (strong) NSNumber * _Nonnull PanelStatus; -@property (strong) NSNumber * _Nonnull SecondsRemaining; -@property (strong) NSNumber * _Nonnull AudibleNotification; -@property (strong) NSNumber * _Nonnull AlarmStatus; +@property (strong, nonatomic) NSNumber * _Nonnull panelStatus; +@property (strong, nonatomic) NSNumber * _Nonnull secondsRemaining; +@property (strong, nonatomic) NSNumber * _Nonnull audibleNotification; +@property (strong, nonatomic) NSNumber * _Nonnull alarmStatus; @end @interface CHIPIasAceClusterGetZoneIdMapPayload : NSObject @end @interface CHIPIasAceClusterGetPanelStatusResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull PanelStatus; -@property (strong) NSNumber * _Nonnull SecondsRemaining; -@property (strong) NSNumber * _Nonnull AudibleNotification; -@property (strong) NSNumber * _Nonnull AlarmStatus; +@property (strong, nonatomic) NSNumber * _Nonnull panelStatus; +@property (strong, nonatomic) NSNumber * _Nonnull secondsRemaining; +@property (strong, nonatomic) NSNumber * _Nonnull audibleNotification; +@property (strong, nonatomic) NSNumber * _Nonnull alarmStatus; @end @interface CHIPIasAceClusterGetZoneInformationPayload : NSObject -@property (strong) NSNumber * _Nonnull ZoneId; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; @end @interface CHIPIasAceClusterSetBypassedZoneListPayload : NSObject -@property (strong) NSNumber * _Nonnull NumberOfZones; -@property (strong) NSArray * _Nonnull ZoneIds; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfZones; +@property (strong, nonatomic) NSArray * _Nonnull zoneIds; @end @interface CHIPIasAceClusterGetPanelStatusPayload : NSObject @end @interface CHIPIasAceClusterBypassResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull NumberOfZones; -@property (strong) NSArray * _Nonnull BypassResult; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfZones; +@property (strong, nonatomic) NSArray * _Nonnull bypassResult; @end @interface CHIPIasAceClusterGetBypassedZoneListPayload : NSObject @end @interface CHIPIasAceClusterGetZoneStatusResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ZoneStatusComplete; -@property (strong) NSNumber * _Nonnull NumberOfZones; -@property (strong) NSArray * _Nonnull ZoneStatusResult; +@property (strong, nonatomic) NSNumber * _Nonnull zoneStatusComplete; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfZones; +@property (strong, nonatomic) NSArray * _Nonnull zoneStatusResult; @end @interface CHIPIasAceClusterGetZoneStatusPayload : NSObject -@property (strong) NSNumber * _Nonnull StartingZoneId; -@property (strong) NSNumber * _Nonnull MaxNumberOfZoneIds; -@property (strong) NSNumber * _Nonnull ZoneStatusMaskFlag; -@property (strong) NSNumber * _Nonnull ZoneStatusMask; +@property (strong, nonatomic) NSNumber * _Nonnull startingZoneId; +@property (strong, nonatomic) NSNumber * _Nonnull maxNumberOfZoneIds; +@property (strong, nonatomic) NSNumber * _Nonnull zoneStatusMaskFlag; +@property (strong, nonatomic) NSNumber * _Nonnull zoneStatusMask; @end @interface CHIPIasWdClusterStartWarningPayload : NSObject -@property (strong) NSNumber * _Nonnull WarningInfo; -@property (strong) NSNumber * _Nonnull WarningDuration; -@property (strong) NSNumber * _Nonnull StrobeDutyCycle; -@property (strong) NSNumber * _Nonnull StrobeLevel; +@property (strong, nonatomic) NSNumber * _Nonnull warningInfo; +@property (strong, nonatomic) NSNumber * _Nonnull warningDuration; +@property (strong, nonatomic) NSNumber * _Nonnull strobeDutyCycle; +@property (strong, nonatomic) NSNumber * _Nonnull strobeLevel; @end @interface CHIPIasWdClusterSquawkPayload : NSObject -@property (strong) NSNumber * _Nonnull SquawkInfo; +@property (strong, nonatomic) NSNumber * _Nonnull squawkInfo; @end @interface CHIPTvChannelClusterChangeChannelPayload : NSObject -@property (strong) NSString * _Nonnull Match; +@property (strong, nonatomic) NSString * _Nonnull match; @end @interface CHIPTvChannelClusterChangeChannelResponsePayload : NSObject -@property (strong) NSArray * _Nonnull ChannelMatch; -@property (strong) NSNumber * _Nonnull ErrorType; +@property (strong, nonatomic) NSArray * _Nonnull channelMatch; +@property (strong, nonatomic) NSNumber * _Nonnull errorType; @end @interface CHIPTvChannelClusterChangeChannelByNumberPayload : NSObject -@property (strong) NSNumber * _Nonnull MajorNumber; -@property (strong) NSNumber * _Nonnull MinorNumber; +@property (strong, nonatomic) NSNumber * _Nonnull majorNumber; +@property (strong, nonatomic) NSNumber * _Nonnull minorNumber; @end @interface CHIPTvChannelClusterSkipChannelPayload : NSObject -@property (strong) NSNumber * _Nonnull Count; +@property (strong, nonatomic, getter=getCount) NSNumber * _Nonnull count; @end @interface CHIPTargetNavigatorClusterNavigateTargetPayload : NSObject -@property (strong) NSNumber * _Nonnull Target; -@property (strong) NSString * _Nonnull Data; +@property (strong, nonatomic) NSNumber * _Nonnull target; +@property (strong, nonatomic) NSString * _Nonnull data; @end @interface CHIPTargetNavigatorClusterNavigateTargetResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSString * _Nonnull Data; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSString * _Nonnull data; @end @interface CHIPMediaPlaybackClusterMediaPlayPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaPlayResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaPausePayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaPauseResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaStopPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaStopResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaStartOverPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaStartOverResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaPreviousPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaPreviousResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaNextPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaNextResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaRewindPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaRewindResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaFastForwardPayload : NSObject @end @interface CHIPMediaPlaybackClusterMediaFastForwardResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaSkipForwardPayload : NSObject -@property (strong) NSNumber * _Nonnull DeltaPositionMilliseconds; +@property (strong, nonatomic) NSNumber * _Nonnull deltaPositionMilliseconds; @end @interface CHIPMediaPlaybackClusterMediaSkipForwardResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaSkipBackwardPayload : NSObject -@property (strong) NSNumber * _Nonnull DeltaPositionMilliseconds; +@property (strong, nonatomic) NSNumber * _Nonnull deltaPositionMilliseconds; @end @interface CHIPMediaPlaybackClusterMediaSkipBackwardResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaPlaybackClusterMediaSeekPayload : NSObject -@property (strong) NSNumber * _Nonnull Position; +@property (strong, nonatomic) NSNumber * _Nonnull position; @end @interface CHIPMediaPlaybackClusterMediaSeekResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull MediaPlaybackStatus; +@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; @end @interface CHIPMediaInputClusterSelectInputPayload : NSObject -@property (strong) NSNumber * _Nonnull Index; +@property (strong, nonatomic) NSNumber * _Nonnull index; @end @interface CHIPMediaInputClusterShowInputStatusPayload : NSObject @@ -1614,367 +1614,367 @@ @end @interface CHIPMediaInputClusterRenameInputPayload : NSObject -@property (strong) NSNumber * _Nonnull Index; -@property (strong) NSString * _Nonnull Name; +@property (strong, nonatomic) NSNumber * _Nonnull index; +@property (strong, nonatomic) NSString * _Nonnull name; @end @interface CHIPLowPowerClusterSleepPayload : NSObject @end @interface CHIPKeypadInputClusterSendKeyPayload : NSObject -@property (strong) NSNumber * _Nonnull KeyCode; +@property (strong, nonatomic) NSNumber * _Nonnull keyCode; @end @interface CHIPKeypadInputClusterSendKeyResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPContentLauncherClusterLaunchContentPayload : NSObject -@property (strong) NSNumber * _Nonnull AutoPlay; -@property (strong) NSString * _Nonnull Data; +@property (strong, nonatomic) NSNumber * _Nonnull autoPlay; +@property (strong, nonatomic) NSString * _Nonnull data; @end @interface CHIPContentLauncherClusterLaunchContentResponsePayload : NSObject -@property (strong) NSString * _Nonnull Data; -@property (strong) NSNumber * _Nonnull ContentLaunchStatus; +@property (strong, nonatomic) NSString * _Nonnull data; +@property (strong, nonatomic) NSNumber * _Nonnull contentLaunchStatus; @end @interface CHIPContentLauncherClusterLaunchURLPayload : NSObject -@property (strong) NSString * _Nonnull ContentURL; -@property (strong) NSString * _Nonnull DisplayString; +@property (strong, nonatomic) NSString * _Nonnull contentURL; +@property (strong, nonatomic) NSString * _Nonnull displayString; @end @interface CHIPContentLauncherClusterLaunchURLResponsePayload : NSObject -@property (strong) NSString * _Nonnull Data; -@property (strong) NSNumber * _Nonnull ContentLaunchStatus; +@property (strong, nonatomic) NSString * _Nonnull data; +@property (strong, nonatomic) NSNumber * _Nonnull contentLaunchStatus; @end @interface CHIPAudioOutputClusterSelectOutputPayload : NSObject -@property (strong) NSNumber * _Nonnull Index; +@property (strong, nonatomic) NSNumber * _Nonnull index; @end @interface CHIPAudioOutputClusterRenameOutputPayload : NSObject -@property (strong) NSNumber * _Nonnull Index; -@property (strong) NSString * _Nonnull Name; +@property (strong, nonatomic) NSNumber * _Nonnull index; +@property (strong, nonatomic) NSString * _Nonnull name; @end @interface CHIPApplicationLauncherClusterLaunchAppPayload : NSObject -@property (strong) NSString * _Nonnull Data; -@property (strong) NSNumber * _Nonnull CatalogVendorId; -@property (strong) NSString * _Nonnull ApplicationId; +@property (strong, nonatomic) NSString * _Nonnull data; +@property (strong, nonatomic) NSNumber * _Nonnull catalogVendorId; +@property (strong, nonatomic) NSString * _Nonnull applicationId; @end @interface CHIPApplicationLauncherClusterLaunchAppResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSString * _Nonnull Data; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSString * _Nonnull data; @end @interface CHIPApplicationBasicClusterChangeStatusPayload : NSObject -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPAccountLoginClusterGetSetupPINPayload : NSObject -@property (strong) NSString * _Nonnull TempAccountIdentifier; +@property (strong, nonatomic) NSString * _Nonnull tempAccountIdentifier; @end @interface CHIPAccountLoginClusterGetSetupPINResponsePayload : NSObject -@property (strong) NSString * _Nonnull SetupPIN; +@property (strong, nonatomic) NSString * _Nonnull setupPIN; @end @interface CHIPAccountLoginClusterLoginPayload : NSObject -@property (strong) NSString * _Nonnull TempAccountIdentifier; -@property (strong) NSString * _Nonnull SetupPIN; +@property (strong, nonatomic) NSString * _Nonnull tempAccountIdentifier; +@property (strong, nonatomic) NSString * _Nonnull setupPIN; @end @interface CHIPTestClusterClusterTestPayload : NSObject @end @interface CHIPTestClusterClusterTestSpecificResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ReturnValue; +@property (strong, nonatomic) NSNumber * _Nonnull returnValue; @end @interface CHIPTestClusterClusterTestNotHandledPayload : NSObject @end @interface CHIPTestClusterClusterTestAddArgumentsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ReturnValue; +@property (strong, nonatomic) NSNumber * _Nonnull returnValue; @end @interface CHIPTestClusterClusterTestSpecificPayload : NSObject @end @interface CHIPTestClusterClusterTestSimpleArgumentResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull ReturnValue; +@property (strong, nonatomic) NSNumber * _Nonnull returnValue; @end @interface CHIPTestClusterClusterTestUnknownCommandPayload : NSObject @end @interface CHIPTestClusterClusterTestStructArrayArgumentResponsePayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; -@property (strong) NSArray * _Nonnull Arg2; -@property (strong) NSArray * _Nonnull Arg3; -@property (strong) NSArray * _Nonnull Arg4; -@property (strong) NSNumber * _Nonnull Arg5; -@property (strong) NSNumber * _Nonnull Arg6; +@property (strong, nonatomic) NSArray * _Nonnull arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg2; +@property (strong, nonatomic) NSArray * _Nonnull arg3; +@property (strong, nonatomic) NSArray * _Nonnull arg4; +@property (strong, nonatomic) NSNumber * _Nonnull arg5; +@property (strong, nonatomic) NSNumber * _Nonnull arg6; @end @interface CHIPTestClusterClusterTestAddArgumentsPayload : NSObject -@property (strong) NSNumber * _Nonnull Arg1; -@property (strong) NSNumber * _Nonnull Arg2; +@property (strong, nonatomic) NSNumber * _Nonnull arg1; +@property (strong, nonatomic) NSNumber * _Nonnull arg2; @end @interface CHIPTestClusterClusterTestListInt8UReverseResponsePayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestSimpleArgumentRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull Arg1; +@property (strong, nonatomic) NSNumber * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestEnumsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Arg1; -@property (strong) NSNumber * _Nonnull Arg2; +@property (strong, nonatomic) NSNumber * _Nonnull arg1; +@property (strong, nonatomic) NSNumber * _Nonnull arg2; @end @interface CHIPTestClusterClusterTestStructArrayArgumentRequestPayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; -@property (strong) NSArray * _Nonnull Arg2; -@property (strong) NSArray * _Nonnull Arg3; -@property (strong) NSArray * _Nonnull Arg4; -@property (strong) NSNumber * _Nonnull Arg5; -@property (strong) NSNumber * _Nonnull Arg6; +@property (strong, nonatomic) NSArray * _Nonnull arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg2; +@property (strong, nonatomic) NSArray * _Nonnull arg3; +@property (strong, nonatomic) NSArray * _Nonnull arg4; +@property (strong, nonatomic) NSNumber * _Nonnull arg5; +@property (strong, nonatomic) NSNumber * _Nonnull arg6; @end @interface CHIPTestClusterClusterTestNullableOptionalResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull WasPresent; -@property (strong) NSNumber * _Nullable WasNull; -@property (strong) NSNumber * _Nullable Value; -@property (strong) NSNumber * _Nullable OriginalValue; +@property (strong, nonatomic) NSNumber * _Nonnull wasPresent; +@property (strong, nonatomic) NSNumber * _Nullable wasNull; +@property (strong, nonatomic) NSNumber * _Nullable value; +@property (strong, nonatomic) NSNumber * _Nullable originalValue; @end @interface CHIPTestClusterClusterTestStructArgumentRequestPayload : NSObject -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nonnull Arg1; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestComplexNullableOptionalResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull NullableIntWasNull; -@property (strong) NSNumber * _Nullable NullableIntValue; -@property (strong) NSNumber * _Nonnull OptionalIntWasPresent; -@property (strong) NSNumber * _Nullable OptionalIntValue; -@property (strong) NSNumber * _Nonnull NullableOptionalIntWasPresent; -@property (strong) NSNumber * _Nullable NullableOptionalIntWasNull; -@property (strong) NSNumber * _Nullable NullableOptionalIntValue; -@property (strong) NSNumber * _Nonnull NullableStringWasNull; -@property (strong) NSString * _Nullable NullableStringValue; -@property (strong) NSNumber * _Nonnull OptionalStringWasPresent; -@property (strong) NSString * _Nullable OptionalStringValue; -@property (strong) NSNumber * _Nonnull NullableOptionalStringWasPresent; -@property (strong) NSNumber * _Nullable NullableOptionalStringWasNull; -@property (strong) NSString * _Nullable NullableOptionalStringValue; -@property (strong) NSNumber * _Nonnull NullableStructWasNull; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable NullableStructValue; -@property (strong) NSNumber * _Nonnull OptionalStructWasPresent; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable OptionalStructValue; -@property (strong) NSNumber * _Nonnull NullableOptionalStructWasPresent; -@property (strong) NSNumber * _Nullable NullableOptionalStructWasNull; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable NullableOptionalStructValue; -@property (strong) NSNumber * _Nonnull NullableListWasNull; -@property (strong) NSArray * _Nullable NullableListValue; -@property (strong) NSNumber * _Nonnull OptionalListWasPresent; -@property (strong) NSArray * _Nullable OptionalListValue; -@property (strong) NSNumber * _Nonnull NullableOptionalListWasPresent; -@property (strong) NSNumber * _Nullable NullableOptionalListWasNull; -@property (strong) NSArray * _Nullable NullableOptionalListValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableIntWasNull; +@property (strong, nonatomic) NSNumber * _Nullable nullableIntValue; +@property (strong, nonatomic) NSNumber * _Nonnull optionalIntWasPresent; +@property (strong, nonatomic) NSNumber * _Nullable optionalIntValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableOptionalIntWasPresent; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalIntWasNull; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalIntValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableStringWasNull; +@property (strong, nonatomic) NSString * _Nullable nullableStringValue; +@property (strong, nonatomic) NSNumber * _Nonnull optionalStringWasPresent; +@property (strong, nonatomic) NSString * _Nullable optionalStringValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableOptionalStringWasPresent; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalStringWasNull; +@property (strong, nonatomic) NSString * _Nullable nullableOptionalStringValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableStructWasNull; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable nullableStructValue; +@property (strong, nonatomic) NSNumber * _Nonnull optionalStructWasPresent; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable optionalStructValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableOptionalStructWasPresent; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalStructWasNull; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable nullableOptionalStructValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableListWasNull; +@property (strong, nonatomic) NSArray * _Nullable nullableListValue; +@property (strong, nonatomic) NSNumber * _Nonnull optionalListWasPresent; +@property (strong, nonatomic) NSArray * _Nullable optionalListValue; +@property (strong, nonatomic) NSNumber * _Nonnull nullableOptionalListWasPresent; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalListWasNull; +@property (strong, nonatomic) NSArray * _Nullable nullableOptionalListValue; @end @interface CHIPTestClusterClusterTestNestedStructArgumentRequestPayload : NSObject -@property (strong) CHIPTestClusterClusterNestedStruct * _Nonnull Arg1; +@property (strong, nonatomic) CHIPTestClusterClusterNestedStruct * _Nonnull arg1; @end @interface CHIPTestClusterClusterBooleanResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull Value; +@property (strong, nonatomic) NSNumber * _Nonnull value; @end @interface CHIPTestClusterClusterTestListStructArgumentRequestPayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestListInt8UArgumentRequestPayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestNestedStructListArgumentRequestPayload : NSObject -@property (strong) CHIPTestClusterClusterNestedStructList * _Nonnull Arg1; +@property (strong, nonatomic) CHIPTestClusterClusterNestedStructList * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestListNestedStructListArgumentRequestPayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestListInt8UReverseRequestPayload : NSObject -@property (strong) NSArray * _Nonnull Arg1; +@property (strong, nonatomic) NSArray * _Nonnull arg1; @end @interface CHIPTestClusterClusterTestEnumsRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull Arg1; -@property (strong) NSNumber * _Nonnull Arg2; +@property (strong, nonatomic) NSNumber * _Nonnull arg1; +@property (strong, nonatomic) NSNumber * _Nonnull arg2; @end @interface CHIPTestClusterClusterTestNullableOptionalRequestPayload : NSObject -@property (strong) NSNumber * _Nullable Arg1; +@property (strong, nonatomic) NSNumber * _Nullable arg1; @end @interface CHIPTestClusterClusterTestComplexNullableOptionalRequestPayload : NSObject -@property (strong) NSNumber * _Nullable NullableInt; -@property (strong) NSNumber * _Nullable OptionalInt; -@property (strong) NSNumber * _Nullable NullableOptionalInt; -@property (strong) NSString * _Nullable NullableString; -@property (strong) NSString * _Nullable OptionalString; -@property (strong) NSString * _Nullable NullableOptionalString; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable NullableStruct; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable OptionalStruct; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable NullableOptionalStruct; -@property (strong) NSArray * _Nullable NullableList; -@property (strong) NSArray * _Nullable OptionalList; -@property (strong) NSArray * _Nullable NullableOptionalList; +@property (strong, nonatomic) NSNumber * _Nullable nullableInt; +@property (strong, nonatomic) NSNumber * _Nullable optionalInt; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalInt; +@property (strong, nonatomic) NSString * _Nullable nullableString; +@property (strong, nonatomic) NSString * _Nullable optionalString; +@property (strong, nonatomic) NSString * _Nullable nullableOptionalString; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable nullableStruct; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable optionalStruct; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable nullableOptionalStruct; +@property (strong, nonatomic) NSArray * _Nullable nullableList; +@property (strong, nonatomic) NSArray * _Nullable optionalList; +@property (strong, nonatomic) NSArray * _Nullable nullableOptionalList; @end @interface CHIPMessagingClusterDisplayMessagePayload : NSObject -@property (strong) NSNumber * _Nonnull MessageId; -@property (strong) NSNumber * _Nonnull MessageControl; -@property (strong) NSNumber * _Nonnull StartTime; -@property (strong) NSNumber * _Nonnull DurationInMinutes; -@property (strong) NSString * _Nonnull Message; -@property (strong) NSNumber * _Nonnull OptionalExtendedMessageControl; +@property (strong, nonatomic) NSNumber * _Nonnull messageId; +@property (strong, nonatomic) NSNumber * _Nonnull messageControl; +@property (strong, nonatomic) NSNumber * _Nonnull startTime; +@property (strong, nonatomic) NSNumber * _Nonnull durationInMinutes; +@property (strong, nonatomic) NSString * _Nonnull message; +@property (strong, nonatomic) NSNumber * _Nonnull optionalExtendedMessageControl; @end @interface CHIPMessagingClusterGetLastMessagePayload : NSObject @end @interface CHIPMessagingClusterCancelMessagePayload : NSObject -@property (strong) NSNumber * _Nonnull MessageId; -@property (strong) NSNumber * _Nonnull MessageControl; +@property (strong, nonatomic) NSNumber * _Nonnull messageId; +@property (strong, nonatomic) NSNumber * _Nonnull messageControl; @end @interface CHIPMessagingClusterMessageConfirmationPayload : NSObject -@property (strong) NSNumber * _Nonnull MessageId; -@property (strong) NSNumber * _Nonnull ConfirmationTime; -@property (strong) NSNumber * _Nonnull MessageConfirmationControl; -@property (strong) NSData * _Nonnull MessageResponse; +@property (strong, nonatomic) NSNumber * _Nonnull messageId; +@property (strong, nonatomic) NSNumber * _Nonnull confirmationTime; +@property (strong, nonatomic) NSNumber * _Nonnull messageConfirmationControl; +@property (strong, nonatomic) NSData * _Nonnull messageResponse; @end @interface CHIPMessagingClusterDisplayProtectedMessagePayload : NSObject -@property (strong) NSNumber * _Nonnull MessageId; -@property (strong) NSNumber * _Nonnull MessageControl; -@property (strong) NSNumber * _Nonnull StartTime; -@property (strong) NSNumber * _Nonnull DurationInMinutes; -@property (strong) NSString * _Nonnull Message; -@property (strong) NSNumber * _Nonnull OptionalExtendedMessageControl; +@property (strong, nonatomic) NSNumber * _Nonnull messageId; +@property (strong, nonatomic) NSNumber * _Nonnull messageControl; +@property (strong, nonatomic) NSNumber * _Nonnull startTime; +@property (strong, nonatomic) NSNumber * _Nonnull durationInMinutes; +@property (strong, nonatomic) NSString * _Nonnull message; +@property (strong, nonatomic) NSNumber * _Nonnull optionalExtendedMessageControl; @end @interface CHIPMessagingClusterGetMessageCancellationPayload : NSObject -@property (strong) NSNumber * _Nonnull EarliestImplementationTime; +@property (strong, nonatomic) NSNumber * _Nonnull earliestImplementationTime; @end @interface CHIPMessagingClusterCancelAllMessagesPayload : NSObject -@property (strong) NSNumber * _Nonnull ImplementationDateTime; +@property (strong, nonatomic) NSNumber * _Nonnull implementationDateTime; @end @interface CHIPApplianceEventsAndAlertClusterGetAlertsPayload : NSObject @end @interface CHIPApplianceEventsAndAlertClusterGetAlertsResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull AlertsCount; -@property (strong) NSArray * _Nonnull AlertStructures; +@property (strong, nonatomic) NSNumber * _Nonnull alertsCount; +@property (strong, nonatomic) NSArray * _Nonnull alertStructures; @end @interface CHIPApplianceEventsAndAlertClusterAlertsNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull AlertsCount; -@property (strong) NSArray * _Nonnull AlertStructures; +@property (strong, nonatomic) NSNumber * _Nonnull alertsCount; +@property (strong, nonatomic) NSArray * _Nonnull alertStructures; @end @interface CHIPApplianceEventsAndAlertClusterEventsNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull EventHeader; -@property (strong) NSNumber * _Nonnull EventId; +@property (strong, nonatomic) NSNumber * _Nonnull eventHeader; +@property (strong, nonatomic) NSNumber * _Nonnull eventId; @end @interface CHIPApplianceStatisticsClusterLogNotificationPayload : NSObject -@property (strong) NSNumber * _Nonnull TimeStamp; -@property (strong) NSNumber * _Nonnull LogId; -@property (strong) NSNumber * _Nonnull LogLength; -@property (strong) NSArray * _Nonnull LogPayload; +@property (strong, nonatomic) NSNumber * _Nonnull timeStamp; +@property (strong, nonatomic) NSNumber * _Nonnull logId; +@property (strong, nonatomic) NSNumber * _Nonnull logLength; +@property (strong, nonatomic) NSArray * _Nonnull logPayload; @end @interface CHIPApplianceStatisticsClusterLogRequestPayload : NSObject -@property (strong) NSNumber * _Nonnull LogId; +@property (strong, nonatomic) NSNumber * _Nonnull logId; @end @interface CHIPApplianceStatisticsClusterLogResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull TimeStamp; -@property (strong) NSNumber * _Nonnull LogId; -@property (strong) NSNumber * _Nonnull LogLength; -@property (strong) NSArray * _Nonnull LogPayload; +@property (strong, nonatomic) NSNumber * _Nonnull timeStamp; +@property (strong, nonatomic) NSNumber * _Nonnull logId; +@property (strong, nonatomic) NSNumber * _Nonnull logLength; +@property (strong, nonatomic) NSArray * _Nonnull logPayload; @end @interface CHIPApplianceStatisticsClusterLogQueueRequestPayload : NSObject @end @interface CHIPApplianceStatisticsClusterLogQueueResponsePayload : NSObject -@property (strong) NSNumber * _Nonnull LogQueueSize; -@property (strong) NSArray * _Nonnull LogIds; +@property (strong, nonatomic) NSNumber * _Nonnull logQueueSize; +@property (strong, nonatomic) NSArray * _Nonnull logIds; @end @interface CHIPApplianceStatisticsClusterStatisticsAvailablePayload : NSObject -@property (strong) NSNumber * _Nonnull LogQueueSize; -@property (strong) NSArray * _Nonnull LogIds; +@property (strong, nonatomic) NSNumber * _Nonnull logQueueSize; +@property (strong, nonatomic) NSArray * _Nonnull logIds; @end @interface CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandPayload : NSObject -@property (strong) NSNumber * _Nonnull ProfileCount; -@property (strong) NSNumber * _Nonnull ProfileIntervalPeriod; -@property (strong) NSNumber * _Nonnull MaxNumberOfIntervals; -@property (strong) NSArray * _Nonnull ListOfAttributes; +@property (strong, nonatomic) NSNumber * _Nonnull profileCount; +@property (strong, nonatomic) NSNumber * _Nonnull profileIntervalPeriod; +@property (strong, nonatomic) NSNumber * _Nonnull maxNumberOfIntervals; +@property (strong, nonatomic) NSArray * _Nonnull listOfAttributes; @end @interface CHIPElectricalMeasurementClusterGetProfileInfoCommandPayload : NSObject @end @interface CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandPayload : NSObject -@property (strong) NSNumber * _Nonnull StartTime; -@property (strong) NSNumber * _Nonnull Status; -@property (strong) NSNumber * _Nonnull ProfileIntervalPeriod; -@property (strong) NSNumber * _Nonnull NumberOfIntervalsDelivered; -@property (strong) NSNumber * _Nonnull AttributeId; -@property (strong) NSArray * _Nonnull Intervals; +@property (strong, nonatomic) NSNumber * _Nonnull startTime; +@property (strong, nonatomic) NSNumber * _Nonnull status; +@property (strong, nonatomic) NSNumber * _Nonnull profileIntervalPeriod; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfIntervalsDelivered; +@property (strong, nonatomic) NSNumber * _Nonnull attributeId; +@property (strong, nonatomic) NSArray * _Nonnull intervals; @end @interface CHIPElectricalMeasurementClusterGetMeasurementProfileCommandPayload : NSObject -@property (strong) NSNumber * _Nonnull AttributeId; -@property (strong) NSNumber * _Nonnull StartTime; -@property (strong) NSNumber * _Nonnull NumberOfIntervals; +@property (strong, nonatomic) NSNumber * _Nonnull attributeId; +@property (strong, nonatomic) NSNumber * _Nonnull startTime; +@property (strong, nonatomic) NSNumber * _Nonnull numberOfIntervals; @end @interface CHIPBindingClusterBindPayload : NSObject -@property (strong) NSNumber * _Nonnull NodeId; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull EndpointId; -@property (strong) NSNumber * _Nonnull ClusterId; +@property (strong, nonatomic) NSNumber * _Nonnull nodeId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull endpointId; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; @end @interface CHIPBindingClusterUnbindPayload : NSObject -@property (strong) NSNumber * _Nonnull NodeId; -@property (strong) NSNumber * _Nonnull GroupId; -@property (strong) NSNumber * _Nonnull EndpointId; -@property (strong) NSNumber * _Nonnull ClusterId; +@property (strong, nonatomic) NSNumber * _Nonnull nodeId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull endpointId; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; @end @interface CHIPSampleMfgSpecificClusterClusterCommandOnePayload : NSObject -@property (strong) NSNumber * _Nonnull ArgOne; +@property (strong, nonatomic) NSNumber * _Nonnull argOne; @end @interface CHIPSampleMfgSpecificCluster2ClusterCommandTwoPayload : NSObject -@property (strong) NSNumber * _Nonnull ArgOne; +@property (strong, nonatomic) NSNumber * _Nonnull argOne; @end #endif /* CHIP_COMMAND_PAYLOADS_H */ diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index f18a05783b8fcc..6caf8a65c767ef 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -23,313 +23,313 @@ #import @interface CHIPScenesClusterSceneExtensionFieldSet : NSObject -@property (strong) NSNumber * _Nonnull ClusterId; -@property (strong) NSNumber * _Nonnull Length; -@property (strong) NSNumber * _Nonnull Value; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; +@property (strong, nonatomic) NSNumber * _Nonnull length; +@property (strong, nonatomic) NSNumber * _Nonnull value; @end @interface CHIPPowerProfileClusterPowerProfileRecord : NSObject -@property (strong) NSNumber * _Nonnull PowerProfileId; -@property (strong) NSNumber * _Nonnull EnergyPhaseId; -@property (strong) NSNumber * _Nonnull PowerProfileRemoteControl; -@property (strong) NSNumber * _Nonnull PowerProfileState; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileId; +@property (strong, nonatomic) NSNumber * _Nonnull energyPhaseId; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileRemoteControl; +@property (strong, nonatomic) NSNumber * _Nonnull powerProfileState; @end @interface CHIPPowerProfileClusterScheduledPhase : NSObject -@property (strong) NSNumber * _Nonnull EnergyPhaseId; -@property (strong) NSNumber * _Nonnull ScheduledTime; +@property (strong, nonatomic) NSNumber * _Nonnull energyPhaseId; +@property (strong, nonatomic) NSNumber * _Nonnull scheduledTime; @end @interface CHIPPowerProfileClusterTransferredPhase : NSObject -@property (strong) NSNumber * _Nonnull EnergyPhaseId; -@property (strong) NSNumber * _Nonnull MacroPhaseId; -@property (strong) NSNumber * _Nonnull ExpectedDuration; -@property (strong) NSNumber * _Nonnull PeakPower; -@property (strong) NSNumber * _Nonnull Energy; -@property (strong) NSNumber * _Nonnull MaxActivationDelay; +@property (strong, nonatomic) NSNumber * _Nonnull energyPhaseId; +@property (strong, nonatomic) NSNumber * _Nonnull macroPhaseId; +@property (strong, nonatomic) NSNumber * _Nonnull expectedDuration; +@property (strong, nonatomic) NSNumber * _Nonnull peakPower; +@property (strong, nonatomic) NSNumber * _Nonnull energy; +@property (strong, nonatomic) NSNumber * _Nonnull maxActivationDelay; @end @interface CHIPDescriptorClusterDeviceType : NSObject -@property (strong) NSNumber * _Nonnull Type; -@property (strong) NSNumber * _Nonnull Revision; +@property (strong, nonatomic) NSNumber * _Nonnull type; +@property (strong, nonatomic) NSNumber * _Nonnull revision; @end @interface CHIPBridgedActionsClusterActionStruct : NSObject -@property (strong) NSNumber * _Nonnull ActionID; -@property (strong) NSString * _Nonnull Name; -@property (strong) NSNumber * _Nonnull Type; -@property (strong) NSNumber * _Nonnull EndpointListID; -@property (strong) NSNumber * _Nonnull SupportedCommands; -@property (strong) NSNumber * _Nonnull Status; +@property (strong, nonatomic) NSNumber * _Nonnull actionID; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSNumber * _Nonnull type; +@property (strong, nonatomic) NSNumber * _Nonnull endpointListID; +@property (strong, nonatomic) NSNumber * _Nonnull supportedCommands; +@property (strong, nonatomic) NSNumber * _Nonnull status; @end @interface CHIPBridgedActionsClusterEndpointListStruct : NSObject -@property (strong) NSNumber * _Nonnull EndpointListID; -@property (strong) NSString * _Nonnull Name; -@property (strong) NSNumber * _Nonnull Type; -@property (strong) NSData * _Nonnull Endpoints; +@property (strong, nonatomic) NSNumber * _Nonnull endpointListID; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSNumber * _Nonnull type; +@property (strong, nonatomic) NSData * _Nonnull endpoints; @end @interface CHIPGeneralCommissioningClusterBasicCommissioningInfoType : NSObject -@property (strong) NSNumber * _Nonnull FailSafeExpiryLengthMs; +@property (strong, nonatomic) NSNumber * _Nonnull failSafeExpiryLengthMs; @end @interface CHIPNetworkCommissioningClusterThreadInterfaceScanResult : NSObject -@property (strong) NSData * _Nonnull DiscoveryResponse; +@property (strong, nonatomic) NSData * _Nonnull discoveryResponse; @end @interface CHIPNetworkCommissioningClusterWiFiInterfaceScanResult : NSObject -@property (strong) NSNumber * _Nonnull Security; -@property (strong) NSData * _Nonnull Ssid; -@property (strong) NSData * _Nonnull Bssid; -@property (strong) NSNumber * _Nonnull Channel; -@property (strong) NSNumber * _Nonnull FrequencyBand; +@property (strong, nonatomic) NSNumber * _Nonnull security; +@property (strong, nonatomic) NSData * _Nonnull ssid; +@property (strong, nonatomic) NSData * _Nonnull bssid; +@property (strong, nonatomic) NSNumber * _Nonnull channel; +@property (strong, nonatomic) NSNumber * _Nonnull frequencyBand; @end @interface CHIPGeneralDiagnosticsClusterNetworkInterfaceType : NSObject -@property (strong) NSString * _Nonnull Name; -@property (strong) NSNumber * _Nonnull FabricConnected; -@property (strong) NSNumber * _Nonnull OffPremiseServicesReachableIPv4; -@property (strong) NSNumber * _Nonnull OffPremiseServicesReachableIPv6; -@property (strong) NSData * _Nonnull HardwareAddress; -@property (strong) NSNumber * _Nonnull Type; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSNumber * _Nonnull fabricConnected; +@property (strong, nonatomic) NSNumber * _Nonnull offPremiseServicesReachableIPv4; +@property (strong, nonatomic) NSNumber * _Nonnull offPremiseServicesReachableIPv6; +@property (strong, nonatomic) NSData * _Nonnull hardwareAddress; +@property (strong, nonatomic) NSNumber * _Nonnull type; @end @interface CHIPSoftwareDiagnosticsClusterSoftwareFault : NSObject -@property (strong) NSNumber * _Nonnull Id; -@property (strong) NSString * _Nonnull Name; -@property (strong) NSData * _Nonnull FaultRecording; +@property (strong, nonatomic) NSNumber * _Nonnull id; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSData * _Nonnull faultRecording; @end @interface CHIPSoftwareDiagnosticsClusterThreadMetrics : NSObject -@property (strong) NSNumber * _Nonnull Id; -@property (strong) NSString * _Nonnull Name; -@property (strong) NSNumber * _Nonnull StackFreeCurrent; -@property (strong) NSNumber * _Nonnull StackFreeMinimum; -@property (strong) NSNumber * _Nonnull StackSize; +@property (strong, nonatomic) NSNumber * _Nonnull id; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSNumber * _Nonnull stackFreeCurrent; +@property (strong, nonatomic) NSNumber * _Nonnull stackFreeMinimum; +@property (strong, nonatomic) NSNumber * _Nonnull stackSize; @end @interface CHIPThreadNetworkDiagnosticsClusterNeighborTable : NSObject -@property (strong) NSNumber * _Nonnull ExtAddress; -@property (strong) NSNumber * _Nonnull Age; -@property (strong) NSNumber * _Nonnull Rloc16; -@property (strong) NSNumber * _Nonnull LinkFrameCounter; -@property (strong) NSNumber * _Nonnull MleFrameCounter; -@property (strong) NSNumber * _Nonnull Lqi; -@property (strong) NSNumber * _Nonnull AverageRssi; -@property (strong) NSNumber * _Nonnull LastRssi; -@property (strong) NSNumber * _Nonnull FrameErrorRate; -@property (strong) NSNumber * _Nonnull MessageErrorRate; -@property (strong) NSNumber * _Nonnull RxOnWhenIdle; -@property (strong) NSNumber * _Nonnull FullThreadDevice; -@property (strong) NSNumber * _Nonnull FullNetworkData; -@property (strong) NSNumber * _Nonnull IsChild; +@property (strong, nonatomic) NSNumber * _Nonnull extAddress; +@property (strong, nonatomic) NSNumber * _Nonnull age; +@property (strong, nonatomic) NSNumber * _Nonnull rloc16; +@property (strong, nonatomic) NSNumber * _Nonnull linkFrameCounter; +@property (strong, nonatomic) NSNumber * _Nonnull mleFrameCounter; +@property (strong, nonatomic) NSNumber * _Nonnull lqi; +@property (strong, nonatomic) NSNumber * _Nonnull averageRssi; +@property (strong, nonatomic) NSNumber * _Nonnull lastRssi; +@property (strong, nonatomic) NSNumber * _Nonnull frameErrorRate; +@property (strong, nonatomic) NSNumber * _Nonnull messageErrorRate; +@property (strong, nonatomic) NSNumber * _Nonnull rxOnWhenIdle; +@property (strong, nonatomic) NSNumber * _Nonnull fullThreadDevice; +@property (strong, nonatomic) NSNumber * _Nonnull fullNetworkData; +@property (strong, nonatomic) NSNumber * _Nonnull isChild; @end @interface CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponents : NSObject -@property (strong) NSNumber * _Nonnull ActiveTimestampPresent; -@property (strong) NSNumber * _Nonnull PendingTimestampPresent; -@property (strong) NSNumber * _Nonnull MasterKeyPresent; -@property (strong) NSNumber * _Nonnull NetworkNamePresent; -@property (strong) NSNumber * _Nonnull ExtendedPanIdPresent; -@property (strong) NSNumber * _Nonnull MeshLocalPrefixPresent; -@property (strong) NSNumber * _Nonnull DelayPresent; -@property (strong) NSNumber * _Nonnull PanIdPresent; -@property (strong) NSNumber * _Nonnull ChannelPresent; -@property (strong) NSNumber * _Nonnull PskcPresent; -@property (strong) NSNumber * _Nonnull SecurityPolicyPresent; -@property (strong) NSNumber * _Nonnull ChannelMaskPresent; +@property (strong, nonatomic) NSNumber * _Nonnull activeTimestampPresent; +@property (strong, nonatomic) NSNumber * _Nonnull pendingTimestampPresent; +@property (strong, nonatomic) NSNumber * _Nonnull masterKeyPresent; +@property (strong, nonatomic) NSNumber * _Nonnull networkNamePresent; +@property (strong, nonatomic) NSNumber * _Nonnull extendedPanIdPresent; +@property (strong, nonatomic) NSNumber * _Nonnull meshLocalPrefixPresent; +@property (strong, nonatomic) NSNumber * _Nonnull delayPresent; +@property (strong, nonatomic) NSNumber * _Nonnull panIdPresent; +@property (strong, nonatomic) NSNumber * _Nonnull channelPresent; +@property (strong, nonatomic) NSNumber * _Nonnull pskcPresent; +@property (strong, nonatomic) NSNumber * _Nonnull securityPolicyPresent; +@property (strong, nonatomic) NSNumber * _Nonnull channelMaskPresent; @end @interface CHIPThreadNetworkDiagnosticsClusterRouteTable : NSObject -@property (strong) NSNumber * _Nonnull ExtAddress; -@property (strong) NSNumber * _Nonnull Rloc16; -@property (strong) NSNumber * _Nonnull RouterId; -@property (strong) NSNumber * _Nonnull NextHop; -@property (strong) NSNumber * _Nonnull PathCost; -@property (strong) NSNumber * _Nonnull LQIIn; -@property (strong) NSNumber * _Nonnull LQIOut; -@property (strong) NSNumber * _Nonnull Age; -@property (strong) NSNumber * _Nonnull Allocated; -@property (strong) NSNumber * _Nonnull LinkEstablished; +@property (strong, nonatomic) NSNumber * _Nonnull extAddress; +@property (strong, nonatomic) NSNumber * _Nonnull rloc16; +@property (strong, nonatomic) NSNumber * _Nonnull routerId; +@property (strong, nonatomic) NSNumber * _Nonnull nextHop; +@property (strong, nonatomic) NSNumber * _Nonnull pathCost; +@property (strong, nonatomic) NSNumber * _Nonnull lqiIn; +@property (strong, nonatomic) NSNumber * _Nonnull lqiOut; +@property (strong, nonatomic) NSNumber * _Nonnull age; +@property (strong, nonatomic) NSNumber * _Nonnull allocated; +@property (strong, nonatomic) NSNumber * _Nonnull linkEstablished; @end @interface CHIPThreadNetworkDiagnosticsClusterSecurityPolicy : NSObject -@property (strong) NSNumber * _Nonnull RotationTime; -@property (strong) NSNumber * _Nonnull Flags; +@property (strong, nonatomic) NSNumber * _Nonnull rotationTime; +@property (strong, nonatomic) NSNumber * _Nonnull flags; @end @interface CHIPOperationalCredentialsClusterFabricDescriptor : NSObject -@property (strong) NSNumber * _Nonnull FabricIndex; -@property (strong) NSData * _Nonnull RootPublicKey; -@property (strong) NSNumber * _Nonnull VendorId; -@property (strong) NSNumber * _Nonnull FabricId; -@property (strong) NSNumber * _Nonnull NodeId; -@property (strong) NSString * _Nonnull Label; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSData * _Nonnull rootPublicKey; +@property (strong, nonatomic) NSNumber * _Nonnull vendorId; +@property (strong, nonatomic) NSNumber * _Nonnull fabricId; +@property (strong, nonatomic) NSNumber * _Nonnull nodeId; +@property (strong, nonatomic) NSString * _Nonnull label; @end @interface CHIPOperationalCredentialsClusterNOCStruct : NSObject -@property (strong) NSNumber * _Nonnull FabricIndex; -@property (strong) NSData * _Nonnull Noc; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSData * _Nonnull noc; @end @interface CHIPFixedLabelClusterLabelStruct : NSObject -@property (strong) NSString * _Nonnull Label; -@property (strong) NSString * _Nonnull Value; +@property (strong, nonatomic) NSString * _Nonnull label; +@property (strong, nonatomic) NSString * _Nonnull value; @end @interface CHIPModeSelectClusterModeOptionStruct : NSObject -@property (strong) NSString * _Nonnull Label; -@property (strong) NSNumber * _Nonnull Mode; -@property (strong) NSNumber * _Nonnull SemanticTag; +@property (strong, nonatomic) NSString * _Nonnull label; +@property (strong, nonatomic) NSNumber * _Nonnull mode; +@property (strong, nonatomic) NSNumber * _Nonnull semanticTag; @end @interface CHIPModeSelectClusterSemanticTag : NSObject -@property (strong) NSNumber * _Nonnull MfgCode; -@property (strong) NSNumber * _Nonnull Value; +@property (strong, nonatomic) NSNumber * _Nonnull mfgCode; +@property (strong, nonatomic) NSNumber * _Nonnull value; @end @interface CHIPIasAceClusterIasAceZoneStatusResult : NSObject -@property (strong) NSNumber * _Nonnull ZoneId; -@property (strong) NSNumber * _Nonnull ZoneStatus; +@property (strong, nonatomic) NSNumber * _Nonnull zoneId; +@property (strong, nonatomic) NSNumber * _Nonnull zoneStatus; @end @interface CHIPTvChannelClusterTvChannelInfo : NSObject -@property (strong) NSNumber * _Nonnull MajorNumber; -@property (strong) NSNumber * _Nonnull MinorNumber; -@property (strong) NSString * _Nonnull Name; -@property (strong) NSString * _Nonnull CallSign; -@property (strong) NSString * _Nonnull AffiliateCallSign; +@property (strong, nonatomic) NSNumber * _Nonnull majorNumber; +@property (strong, nonatomic) NSNumber * _Nonnull minorNumber; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSString * _Nonnull callSign; +@property (strong, nonatomic) NSString * _Nonnull affiliateCallSign; @end @interface CHIPTvChannelClusterTvChannelLineupInfo : NSObject -@property (strong) NSString * _Nonnull OperatorName; -@property (strong) NSString * _Nonnull LineupName; -@property (strong) NSString * _Nonnull PostalCode; -@property (strong) NSNumber * _Nonnull LineupInfoType; +@property (strong, nonatomic) NSString * _Nonnull operatorName; +@property (strong, nonatomic) NSString * _Nonnull lineupName; +@property (strong, nonatomic) NSString * _Nonnull postalCode; +@property (strong, nonatomic) NSNumber * _Nonnull lineupInfoType; @end @interface CHIPTargetNavigatorClusterNavigateTargetTargetInfo : NSObject -@property (strong) NSNumber * _Nonnull Identifier; -@property (strong) NSString * _Nonnull Name; +@property (strong, nonatomic) NSNumber * _Nonnull identifier; +@property (strong, nonatomic) NSString * _Nonnull name; @end @interface CHIPMediaPlaybackClusterMediaPlaybackPosition : NSObject -@property (strong) NSNumber * _Nonnull UpdatedAt; -@property (strong) NSNumber * _Nonnull Position; +@property (strong, nonatomic) NSNumber * _Nonnull updatedAt; +@property (strong, nonatomic) NSNumber * _Nonnull position; @end @interface CHIPMediaInputClusterMediaInputInfo : NSObject -@property (strong) NSNumber * _Nonnull Index; -@property (strong) NSNumber * _Nonnull InputType; -@property (strong) NSString * _Nonnull Name; -@property (strong) NSString * _Nonnull Description; +@property (strong, nonatomic) NSNumber * _Nonnull index; +@property (strong, nonatomic) NSNumber * _Nonnull inputType; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSString * _Nonnull descriptionString; @end @interface CHIPContentLauncherClusterContentLaunchAdditionalInfo : NSObject -@property (strong) NSString * _Nonnull Name; -@property (strong) NSString * _Nonnull Value; +@property (strong, nonatomic) NSString * _Nonnull name; +@property (strong, nonatomic) NSString * _Nonnull value; @end @interface CHIPContentLauncherClusterContentLaunchParamater : NSObject -@property (strong) NSNumber * _Nonnull Type; -@property (strong) NSString * _Nonnull Value; -@property (strong) NSArray * _Nonnull ExternalIDList; +@property (strong, nonatomic) NSNumber * _Nonnull type; +@property (strong, nonatomic) NSString * _Nonnull value; +@property (strong, nonatomic) NSArray * _Nonnull externalIDList; @end @interface CHIPContentLauncherClusterContentLaunchBrandingInformation : NSObject -@property (strong) NSString * _Nonnull ProviderName; -@property (strong) NSNumber * _Nonnull Background; -@property (strong) NSNumber * _Nonnull Logo; -@property (strong) NSNumber * _Nonnull ProgressBar; -@property (strong) NSNumber * _Nonnull Splash; -@property (strong) NSNumber * _Nonnull WaterMark; +@property (strong, nonatomic) NSString * _Nonnull providerName; +@property (strong, nonatomic) NSNumber * _Nonnull background; +@property (strong, nonatomic) NSNumber * _Nonnull logo; +@property (strong, nonatomic) NSNumber * _Nonnull progressBar; +@property (strong, nonatomic) NSNumber * _Nonnull splash; +@property (strong, nonatomic) NSNumber * _Nonnull waterMark; @end @interface CHIPContentLauncherClusterContentLaunchDimension : NSObject -@property (strong) NSString * _Nonnull Width; -@property (strong) NSString * _Nonnull Height; -@property (strong) NSNumber * _Nonnull Metric; +@property (strong, nonatomic) NSString * _Nonnull width; +@property (strong, nonatomic) NSString * _Nonnull height; +@property (strong, nonatomic) NSNumber * _Nonnull metric; @end @interface CHIPContentLauncherClusterContentLaunchStyleInformation : NSObject -@property (strong) NSString * _Nonnull ImageUrl; -@property (strong) NSString * _Nonnull Color; -@property (strong) NSNumber * _Nonnull Size; +@property (strong, nonatomic) NSString * _Nonnull imageUrl; +@property (strong, nonatomic) NSString * _Nonnull color; +@property (strong, nonatomic) NSNumber * _Nonnull size; @end @interface CHIPAudioOutputClusterAudioOutputInfo : NSObject -@property (strong) NSNumber * _Nonnull Index; -@property (strong) NSNumber * _Nonnull OutputType; -@property (strong) NSString * _Nonnull Name; +@property (strong, nonatomic) NSNumber * _Nonnull index; +@property (strong, nonatomic) NSNumber * _Nonnull outputType; +@property (strong, nonatomic) NSString * _Nonnull name; @end @interface CHIPApplicationLauncherClusterApplicationLauncherApp : NSObject -@property (strong) NSNumber * _Nonnull CatalogVendorId; -@property (strong) NSString * _Nonnull ApplicationId; +@property (strong, nonatomic) NSNumber * _Nonnull catalogVendorId; +@property (strong, nonatomic) NSString * _Nonnull applicationId; @end @interface CHIPTestClusterClusterSimpleStruct : NSObject -@property (strong) NSNumber * _Nonnull A; -@property (strong) NSNumber * _Nonnull B; -@property (strong) NSNumber * _Nonnull C; -@property (strong) NSData * _Nonnull D; -@property (strong) NSString * _Nonnull E; -@property (strong) NSNumber * _Nonnull F; +@property (strong, nonatomic) NSNumber * _Nonnull a; +@property (strong, nonatomic) NSNumber * _Nonnull b; +@property (strong, nonatomic) NSNumber * _Nonnull c; +@property (strong, nonatomic) NSData * _Nonnull d; +@property (strong, nonatomic) NSString * _Nonnull e; +@property (strong, nonatomic) NSNumber * _Nonnull f; @end @interface CHIPTestClusterClusterNullablesAndOptionalsStruct : NSObject -@property (strong) NSNumber * _Nullable NullableInt; -@property (strong) NSNumber * _Nullable OptionalInt; -@property (strong) NSNumber * _Nullable NullableOptionalInt; -@property (strong) NSString * _Nullable NullableString; -@property (strong) NSString * _Nullable OptionalString; -@property (strong) NSString * _Nullable NullableOptionalString; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable NullableStruct; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable OptionalStruct; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nullable NullableOptionalStruct; -@property (strong) NSArray * _Nullable NullableList; -@property (strong) NSArray * _Nullable OptionalList; -@property (strong) NSArray * _Nullable NullableOptionalList; +@property (strong, nonatomic) NSNumber * _Nullable nullableInt; +@property (strong, nonatomic) NSNumber * _Nullable optionalInt; +@property (strong, nonatomic) NSNumber * _Nullable nullableOptionalInt; +@property (strong, nonatomic) NSString * _Nullable nullableString; +@property (strong, nonatomic) NSString * _Nullable optionalString; +@property (strong, nonatomic) NSString * _Nullable nullableOptionalString; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable nullableStruct; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable optionalStruct; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nullable nullableOptionalStruct; +@property (strong, nonatomic) NSArray * _Nullable nullableList; +@property (strong, nonatomic) NSArray * _Nullable optionalList; +@property (strong, nonatomic) NSArray * _Nullable nullableOptionalList; @end @interface CHIPTestClusterClusterNestedStruct : NSObject -@property (strong) NSNumber * _Nonnull A; -@property (strong) NSNumber * _Nonnull B; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nonnull C; +@property (strong, nonatomic) NSNumber * _Nonnull a; +@property (strong, nonatomic) NSNumber * _Nonnull b; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nonnull c; @end @interface CHIPTestClusterClusterNestedStructList : NSObject -@property (strong) NSNumber * _Nonnull A; -@property (strong) NSNumber * _Nonnull B; -@property (strong) CHIPTestClusterClusterSimpleStruct * _Nonnull C; -@property (strong) NSArray * _Nonnull D; -@property (strong) NSArray * _Nonnull E; -@property (strong) NSArray * _Nonnull F; -@property (strong) NSArray * _Nonnull G; +@property (strong, nonatomic) NSNumber * _Nonnull a; +@property (strong, nonatomic) NSNumber * _Nonnull b; +@property (strong, nonatomic) CHIPTestClusterClusterSimpleStruct * _Nonnull c; +@property (strong, nonatomic) NSArray * _Nonnull d; +@property (strong, nonatomic) NSArray * _Nonnull e; +@property (strong, nonatomic) NSArray * _Nonnull f; +@property (strong, nonatomic) NSArray * _Nonnull g; @end @interface CHIPTestClusterClusterDoubleNestedStructList : NSObject -@property (strong) NSArray * _Nonnull A; +@property (strong, nonatomic) NSArray * _Nonnull a; @end @interface CHIPTestClusterClusterTestListStructOctet : NSObject -@property (strong) NSNumber * _Nonnull FabricIndex; -@property (strong) NSData * _Nonnull OperationalCert; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSData * _Nonnull operationalCert; @end @interface CHIPGroupKeyManagementClusterGroupKey : NSObject -@property (strong) NSNumber * _Nonnull VendorId; -@property (strong) NSNumber * _Nonnull GroupKeyIndex; -@property (strong) NSData * _Nonnull GroupKeyRoot; -@property (strong) NSNumber * _Nonnull GroupKeyEpochStartTime; -@property (strong) NSNumber * _Nonnull GroupKeySecurityPolicy; +@property (strong, nonatomic) NSNumber * _Nonnull vendorId; +@property (strong, nonatomic) NSNumber * _Nonnull groupKeyIndex; +@property (strong, nonatomic) NSData * _Nonnull groupKeyRoot; +@property (strong, nonatomic) NSNumber * _Nonnull groupKeyEpochStartTime; +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySecurityPolicy; @end @interface CHIPGroupKeyManagementClusterGroupState : NSObject -@property (strong) NSNumber * _Nonnull VendorId; -@property (strong) NSNumber * _Nonnull VendorGroupId; -@property (strong) NSNumber * _Nonnull GroupKeySetIndex; +@property (strong, nonatomic) NSNumber * _Nonnull vendorId; +@property (strong, nonatomic) NSNumber * _Nonnull vendorGroupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetIndex; @end #endif /* CHIP_STRUCTS_H */ diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 3ca28ec889f8d0..ff46602de8a6c3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -320,11 +320,11 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPAudioOutputClusterAudioOutputInfo *) value[i]; - listHolder_0->mList[i].index = element_0.Index.unsignedCharValue; + listHolder_0->mList[i].index = element_0.index.unsignedCharValue; listHolder_0->mList[i].outputType = static_castmList[i].outputType)>>( - element_0.OutputType.unsignedCharValue); - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; + element_0.outputType.unsignedCharValue); + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -800,14 +800,14 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPBridgedActionsClusterActionStruct *) value[i]; - listHolder_0->mList[i].actionID = element_0.ActionID.unsignedShortValue; - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; + listHolder_0->mList[i].actionID = element_0.actionID.unsignedShortValue; + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; listHolder_0->mList[i].type = static_castmList[i].type)>>( - element_0.Type.unsignedCharValue); - listHolder_0->mList[i].endpointListID = element_0.EndpointListID.unsignedShortValue; - listHolder_0->mList[i].supportedCommands = element_0.SupportedCommands.unsignedShortValue; + element_0.type.unsignedCharValue); + listHolder_0->mList[i].endpointListID = element_0.endpointListID.unsignedShortValue; + listHolder_0->mList[i].supportedCommands = element_0.supportedCommands.unsignedShortValue; listHolder_0->mList[i].status = static_castmList[i].status)>>( - element_0.Status.unsignedCharValue); + element_0.status.unsignedCharValue); } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -841,11 +841,11 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPBridgedActionsClusterEndpointListStruct *) value[i]; - listHolder_0->mList[i].endpointListID = element_0.EndpointListID.unsignedShortValue; - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; + listHolder_0->mList[i].endpointListID = element_0.endpointListID.unsignedShortValue; + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; listHolder_0->mList[i].type = static_castmList[i].type)>>( - element_0.Type.unsignedCharValue); - listHolder_0->mList[i].endpoints = [self asByteSpan:element_0.Endpoints]; + element_0.type.unsignedCharValue); + listHolder_0->mList[i].endpoints = [self asByteSpan:element_0.endpoints]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -1743,8 +1743,8 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPDescriptorClusterDeviceType *) value[i]; - listHolder_0->mList[i].type = element_0.Type.unsignedIntValue; - listHolder_0->mList[i].revision = element_0.Revision.unsignedShortValue; + listHolder_0->mList[i].type = element_0.type.unsignedIntValue; + listHolder_0->mList[i].revision = element_0.revision.unsignedShortValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -2296,8 +2296,8 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPFixedLabelClusterLabelStruct *) value[i]; - listHolder_0->mList[i].label = [self asCharSpan:element_0.Label]; - listHolder_0->mList[i].value = [self asCharSpan:element_0.Value]; + listHolder_0->mList[i].label = [self asCharSpan:element_0.label]; + listHolder_0->mList[i].value = [self asCharSpan:element_0.value]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -2435,7 +2435,7 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPGeneralCommissioningClusterBasicCommissioningInfoType *) value[i]; - listHolder_0->mList[i].failSafeExpiryLengthMs = element_0.FailSafeExpiryLengthMs.unsignedIntValue; + listHolder_0->mList[i].failSafeExpiryLengthMs = element_0.failSafeExpiryLengthMs.unsignedIntValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -2495,13 +2495,13 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPGeneralDiagnosticsClusterNetworkInterfaceType *) value[i]; - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; - listHolder_0->mList[i].fabricConnected = element_0.FabricConnected.boolValue; - listHolder_0->mList[i].offPremiseServicesReachableIPv4 = element_0.OffPremiseServicesReachableIPv4.boolValue; - listHolder_0->mList[i].offPremiseServicesReachableIPv6 = element_0.OffPremiseServicesReachableIPv6.boolValue; - listHolder_0->mList[i].hardwareAddress = [self asByteSpan:element_0.HardwareAddress]; + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; + listHolder_0->mList[i].fabricConnected = element_0.fabricConnected.boolValue; + listHolder_0->mList[i].offPremiseServicesReachableIPv4 = element_0.offPremiseServicesReachableIPv4.boolValue; + listHolder_0->mList[i].offPremiseServicesReachableIPv6 = element_0.offPremiseServicesReachableIPv6.boolValue; + listHolder_0->mList[i].hardwareAddress = [self asByteSpan:element_0.hardwareAddress]; listHolder_0->mList[i].type = static_castmList[i].type)>>( - element_0.Type.unsignedCharValue); + element_0.type.unsignedCharValue); } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -2715,9 +2715,9 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPGroupKeyManagementClusterGroupState *) value[i]; - listHolder_0->mList[i].vendorId = element_0.VendorId.unsignedShortValue; - listHolder_0->mList[i].vendorGroupId = element_0.VendorGroupId.unsignedShortValue; - listHolder_0->mList[i].groupKeySetIndex = element_0.GroupKeySetIndex.unsignedShortValue; + listHolder_0->mList[i].vendorId = element_0.vendorId.unsignedShortValue; + listHolder_0->mList[i].vendorGroupId = element_0.vendorGroupId.unsignedShortValue; + listHolder_0->mList[i].groupKeySetIndex = element_0.groupKeySetIndex.unsignedShortValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -2751,13 +2751,13 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPGroupKeyManagementClusterGroupKey *) value[i]; - listHolder_0->mList[i].vendorId = element_0.VendorId.unsignedShortValue; - listHolder_0->mList[i].groupKeyIndex = element_0.GroupKeyIndex.unsignedShortValue; - listHolder_0->mList[i].groupKeyRoot = [self asByteSpan:element_0.GroupKeyRoot]; - listHolder_0->mList[i].groupKeyEpochStartTime = element_0.GroupKeyEpochStartTime.unsignedLongLongValue; + listHolder_0->mList[i].vendorId = element_0.vendorId.unsignedShortValue; + listHolder_0->mList[i].groupKeyIndex = element_0.groupKeyIndex.unsignedShortValue; + listHolder_0->mList[i].groupKeyRoot = [self asByteSpan:element_0.groupKeyRoot]; + listHolder_0->mList[i].groupKeyEpochStartTime = element_0.groupKeyEpochStartTime.unsignedLongLongValue; listHolder_0->mList[i].groupKeySecurityPolicy = static_castmList[i].groupKeySecurityPolicy)>>( - element_0.GroupKeySecurityPolicy.unsignedCharValue); + element_0.groupKeySecurityPolicy.unsignedCharValue); } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -3175,12 +3175,12 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPMediaInputClusterMediaInputInfo *) value[i]; - listHolder_0->mList[i].index = element_0.Index.unsignedCharValue; + listHolder_0->mList[i].index = element_0.index.unsignedCharValue; listHolder_0->mList[i].inputType = static_castmList[i].inputType)>>( - element_0.InputType.unsignedCharValue); - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; - listHolder_0->mList[i].description = [self asCharSpan:element_0.Description]; + element_0.inputType.unsignedCharValue); + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; + listHolder_0->mList[i].description = [self asCharSpan:element_0.descriptionString]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -3396,9 +3396,9 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPModeSelectClusterModeOptionStruct *) value[i]; - listHolder_0->mList[i].label = [self asCharSpan:element_0.Label]; - listHolder_0->mList[i].mode = element_0.Mode.unsignedCharValue; - listHolder_0->mList[i].semanticTag = element_0.SemanticTag.unsignedIntValue; + listHolder_0->mList[i].label = [self asCharSpan:element_0.label]; + listHolder_0->mList[i].mode = element_0.mode.unsignedCharValue; + listHolder_0->mList[i].semanticTag = element_0.semanticTag.unsignedIntValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -3757,12 +3757,12 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPOperationalCredentialsClusterFabricDescriptor *) value[i]; - listHolder_0->mList[i].fabricIndex = element_0.FabricIndex.unsignedCharValue; - listHolder_0->mList[i].rootPublicKey = [self asByteSpan:element_0.RootPublicKey]; - listHolder_0->mList[i].vendorId = element_0.VendorId.unsignedShortValue; - listHolder_0->mList[i].fabricId = element_0.FabricId.unsignedLongLongValue; - listHolder_0->mList[i].nodeId = element_0.NodeId.unsignedLongLongValue; - listHolder_0->mList[i].label = [self asCharSpan:element_0.Label]; + listHolder_0->mList[i].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i].rootPublicKey = [self asByteSpan:element_0.rootPublicKey]; + listHolder_0->mList[i].vendorId = element_0.vendorId.unsignedShortValue; + listHolder_0->mList[i].fabricId = element_0.fabricId.unsignedLongLongValue; + listHolder_0->mList[i].nodeId = element_0.nodeId.unsignedLongLongValue; + listHolder_0->mList[i].label = [self asCharSpan:element_0.label]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -4605,11 +4605,11 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPSoftwareDiagnosticsClusterThreadMetrics *) value[i]; - listHolder_0->mList[i].id = element_0.Id.unsignedLongLongValue; - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; - listHolder_0->mList[i].stackFreeCurrent = element_0.StackFreeCurrent.unsignedIntValue; - listHolder_0->mList[i].stackFreeMinimum = element_0.StackFreeMinimum.unsignedIntValue; - listHolder_0->mList[i].stackSize = element_0.StackSize.unsignedIntValue; + listHolder_0->mList[i].id = element_0.id.unsignedLongLongValue; + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; + listHolder_0->mList[i].stackFreeCurrent = element_0.stackFreeCurrent.unsignedIntValue; + listHolder_0->mList[i].stackFreeMinimum = element_0.stackFreeMinimum.unsignedIntValue; + listHolder_0->mList[i].stackSize = element_0.stackSize.unsignedIntValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -4786,11 +4786,11 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPTvChannelClusterTvChannelInfo *) value[i]; - listHolder_0->mList[i].majorNumber = element_0.MajorNumber.unsignedShortValue; - listHolder_0->mList[i].minorNumber = element_0.MinorNumber.unsignedShortValue; - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; - listHolder_0->mList[i].callSign = [self asCharSpan:element_0.CallSign]; - listHolder_0->mList[i].affiliateCallSign = [self asCharSpan:element_0.AffiliateCallSign]; + listHolder_0->mList[i].majorNumber = element_0.majorNumber.unsignedShortValue; + listHolder_0->mList[i].minorNumber = element_0.minorNumber.unsignedShortValue; + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; + listHolder_0->mList[i].callSign = [self asCharSpan:element_0.callSign]; + listHolder_0->mList[i].affiliateCallSign = [self asCharSpan:element_0.affiliateCallSign]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -4876,8 +4876,8 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPTargetNavigatorClusterNavigateTargetTargetInfo *) value[i]; - listHolder_0->mList[i].identifier = element_0.Identifier.unsignedCharValue; - listHolder_0->mList[i].name = [self asCharSpan:element_0.Name]; + listHolder_0->mList[i].identifier = element_0.identifier.unsignedCharValue; + listHolder_0->mList[i].name = [self asCharSpan:element_0.name]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -5083,8 +5083,8 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPTestClusterClusterTestListStructOctet *) value[i]; - listHolder_0->mList[i].fabricIndex = element_0.FabricIndex.unsignedLongLongValue; - listHolder_0->mList[i].operationalCert = [self asByteSpan:element_0.OperationalCert]; + listHolder_0->mList[i].fabricIndex = element_0.fabricIndex.unsignedLongLongValue; + listHolder_0->mList[i].operationalCert = [self asByteSpan:element_0.operationalCert]; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -5119,164 +5119,164 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPTestClusterClusterNullablesAndOptionalsStruct *) value[i]; - if (element_0.NullableInt == nil) { + if (element_0.nullableInt == nil) { listHolder_0->mList[i].nullableInt.SetNull(); } else { auto & nonNullValue_2 = listHolder_0->mList[i].nullableInt.SetNonNull(); - nonNullValue_2 = element_0.NullableInt.unsignedShortValue; + nonNullValue_2 = element_0.nullableInt.unsignedShortValue; } - if (element_0.OptionalInt != nil) { + if (element_0.optionalInt != nil) { auto & definedValue_2 = listHolder_0->mList[i].optionalInt.Emplace(); - definedValue_2 = element_0.OptionalInt.unsignedShortValue; + definedValue_2 = element_0.optionalInt.unsignedShortValue; } - if (element_0.NullableOptionalInt != nil) { + if (element_0.nullableOptionalInt != nil) { auto & definedValue_2 = listHolder_0->mList[i].nullableOptionalInt.Emplace(); - if (element_0.NullableOptionalInt == nil) { + if (element_0.nullableOptionalInt == nil) { definedValue_2.SetNull(); } else { auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.NullableOptionalInt.unsignedShortValue; + nonNullValue_3 = element_0.nullableOptionalInt.unsignedShortValue; } } - if (element_0.NullableString == nil) { + if (element_0.nullableString == nil) { listHolder_0->mList[i].nullableString.SetNull(); } else { auto & nonNullValue_2 = listHolder_0->mList[i].nullableString.SetNonNull(); - nonNullValue_2 = [self asCharSpan:element_0.NullableString]; + nonNullValue_2 = [self asCharSpan:element_0.nullableString]; } - if (element_0.OptionalString != nil) { + if (element_0.optionalString != nil) { auto & definedValue_2 = listHolder_0->mList[i].optionalString.Emplace(); - definedValue_2 = [self asCharSpan:element_0.OptionalString]; + definedValue_2 = [self asCharSpan:element_0.optionalString]; } - if (element_0.NullableOptionalString != nil) { + if (element_0.nullableOptionalString != nil) { auto & definedValue_2 = listHolder_0->mList[i].nullableOptionalString.Emplace(); - if (element_0.NullableOptionalString == nil) { + if (element_0.nullableOptionalString == nil) { definedValue_2.SetNull(); } else { auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = [self asCharSpan:element_0.NullableOptionalString]; + nonNullValue_3 = [self asCharSpan:element_0.nullableOptionalString]; } } - if (element_0.NullableStruct == nil) { + if (element_0.nullableStruct == nil) { listHolder_0->mList[i].nullableStruct.SetNull(); } else { auto & nonNullValue_2 = listHolder_0->mList[i].nullableStruct.SetNonNull(); - nonNullValue_2.a = element_0.NullableStruct.A.unsignedCharValue; - nonNullValue_2.b = element_0.NullableStruct.B.boolValue; + nonNullValue_2.a = element_0.nullableStruct.a.unsignedCharValue; + nonNullValue_2.b = element_0.nullableStruct.b.boolValue; nonNullValue_2.c = static_cast>( - element_0.NullableStruct.C.unsignedCharValue); - nonNullValue_2.d = [self asByteSpan:element_0.NullableStruct.D]; - nonNullValue_2.e = [self asCharSpan:element_0.NullableStruct.E]; + element_0.nullableStruct.c.unsignedCharValue); + nonNullValue_2.d = [self asByteSpan:element_0.nullableStruct.d]; + nonNullValue_2.e = [self asCharSpan:element_0.nullableStruct.e]; nonNullValue_2.f = static_cast>( - element_0.NullableStruct.F.unsignedCharValue); + element_0.nullableStruct.f.unsignedCharValue); } - if (element_0.OptionalStruct != nil) { + if (element_0.optionalStruct != nil) { auto & definedValue_2 = listHolder_0->mList[i].optionalStruct.Emplace(); - definedValue_2.a = element_0.OptionalStruct.A.unsignedCharValue; - definedValue_2.b = element_0.OptionalStruct.B.boolValue; + definedValue_2.a = element_0.optionalStruct.a.unsignedCharValue; + definedValue_2.b = element_0.optionalStruct.b.boolValue; definedValue_2.c = static_cast>( - element_0.OptionalStruct.C.unsignedCharValue); - definedValue_2.d = [self asByteSpan:element_0.OptionalStruct.D]; - definedValue_2.e = [self asCharSpan:element_0.OptionalStruct.E]; + element_0.optionalStruct.c.unsignedCharValue); + definedValue_2.d = [self asByteSpan:element_0.optionalStruct.d]; + definedValue_2.e = [self asCharSpan:element_0.optionalStruct.e]; definedValue_2.f = static_cast>( - element_0.OptionalStruct.F.unsignedCharValue); + element_0.optionalStruct.f.unsignedCharValue); } - if (element_0.NullableOptionalStruct != nil) { + if (element_0.nullableOptionalStruct != nil) { auto & definedValue_2 = listHolder_0->mList[i].nullableOptionalStruct.Emplace(); - if (element_0.NullableOptionalStruct == nil) { + if (element_0.nullableOptionalStruct == nil) { definedValue_2.SetNull(); } else { auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3.a = element_0.NullableOptionalStruct.A.unsignedCharValue; - nonNullValue_3.b = element_0.NullableOptionalStruct.B.boolValue; + nonNullValue_3.a = element_0.nullableOptionalStruct.a.unsignedCharValue; + nonNullValue_3.b = element_0.nullableOptionalStruct.b.boolValue; nonNullValue_3.c = static_cast>( - element_0.NullableOptionalStruct.C.unsignedCharValue); - nonNullValue_3.d = [self asByteSpan:element_0.NullableOptionalStruct.D]; - nonNullValue_3.e = [self asCharSpan:element_0.NullableOptionalStruct.E]; + element_0.nullableOptionalStruct.c.unsignedCharValue); + nonNullValue_3.d = [self asByteSpan:element_0.nullableOptionalStruct.d]; + nonNullValue_3.e = [self asCharSpan:element_0.nullableOptionalStruct.e]; nonNullValue_3.f = static_cast>( - element_0.NullableOptionalStruct.F.unsignedCharValue); + element_0.nullableOptionalStruct.f.unsignedCharValue); } } - if (element_0.NullableList == nil) { + if (element_0.nullableList == nil) { listHolder_0->mList[i].nullableList.SetNull(); } else { auto & nonNullValue_2 = listHolder_0->mList[i].nullableList.SetNonNull(); { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (element_0.NullableList.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.NullableList.count); + if (element_0.nullableList.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.nullableList.count); if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } listFreer.add(listHolder_3); - for (size_t i = 0; i < element_0.NullableList.count; ++i) { - if (![element_0.NullableList[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < element_0.nullableList.count; ++i) { + if (![element_0.nullableList[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_3 = (NSNumber *) element_0.NullableList[i]; + auto element_3 = (NSNumber *) element_0.nullableList[i]; listHolder_3->mList[i] = static_castmList[i])>>( element_3.unsignedCharValue); } - nonNullValue_2 = ListType(listHolder_3->mList, element_0.NullableList.count); + nonNullValue_2 = ListType(listHolder_3->mList, element_0.nullableList.count); } else { nonNullValue_2 = ListType(); } } } - if (element_0.OptionalList != nil) { + if (element_0.optionalList != nil) { auto & definedValue_2 = listHolder_0->mList[i].optionalList.Emplace(); { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (element_0.OptionalList.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.OptionalList.count); + if (element_0.optionalList.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.optionalList.count); if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } listFreer.add(listHolder_3); - for (size_t i = 0; i < element_0.OptionalList.count; ++i) { - if (![element_0.OptionalList[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < element_0.optionalList.count; ++i) { + if (![element_0.optionalList[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_3 = (NSNumber *) element_0.OptionalList[i]; + auto element_3 = (NSNumber *) element_0.optionalList[i]; listHolder_3->mList[i] = static_castmList[i])>>( element_3.unsignedCharValue); } - definedValue_2 = ListType(listHolder_3->mList, element_0.OptionalList.count); + definedValue_2 = ListType(listHolder_3->mList, element_0.optionalList.count); } else { definedValue_2 = ListType(); } } } - if (element_0.NullableOptionalList != nil) { + if (element_0.nullableOptionalList != nil) { auto & definedValue_2 = listHolder_0->mList[i].nullableOptionalList.Emplace(); - if (element_0.NullableOptionalList == nil) { + if (element_0.nullableOptionalList == nil) { definedValue_2.SetNull(); } else { auto & nonNullValue_3 = definedValue_2.SetNonNull(); { using ListType = std::remove_reference_t; using ListMemberType = ListMemberTypeGetter::Type; - if (element_0.NullableOptionalList.count != 0) { - auto * listHolder_4 = new ListHolder(element_0.NullableOptionalList.count); + if (element_0.nullableOptionalList.count != 0) { + auto * listHolder_4 = new ListHolder(element_0.nullableOptionalList.count); if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } listFreer.add(listHolder_4); - for (size_t i = 0; i < element_0.NullableOptionalList.count; ++i) { - if (![element_0.NullableOptionalList[i] isKindOfClass:[NSNumber class]]) { + for (size_t i = 0; i < element_0.nullableOptionalList.count; ++i) { + if (![element_0.nullableOptionalList[i] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_4 = (NSNumber *) element_0.NullableOptionalList[i]; + auto element_4 = (NSNumber *) element_0.nullableOptionalList[i]; listHolder_4->mList[i] = static_castmList[i])>>( element_4.unsignedCharValue); } - nonNullValue_3 = ListType(listHolder_4->mList, element_0.NullableOptionalList.count); + nonNullValue_3 = ListType(listHolder_4->mList, element_0.nullableOptionalList.count); } else { nonNullValue_3 = ListType(); } @@ -5602,20 +5602,20 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPThreadNetworkDiagnosticsClusterNeighborTable *) value[i]; - listHolder_0->mList[i].extAddress = element_0.ExtAddress.unsignedLongLongValue; - listHolder_0->mList[i].age = element_0.Age.unsignedIntValue; - listHolder_0->mList[i].rloc16 = element_0.Rloc16.unsignedShortValue; - listHolder_0->mList[i].linkFrameCounter = element_0.LinkFrameCounter.unsignedIntValue; - listHolder_0->mList[i].mleFrameCounter = element_0.MleFrameCounter.unsignedIntValue; - listHolder_0->mList[i].lqi = element_0.Lqi.unsignedCharValue; - listHolder_0->mList[i].averageRssi = element_0.AverageRssi.charValue; - listHolder_0->mList[i].lastRssi = element_0.LastRssi.charValue; - listHolder_0->mList[i].frameErrorRate = element_0.FrameErrorRate.unsignedCharValue; - listHolder_0->mList[i].messageErrorRate = element_0.MessageErrorRate.unsignedCharValue; - listHolder_0->mList[i].rxOnWhenIdle = element_0.RxOnWhenIdle.boolValue; - listHolder_0->mList[i].fullThreadDevice = element_0.FullThreadDevice.boolValue; - listHolder_0->mList[i].fullNetworkData = element_0.FullNetworkData.boolValue; - listHolder_0->mList[i].isChild = element_0.IsChild.boolValue; + listHolder_0->mList[i].extAddress = element_0.extAddress.unsignedLongLongValue; + listHolder_0->mList[i].age = element_0.age.unsignedIntValue; + listHolder_0->mList[i].rloc16 = element_0.rloc16.unsignedShortValue; + listHolder_0->mList[i].linkFrameCounter = element_0.linkFrameCounter.unsignedIntValue; + listHolder_0->mList[i].mleFrameCounter = element_0.mleFrameCounter.unsignedIntValue; + listHolder_0->mList[i].lqi = element_0.lqi.unsignedCharValue; + listHolder_0->mList[i].averageRssi = element_0.averageRssi.charValue; + listHolder_0->mList[i].lastRssi = element_0.lastRssi.charValue; + listHolder_0->mList[i].frameErrorRate = element_0.frameErrorRate.unsignedCharValue; + listHolder_0->mList[i].messageErrorRate = element_0.messageErrorRate.unsignedCharValue; + listHolder_0->mList[i].rxOnWhenIdle = element_0.rxOnWhenIdle.boolValue; + listHolder_0->mList[i].fullThreadDevice = element_0.fullThreadDevice.boolValue; + listHolder_0->mList[i].fullNetworkData = element_0.fullNetworkData.boolValue; + listHolder_0->mList[i].isChild = element_0.isChild.boolValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -5649,16 +5649,16 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPThreadNetworkDiagnosticsClusterRouteTable *) value[i]; - listHolder_0->mList[i].extAddress = element_0.ExtAddress.unsignedLongLongValue; - listHolder_0->mList[i].rloc16 = element_0.Rloc16.unsignedShortValue; - listHolder_0->mList[i].routerId = element_0.RouterId.unsignedCharValue; - listHolder_0->mList[i].nextHop = element_0.NextHop.unsignedCharValue; - listHolder_0->mList[i].pathCost = element_0.PathCost.unsignedCharValue; - listHolder_0->mList[i].LQIIn = element_0.LQIIn.unsignedCharValue; - listHolder_0->mList[i].LQIOut = element_0.LQIOut.unsignedCharValue; - listHolder_0->mList[i].age = element_0.Age.unsignedCharValue; - listHolder_0->mList[i].allocated = element_0.Allocated.boolValue; - listHolder_0->mList[i].linkEstablished = element_0.LinkEstablished.boolValue; + listHolder_0->mList[i].extAddress = element_0.extAddress.unsignedLongLongValue; + listHolder_0->mList[i].rloc16 = element_0.rloc16.unsignedShortValue; + listHolder_0->mList[i].routerId = element_0.routerId.unsignedCharValue; + listHolder_0->mList[i].nextHop = element_0.nextHop.unsignedCharValue; + listHolder_0->mList[i].pathCost = element_0.pathCost.unsignedCharValue; + listHolder_0->mList[i].LQIIn = element_0.lqiIn.unsignedCharValue; + listHolder_0->mList[i].LQIOut = element_0.lqiOut.unsignedCharValue; + listHolder_0->mList[i].age = element_0.age.unsignedCharValue; + listHolder_0->mList[i].allocated = element_0.allocated.boolValue; + listHolder_0->mList[i].linkEstablished = element_0.linkEstablished.boolValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -6345,8 +6345,8 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPThreadNetworkDiagnosticsClusterSecurityPolicy *) value[i]; - listHolder_0->mList[i].rotationTime = element_0.RotationTime.unsignedShortValue; - listHolder_0->mList[i].flags = element_0.Flags.unsignedShortValue; + listHolder_0->mList[i].rotationTime = element_0.rotationTime.unsignedShortValue; + listHolder_0->mList[i].flags = element_0.flags.unsignedShortValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { @@ -6394,18 +6394,18 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponents *) value[i]; - listHolder_0->mList[i].activeTimestampPresent = element_0.ActiveTimestampPresent.boolValue; - listHolder_0->mList[i].pendingTimestampPresent = element_0.PendingTimestampPresent.boolValue; - listHolder_0->mList[i].masterKeyPresent = element_0.MasterKeyPresent.boolValue; - listHolder_0->mList[i].networkNamePresent = element_0.NetworkNamePresent.boolValue; - listHolder_0->mList[i].extendedPanIdPresent = element_0.ExtendedPanIdPresent.boolValue; - listHolder_0->mList[i].meshLocalPrefixPresent = element_0.MeshLocalPrefixPresent.boolValue; - listHolder_0->mList[i].delayPresent = element_0.DelayPresent.boolValue; - listHolder_0->mList[i].panIdPresent = element_0.PanIdPresent.boolValue; - listHolder_0->mList[i].channelPresent = element_0.ChannelPresent.boolValue; - listHolder_0->mList[i].pskcPresent = element_0.PskcPresent.boolValue; - listHolder_0->mList[i].securityPolicyPresent = element_0.SecurityPolicyPresent.boolValue; - listHolder_0->mList[i].channelMaskPresent = element_0.ChannelMaskPresent.boolValue; + listHolder_0->mList[i].activeTimestampPresent = element_0.activeTimestampPresent.boolValue; + listHolder_0->mList[i].pendingTimestampPresent = element_0.pendingTimestampPresent.boolValue; + listHolder_0->mList[i].masterKeyPresent = element_0.masterKeyPresent.boolValue; + listHolder_0->mList[i].networkNamePresent = element_0.networkNamePresent.boolValue; + listHolder_0->mList[i].extendedPanIdPresent = element_0.extendedPanIdPresent.boolValue; + listHolder_0->mList[i].meshLocalPrefixPresent = element_0.meshLocalPrefixPresent.boolValue; + listHolder_0->mList[i].delayPresent = element_0.delayPresent.boolValue; + listHolder_0->mList[i].panIdPresent = element_0.panIdPresent.boolValue; + listHolder_0->mList[i].channelPresent = element_0.channelPresent.boolValue; + listHolder_0->mList[i].pskcPresent = element_0.pskcPresent.boolValue; + listHolder_0->mList[i].securityPolicyPresent = element_0.securityPolicyPresent.boolValue; + listHolder_0->mList[i].channelMaskPresent = element_0.channelMaskPresent.boolValue; } cppValue = ListType(listHolder_0->mList, value.count); } else { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 33a8a47d2e99bc..d10d1bee5c7575 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -4173,11 +4173,11 @@ - (void)testSendClusterTest_TC_CC_3_1_000002_MoveToHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToHuePayload alloc] init]; - payload.Hue = [NSNumber numberWithUnsignedChar:150]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:100U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.hue = [NSNumber numberWithUnsignedChar:150]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move to hue shortest distance command Error: %@", err); @@ -4199,11 +4199,11 @@ - (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToHuePayload alloc] init]; - payload.Hue = [NSNumber numberWithUnsignedChar:200]; - payload.Direction = [NSNumber numberWithUnsignedChar:1]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:100U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.hue = [NSNumber numberWithUnsignedChar:200]; + payload.direction = [NSNumber numberWithUnsignedChar:1]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move to hue longest distance command Error: %@", err); @@ -4225,11 +4225,11 @@ - (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToHuePayload alloc] init]; - payload.Hue = [NSNumber numberWithUnsignedChar:250]; - payload.Direction = [NSNumber numberWithUnsignedChar:2]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:100U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.hue = [NSNumber numberWithUnsignedChar:250]; + payload.direction = [NSNumber numberWithUnsignedChar:2]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move to hue up command Error: %@", err); @@ -4251,11 +4251,11 @@ - (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToHuePayload alloc] init]; - payload.Hue = [NSNumber numberWithUnsignedChar:225]; - payload.Direction = [NSNumber numberWithUnsignedChar:3]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:100U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.hue = [NSNumber numberWithUnsignedChar:225]; + payload.direction = [NSNumber numberWithUnsignedChar:3]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move to hue down command Error: %@", err); @@ -4368,10 +4368,10 @@ - (void)testSendClusterTest_TC_CC_3_2_000002_MoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:1]; - payload.Rate = [NSNumber numberWithUnsignedChar:50]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:1]; + payload.rate = [NSNumber numberWithUnsignedChar:50]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move hue up command Error: %@", err); @@ -4393,10 +4393,10 @@ - (void)testSendClusterTest_TC_CC_3_2_000003_MoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedChar:50]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedChar:50]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move hue stop command Error: %@", err); @@ -4418,10 +4418,10 @@ - (void)testSendClusterTest_TC_CC_3_2_000004_MoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:3]; - payload.Rate = [NSNumber numberWithUnsignedChar:50]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:3]; + payload.rate = [NSNumber numberWithUnsignedChar:50]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move hue down command Error: %@", err); @@ -4443,10 +4443,10 @@ - (void)testSendClusterTest_TC_CC_3_2_000005_MoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedChar:50]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedChar:50]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move hue stop command Error: %@", err); @@ -4559,11 +4559,11 @@ - (void)testSendClusterTest_TC_CC_3_3_000002_StepHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepHuePayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:1]; - payload.StepSize = [NSNumber numberWithUnsignedChar:5]; - payload.TransitionTime = [NSNumber numberWithUnsignedChar:25]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:1]; + payload.stepSize = [NSNumber numberWithUnsignedChar:5]; + payload.transitionTime = [NSNumber numberWithUnsignedChar:25]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step hue up command Error: %@", err); @@ -4585,11 +4585,11 @@ - (void)testSendClusterTest_TC_CC_3_3_000003_StepHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepHuePayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:3]; - payload.StepSize = [NSNumber numberWithUnsignedChar:5]; - payload.TransitionTime = [NSNumber numberWithUnsignedChar:25]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:3]; + payload.stepSize = [NSNumber numberWithUnsignedChar:5]; + payload.transitionTime = [NSNumber numberWithUnsignedChar:25]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step hue down command Error: %@", err); @@ -4702,10 +4702,10 @@ - (void)testSendClusterTest_TC_CC_4_1_000002_MoveToSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToSaturationPayload alloc] init]; - payload.Saturation = [NSNumber numberWithUnsignedChar:90]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:10U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.saturation = [NSNumber numberWithUnsignedChar:90]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move to saturation command Error: %@", err); @@ -4818,10 +4818,10 @@ - (void)testSendClusterTest_TC_CC_4_2_000002_MoveSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveSaturationPayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:1]; - payload.Rate = [NSNumber numberWithUnsignedChar:5]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:1]; + payload.rate = [NSNumber numberWithUnsignedChar:5]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move saturation up command Error: %@", err); @@ -4843,10 +4843,10 @@ - (void)testSendClusterTest_TC_CC_4_2_000003_MoveSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveSaturationPayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:3]; - payload.Rate = [NSNumber numberWithUnsignedChar:5]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:3]; + payload.rate = [NSNumber numberWithUnsignedChar:5]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move saturation down command Error: %@", err); @@ -4959,11 +4959,11 @@ - (void)testSendClusterTest_TC_CC_4_3_000002_StepSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepSaturationPayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:1]; - payload.StepSize = [NSNumber numberWithUnsignedChar:15]; - payload.TransitionTime = [NSNumber numberWithUnsignedChar:10]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:1]; + payload.stepSize = [NSNumber numberWithUnsignedChar:15]; + payload.transitionTime = [NSNumber numberWithUnsignedChar:10]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step saturation up command Error: %@", err); @@ -4985,11 +4985,11 @@ - (void)testSendClusterTest_TC_CC_4_3_000003_StepSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepSaturationPayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:3]; - payload.StepSize = [NSNumber numberWithUnsignedChar:20]; - payload.TransitionTime = [NSNumber numberWithUnsignedChar:10]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:3]; + payload.stepSize = [NSNumber numberWithUnsignedChar:20]; + payload.transitionTime = [NSNumber numberWithUnsignedChar:10]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step saturation down command Error: %@", err); @@ -5102,11 +5102,11 @@ - (void)testSendClusterTest_TC_CC_4_4_000002_MoveToHueAndSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToHueAndSaturationPayload alloc] init]; - payload.Hue = [NSNumber numberWithUnsignedChar:40]; - payload.Saturation = [NSNumber numberWithUnsignedChar:160]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:10U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.hue = [NSNumber numberWithUnsignedChar:40]; + payload.saturation = [NSNumber numberWithUnsignedChar:160]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHueAndSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move To current hue and saturation command Error: %@", err); @@ -5219,11 +5219,11 @@ - (void)testSendClusterTest_TC_CC_5_1_000002_MoveToColor XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToColorPayload alloc] init]; - payload.ColorX = [NSNumber numberWithUnsignedShort:200U]; - payload.ColorY = [NSNumber numberWithUnsignedShort:300U]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:20U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.colorX = [NSNumber numberWithUnsignedShort:200U]; + payload.colorY = [NSNumber numberWithUnsignedShort:300U]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToColor:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move to Color command Error: %@", err); @@ -5336,10 +5336,10 @@ - (void)testSendClusterTest_TC_CC_5_2_000002_MoveColor XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveColorPayload alloc] init]; - payload.RateX = [NSNumber numberWithShort:15]; - payload.RateY = [NSNumber numberWithShort:20]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.rateX = [NSNumber numberWithShort:15]; + payload.rateY = [NSNumber numberWithShort:20]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveColor:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move Color command Error: %@", err); @@ -5361,8 +5361,8 @@ - (void)testSendClusterTest_TC_CC_5_2_000003_StopMoveStep XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStopMoveStepPayload alloc] init]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stopMoveStep:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Stop Move Step command Error: %@", err); @@ -5475,11 +5475,11 @@ - (void)testSendClusterTest_TC_CC_5_3_000002_StepColor XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepColorPayload alloc] init]; - payload.StepX = [NSNumber numberWithShort:15]; - payload.StepY = [NSNumber numberWithShort:20]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:50U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepX = [NSNumber numberWithShort:15]; + payload.stepY = [NSNumber numberWithShort:20]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepColor:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step Color command Error: %@", err); @@ -5592,10 +5592,10 @@ - (void)testSendClusterTest_TC_CC_6_1_000002_MoveToColorTemperature XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveToColorTemperaturePayload alloc] init]; - payload.ColorTemperature = [NSNumber numberWithUnsignedShort:100U]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:10U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.colorTemperature = [NSNumber numberWithUnsignedShort:100U]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToColorTemperature:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move To Color Temperature command Error: %@", err); @@ -5708,12 +5708,12 @@ - (void)testSendClusterTest_TC_CC_6_2_000002_MoveColorTemperature XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveColorTemperaturePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:1]; - payload.Rate = [NSNumber numberWithUnsignedShort:10U]; - payload.ColorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - payload.ColorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:1]; + payload.rate = [NSNumber numberWithUnsignedShort:10U]; + payload.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + payload.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveColorTemperature:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move up color temperature command Error: %@", err); @@ -5735,12 +5735,12 @@ - (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveColorTemperaturePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedShort:10U]; - payload.ColorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - payload.ColorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedShort:10U]; + payload.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + payload.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveColorTemperature:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Stop Color Temperature command Error: %@", err); @@ -5762,12 +5762,12 @@ - (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterMoveColorTemperaturePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:3]; - payload.Rate = [NSNumber numberWithUnsignedShort:20U]; - payload.ColorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - payload.ColorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:3]; + payload.rate = [NSNumber numberWithUnsignedShort:20U]; + payload.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + payload.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveColorTemperature:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Move down color temperature command Error: %@", err); @@ -5880,13 +5880,13 @@ - (void)testSendClusterTest_TC_CC_6_3_000002_StepColorTemperature XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepColorTemperaturePayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:1]; - payload.StepSize = [NSNumber numberWithUnsignedShort:5U]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:50U]; - payload.ColorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - payload.ColorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:1]; + payload.stepSize = [NSNumber numberWithUnsignedShort:5U]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + payload.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; + payload.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepColorTemperature:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step up color temperature command Error: %@", err); @@ -5908,13 +5908,13 @@ - (void)testSendClusterTest_TC_CC_6_3_000003_StepColorTemperature XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterStepColorTemperaturePayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:3]; - payload.StepSize = [NSNumber numberWithUnsignedShort:5U]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:50U]; - payload.ColorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - payload.ColorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:3]; + payload.stepSize = [NSNumber numberWithUnsignedShort:5U]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + payload.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; + payload.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stepColorTemperature:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Step down color temperature command Error: %@", err); @@ -6027,11 +6027,11 @@ - (void)testSendClusterTest_TC_CC_7_1_000002_EnhancedMoveToHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveToHuePayload alloc] init]; - payload.EnhancedHue = [NSNumber numberWithUnsignedShort:1025U]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:1U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.enhancedHue = [NSNumber numberWithUnsignedShort:1025U]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:1U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveToHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Move To Hue command Error: %@", err); @@ -6169,10 +6169,10 @@ - (void)testSendClusterTest_TC_CC_7_2_000002_EnhancedMoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:3]; - payload.Rate = [NSNumber numberWithUnsignedShort:5U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:3]; + payload.rate = [NSNumber numberWithUnsignedShort:5U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Move Hue Down command Error: %@", err); @@ -6194,10 +6194,10 @@ - (void)testSendClusterTest_TC_CC_7_2_000003_EnhancedMoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Move Hue Stop command Error: %@", err); @@ -6219,10 +6219,10 @@ - (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:1]; - payload.Rate = [NSNumber numberWithUnsignedShort:50U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:1]; + payload.rate = [NSNumber numberWithUnsignedShort:50U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Move Hue Up command Error: %@", err); @@ -6244,10 +6244,10 @@ - (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveHuePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Move Hue Stop command Error: %@", err); @@ -6360,11 +6360,11 @@ - (void)testSendClusterTest_TC_CC_7_3_000002_EnhancedStepHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedStepHuePayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:0]; - payload.StepSize = [NSNumber numberWithUnsignedShort:50U]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:1U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:0]; + payload.stepSize = [NSNumber numberWithUnsignedShort:50U]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:1U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedStepHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Step Hue Up command Error: %@", err); @@ -6386,11 +6386,11 @@ - (void)testSendClusterTest_TC_CC_7_3_000003_EnhancedStepHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedStepHuePayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:1]; - payload.StepSize = [NSNumber numberWithUnsignedShort:75U]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:1U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:1]; + payload.stepSize = [NSNumber numberWithUnsignedShort:75U]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:1U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedStepHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Step Hue Down command Error: %@", err); @@ -6503,11 +6503,11 @@ - (void)testSendClusterTest_TC_CC_7_4_000002_EnhancedMoveToHueAndSaturation XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveToHueAndSaturationPayload alloc] init]; - payload.EnhancedHue = [NSNumber numberWithUnsignedShort:1200U]; - payload.Saturation = [NSNumber numberWithUnsignedChar:90]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:10U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.enhancedHue = [NSNumber numberWithUnsignedShort:1200U]; + payload.saturation = [NSNumber numberWithUnsignedChar:90]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveToHueAndSaturation:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced move to hue and saturation command Error: %@", err); @@ -6620,13 +6620,13 @@ - (void)testSendClusterTest_TC_CC_8_1_000002_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:14]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:1]; - payload.Time = [NSNumber numberWithUnsignedShort:100U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:500U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:14]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:1]; + payload.time = [NSNumber numberWithUnsignedShort:100U]; + payload.startHue = [NSNumber numberWithUnsignedShort:500U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err); @@ -6744,13 +6744,13 @@ - (void)testSendClusterTest_TC_CC_8_1_000007_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:1]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:1]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); @@ -6797,13 +6797,13 @@ - (void)testSendClusterTest_TC_CC_8_1_000009_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:6]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:3500U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:6]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:3500U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); @@ -6873,13 +6873,13 @@ - (void)testSendClusterTest_TC_CC_8_1_000012_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:2]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:1]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:2]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:1]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); @@ -7016,13 +7016,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000002_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7068,13 +7068,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000004_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:2]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:2]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7120,13 +7120,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000006_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:4]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:30U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:4]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:30U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7172,13 +7172,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000008_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:8]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:160U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:8]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:160U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7224,13 +7224,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000010_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:1]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:1]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7276,13 +7276,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000012_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7328,13 +7328,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000014_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:2]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:1]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:2]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:1]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7380,13 +7380,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000016_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:1]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:1]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7432,13 +7432,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000018_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7484,11 +7484,11 @@ - (void)testSendClusterTest_TC_CC_9_1_000020_EnhancedMoveToHue XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterEnhancedMoveToHuePayload alloc] init]; - payload.EnhancedHue = [NSNumber numberWithUnsignedShort:40960U]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.enhancedHue = [NSNumber numberWithUnsignedShort:40960U]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveToHue:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Enhanced Move To Hue command 10 Error: %@", err); @@ -7542,13 +7542,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000023_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:2]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:2]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7594,13 +7594,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000025_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:2]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:2]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7646,13 +7646,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000027_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7698,13 +7698,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000029_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:2]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:1]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:2]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:1]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7750,13 +7750,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000031_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:2]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:2]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7802,13 +7802,13 @@ - (void)testSendClusterTest_TC_CC_9_1_000033_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -7922,13 +7922,13 @@ - (void)testSendClusterTest_TC_CC_9_2_000002_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:15]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:30U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:160U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:15]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:30U]; + payload.startHue = [NSNumber numberWithUnsignedShort:160U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -8046,13 +8046,13 @@ - (void)testSendClusterTest_TC_CC_9_2_000007_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:1]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:1]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); @@ -8098,13 +8098,13 @@ - (void)testSendClusterTest_TC_CC_9_2_000009_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:2]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:1]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:2]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:1]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); @@ -8150,13 +8150,13 @@ - (void)testSendClusterTest_TC_CC_9_2_000011_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); @@ -8270,13 +8270,13 @@ - (void)testSendClusterTest_TC_CC_9_3_000002_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:15]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:30U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:160U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:15]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:30U]; + payload.startHue = [NSNumber numberWithUnsignedShort:160U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends ColorLoopSet Command - Set all Attributes Error: %@", err); @@ -8394,13 +8394,13 @@ - (void)testSendClusterTest_TC_CC_9_3_000007_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:1]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:1]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); @@ -8446,13 +8446,13 @@ - (void)testSendClusterTest_TC_CC_9_3_000009_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:4]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:60U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:4]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:60U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); @@ -8498,13 +8498,13 @@ - (void)testSendClusterTest_TC_CC_9_3_000011_ColorLoopSet XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPColorControlClusterColorLoopSetPayload alloc] init]; - payload.UpdateFlags = [NSNumber numberWithUnsignedChar:1]; - payload.Action = [NSNumber numberWithUnsignedChar:0]; - payload.Direction = [NSNumber numberWithUnsignedChar:0]; - payload.Time = [NSNumber numberWithUnsignedShort:0U]; - payload.StartHue = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionsMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionsOverride = [NSNumber numberWithUnsignedChar:0]; + payload.updateFlags = [NSNumber numberWithUnsignedChar:1]; + payload.action = [NSNumber numberWithUnsignedChar:0]; + payload.direction = [NSNumber numberWithUnsignedChar:0]; + payload.time = [NSNumber numberWithUnsignedShort:0U]; + payload.startHue = [NSNumber numberWithUnsignedShort:0U]; + payload.optionsMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSet:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); @@ -9395,10 +9395,10 @@ - (void)testSendClusterTest_TC_LVL_2_1_000001_MoveToLevel XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMoveToLevelPayload alloc] init]; - payload.Level = [NSNumber numberWithUnsignedChar:64]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.level = [NSNumber numberWithUnsignedChar:64]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster moveToLevel:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"sends a Move to level command Error: %@", err); @@ -9452,10 +9452,10 @@ - (void)testSendClusterTest_TC_LVL_2_1_000004_MoveToLevel XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMoveToLevelPayload alloc] init]; - payload.Level = [NSNumber numberWithUnsignedChar:128]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:1U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.level = [NSNumber numberWithUnsignedChar:128]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:1U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster moveToLevel:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"sends a Move to level command Error: %@", err); @@ -9533,10 +9533,10 @@ - (void)testSendClusterTest_TC_LVL_2_1_000008_MoveToLevel XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMoveToLevelPayload alloc] init]; - payload.Level = [NSNumber numberWithUnsignedChar:254]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:65535U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.level = [NSNumber numberWithUnsignedChar:254]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:65535U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster moveToLevel:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"sends a Move to level command Error: %@", err); @@ -9590,10 +9590,10 @@ - (void)testSendClusterTest_TC_LVL_2_1_000011_MoveToLevel XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMoveToLevelPayload alloc] init]; - payload.Level = [NSNumber numberWithUnsignedChar:0]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:0U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.level = [NSNumber numberWithUnsignedChar:0]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster moveToLevel:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Reset level to 0 Error: %@", err); @@ -9672,10 +9672,10 @@ - (void)testSendClusterTest_TC_LVL_3_1_000002_Move XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMovePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedChar:200]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedChar:200]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster move:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"sends a Move up command Error: %@", err); @@ -9753,10 +9753,10 @@ - (void)testSendClusterTest_TC_LVL_3_1_000006_Move XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMovePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:1]; - payload.Rate = [NSNumber numberWithUnsignedChar:250]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.moveMode = [NSNumber numberWithUnsignedChar:1]; + payload.rate = [NSNumber numberWithUnsignedChar:250]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster move:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"sends a Move down command Error: %@", err); @@ -9856,10 +9856,10 @@ - (void)testSendClusterTest_TC_LVL_3_1_000011_Move XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMovePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:1]; - payload.Rate = [NSNumber numberWithUnsignedChar:255]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.moveMode = [NSNumber numberWithUnsignedChar:1]; + payload.rate = [NSNumber numberWithUnsignedChar:255]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster move:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"sends a Move up command at default move rate Error: %@", err); @@ -9932,11 +9932,11 @@ - (void)testSendClusterTest_TC_LVL_4_1_000001_Step XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterStepPayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:0]; - payload.StepSize = [NSNumber numberWithUnsignedChar:128]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:20U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:0]; + payload.stepSize = [NSNumber numberWithUnsignedChar:128]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:0]; [cluster step:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Precondition: DUT level is set to 0x80 Error: %@", err); @@ -9990,11 +9990,11 @@ - (void)testSendClusterTest_TC_LVL_4_1_000004_Step XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterStepPayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:1]; - payload.StepSize = [NSNumber numberWithUnsignedChar:64]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:20U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:1]; + payload.stepSize = [NSNumber numberWithUnsignedChar:64]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:0]; [cluster step:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends step down command to DUT Error: %@", err); @@ -10048,11 +10048,11 @@ - (void)testSendClusterTest_TC_LVL_4_1_000007_Step XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterStepPayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:0]; - payload.StepSize = [NSNumber numberWithUnsignedChar:64]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:20U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:0]; + payload.stepSize = [NSNumber numberWithUnsignedChar:64]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:0]; [cluster step:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends a Step up command Error: %@", err); @@ -10149,11 +10149,11 @@ - (void)testSendClusterTest_TC_LVL_5_1_000001_Step XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterStepPayload alloc] init]; - payload.StepMode = [NSNumber numberWithUnsignedChar:0]; - payload.StepSize = [NSNumber numberWithUnsignedChar:128]; - payload.TransitionTime = [NSNumber numberWithUnsignedShort:20U]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:0]; + payload.stepMode = [NSNumber numberWithUnsignedChar:0]; + payload.stepSize = [NSNumber numberWithUnsignedChar:128]; + payload.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + payload.optionMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:0]; [cluster step:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Precondition: DUT level is set to 0x80 Error: %@", err); @@ -10183,10 +10183,10 @@ - (void)testSendClusterTest_TC_LVL_5_1_000003_Move XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterMovePayload alloc] init]; - payload.MoveMode = [NSNumber numberWithUnsignedChar:0]; - payload.Rate = [NSNumber numberWithUnsignedChar:1]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:1]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:1]; + payload.moveMode = [NSNumber numberWithUnsignedChar:0]; + payload.rate = [NSNumber numberWithUnsignedChar:1]; + payload.optionMask = [NSNumber numberWithUnsignedChar:1]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:1]; [cluster move:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends a move up command to DUT Error: %@", err); @@ -10216,8 +10216,8 @@ - (void)testSendClusterTest_TC_LVL_5_1_000005_Stop XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPLevelControlClusterStopPayload alloc] init]; - payload.OptionMask = [NSNumber numberWithUnsignedChar:0]; - payload.OptionOverride = [NSNumber numberWithUnsignedChar:0]; + payload.optionMask = [NSNumber numberWithUnsignedChar:0]; + payload.optionOverride = [NSNumber numberWithUnsignedChar:0]; [cluster stop:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Sends stop command to DUT Error: %@", err); @@ -16082,7 +16082,7 @@ - (void)testSendClusterTestCluster_000002_TestSpecific XCTAssertEqual(err.code, 0); { - id actualValue = values[@"ReturnValue"]; + id actualValue = values[@"returnValue"]; XCTAssertEqual([actualValue unsignedCharValue], 7); } @@ -16101,8 +16101,8 @@ - (void)testSendClusterTestCluster_000003_TestAddArguments XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPTestClusterClusterTestAddArgumentsPayload alloc] init]; - payload.Arg1 = [NSNumber numberWithUnsignedChar:3]; - payload.Arg2 = [NSNumber numberWithUnsignedChar:17]; + payload.arg1 = [NSNumber numberWithUnsignedChar:3]; + payload.arg2 = [NSNumber numberWithUnsignedChar:17]; [cluster testAddArguments:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Send Test Add Arguments Command Error: %@", err); @@ -16110,7 +16110,7 @@ - (void)testSendClusterTestCluster_000003_TestAddArguments XCTAssertEqual(err.code, 0); { - id actualValue = values[@"ReturnValue"]; + id actualValue = values[@"returnValue"]; XCTAssertEqual([actualValue unsignedCharValue], 20); } @@ -16129,8 +16129,8 @@ - (void)testSendClusterTestCluster_000004_TestAddArguments XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPTestClusterClusterTestAddArgumentsPayload alloc] init]; - payload.Arg1 = [NSNumber numberWithUnsignedChar:250]; - payload.Arg2 = [NSNumber numberWithUnsignedChar:6]; + payload.arg1 = [NSNumber numberWithUnsignedChar:250]; + payload.arg2 = [NSNumber numberWithUnsignedChar:6]; [cluster testAddArguments:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Send failing Test Add Arguments Command Error: %@", err); @@ -18948,8 +18948,8 @@ - (void)testSendClusterTestCluster_000125_TestEnumsRequest XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPTestClusterClusterTestEnumsRequestPayload alloc] init]; - payload.Arg1 = [NSNumber numberWithUnsignedShort:20003U]; - payload.Arg2 = [NSNumber numberWithUnsignedChar:101]; + payload.arg1 = [NSNumber numberWithUnsignedShort:20003U]; + payload.arg2 = [NSNumber numberWithUnsignedChar:101]; [cluster testEnumsRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Send a command with a vendor_id and enum Error: %@", err); @@ -18957,11 +18957,11 @@ - (void)testSendClusterTestCluster_000125_TestEnumsRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Arg1"]; + id actualValue = values[@"arg1"]; XCTAssertEqual([actualValue unsignedShortValue], 20003U); } { - id actualValue = values[@"Arg2"]; + id actualValue = values[@"arg2"]; XCTAssertEqual([actualValue unsignedCharValue], 101); } @@ -18981,13 +18981,13 @@ - (void)testSendClusterTestCluster_000126_TestStructArgumentRequest XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPTestClusterClusterTestStructArgumentRequestPayload alloc] init]; - payload.Arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).A = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).B = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).C = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).D = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).E = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).F = [NSNumber numberWithUnsignedChar:1]; + payload.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).f = [NSNumber numberWithUnsignedChar:1]; [cluster testStructArgumentRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { @@ -18996,7 +18996,7 @@ - (void)testSendClusterTestCluster_000126_TestStructArgumentRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue boolValue], true); } @@ -19016,13 +19016,13 @@ - (void)testSendClusterTestCluster_000127_TestStructArgumentRequest XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPTestClusterClusterTestStructArgumentRequestPayload alloc] init]; - payload.Arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).A = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).B = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).C = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).D = [[NSData alloc] initWithBytes:"octet_string" length:12]; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).E = @"char_string"; - ((CHIPTestClusterClusterSimpleStruct *) payload.Arg1).F = [NSNumber numberWithUnsignedChar:1]; + payload.arg1 = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).d = [[NSData alloc] initWithBytes:"octet_string" length:12]; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).e = @"char_string"; + ((CHIPTestClusterClusterSimpleStruct *) payload.arg1).f = [NSNumber numberWithUnsignedChar:1]; [cluster testStructArgumentRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { @@ -19031,7 +19031,7 @@ - (void)testSendClusterTestCluster_000127_TestStructArgumentRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue boolValue], false); } @@ -19062,7 +19062,7 @@ - (void)testSendClusterTestCluster_000128_TestListInt8UArgumentRequest temp[6] = [NSNumber numberWithUnsignedChar:7]; temp[7] = [NSNumber numberWithUnsignedChar:8]; temp[8] = [NSNumber numberWithUnsignedChar:9]; - payload.Arg1 = temp; + payload.arg1 = temp; } [cluster testListInt8UArgumentRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { @@ -19071,7 +19071,7 @@ - (void)testSendClusterTestCluster_000128_TestListInt8UArgumentRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue boolValue], true); } @@ -19103,7 +19103,7 @@ - (void)testSendClusterTestCluster_000129_TestListInt8UArgumentRequest temp[7] = [NSNumber numberWithUnsignedChar:8]; temp[8] = [NSNumber numberWithUnsignedChar:9]; temp[9] = [NSNumber numberWithUnsignedChar:0]; - payload.Arg1 = temp; + payload.arg1 = temp; } [cluster testListInt8UArgumentRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { @@ -19112,7 +19112,7 @@ - (void)testSendClusterTestCluster_000129_TestListInt8UArgumentRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue boolValue], false); } @@ -19142,7 +19142,7 @@ - (void)testSendClusterTestCluster_000130_TestListInt8UReverseRequest temp[6] = [NSNumber numberWithUnsignedChar:7]; temp[7] = [NSNumber numberWithUnsignedChar:8]; temp[8] = [NSNumber numberWithUnsignedChar:9]; - payload.Arg1 = temp; + payload.arg1 = temp; } [cluster testListInt8UReverseRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { @@ -19151,7 +19151,7 @@ - (void)testSendClusterTestCluster_000130_TestListInt8UReverseRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Arg1"]; + id actualValue = values[@"arg1"]; XCTAssertEqual([actualValue count], 9); XCTAssertEqual([actualValue[0] unsignedCharValue], 9); XCTAssertEqual([actualValue[1] unsignedCharValue], 8); @@ -19182,7 +19182,7 @@ - (void)testSendClusterTestCluster_000131_TestListInt8UReverseRequest __auto_type * payload = [[CHIPTestClusterClusterTestListInt8UReverseRequestPayload alloc] init]; { NSMutableArray * temp = [[NSMutableArray alloc] init]; - payload.Arg1 = temp; + payload.arg1 = temp; } [cluster testListInt8UReverseRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { @@ -19191,7 +19191,7 @@ - (void)testSendClusterTestCluster_000131_TestListInt8UReverseRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Arg1"]; + id actualValue = values[@"arg1"]; XCTAssertEqual([actualValue count], 0); } @@ -19214,22 +19214,22 @@ - (void)testSendClusterTestCluster_000132_TestListStructArgumentRequest { NSMutableArray * temp = [[NSMutableArray alloc] init]; temp[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).A = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).B = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).C = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).D = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).E = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).F = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).e = @"first_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).f = [NSNumber numberWithUnsignedChar:1]; temp[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).A = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).B = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).C = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).D = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).E = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).F = [NSNumber numberWithUnsignedChar:1]; - - payload.Arg1 = temp; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).e = @"second_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).f = [NSNumber numberWithUnsignedChar:1]; + + payload.arg1 = temp; } [cluster testListStructArgumentRequest:payload @@ -19239,7 +19239,7 @@ - (void)testSendClusterTestCluster_000132_TestListStructArgumentRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue boolValue], true); } @@ -19262,22 +19262,22 @@ - (void)testSendClusterTestCluster_000133_TestListStructArgumentRequest { NSMutableArray * temp = [[NSMutableArray alloc] init]; temp[0] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).A = [NSNumber numberWithUnsignedChar:1]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).B = [NSNumber numberWithBool:true]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).C = [NSNumber numberWithUnsignedChar:3]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).D = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).E = @"second_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp[0]).F = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).a = [NSNumber numberWithUnsignedChar:1]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).c = [NSNumber numberWithUnsignedChar:3]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).d = [[NSData alloc] initWithBytes:"second_octet_string" length:19]; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).e = @"second_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp[0]).f = [NSNumber numberWithUnsignedChar:1]; temp[1] = [[CHIPTestClusterClusterSimpleStruct alloc] init]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).A = [NSNumber numberWithUnsignedChar:0]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).B = [NSNumber numberWithBool:false]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).C = [NSNumber numberWithUnsignedChar:2]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).D = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).E = @"first_char_string"; - ((CHIPTestClusterClusterSimpleStruct *) temp[1]).F = [NSNumber numberWithUnsignedChar:1]; - - payload.Arg1 = temp; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).a = [NSNumber numberWithUnsignedChar:0]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).b = [NSNumber numberWithBool:false]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).d = [[NSData alloc] initWithBytes:"first_octet_string" length:18]; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).e = @"first_char_string"; + ((CHIPTestClusterClusterSimpleStruct *) temp[1]).f = [NSNumber numberWithUnsignedChar:1]; + + payload.arg1 = temp; } [cluster testListStructArgumentRequest:payload @@ -19287,7 +19287,7 @@ - (void)testSendClusterTestCluster_000133_TestListStructArgumentRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue boolValue], false); } @@ -19306,7 +19306,7 @@ - (void)testSendClusterTestCluster_000134_TestNullableOptionalRequest XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPTestClusterClusterTestNullableOptionalRequestPayload alloc] init]; - payload.Arg1 = [NSNumber numberWithUnsignedChar:5]; + payload.arg1 = [NSNumber numberWithUnsignedChar:5]; [cluster testNullableOptionalRequest:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Send Test Command with optional arg set. Error: %@", err); @@ -19314,19 +19314,19 @@ - (void)testSendClusterTestCluster_000134_TestNullableOptionalRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"WasPresent"]; + id actualValue = values[@"wasPresent"]; XCTAssertEqual([actualValue boolValue], true); } { - id actualValue = values[@"WasNull"]; + id actualValue = values[@"wasNull"]; XCTAssertEqual([actualValue boolValue], false); } { - id actualValue = values[@"Value"]; + id actualValue = values[@"value"]; XCTAssertEqual([actualValue unsignedCharValue], 5); } { - id actualValue = values[@"OriginalValue"]; + id actualValue = values[@"originalValue"]; XCTAssertFalse([actualValue isKindOfClass:[NSNull class]]); XCTAssertEqual([actualValue unsignedCharValue], 5); } @@ -19353,7 +19353,7 @@ - (void)testSendClusterTestCluster_000135_TestNullableOptionalRequest XCTAssertEqual(err.code, 0); { - id actualValue = values[@"WasPresent"]; + id actualValue = values[@"wasPresent"]; XCTAssertEqual([actualValue boolValue], false); } @@ -19476,14 +19476,14 @@ - (void)testSendClusterTestDescriptorCluster_000000_ReadAttribute id actualValue = values[@"value"]; XCTAssertEqual([actualValue count], 1); if ([actualValue[0] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[0][@"Type"] unsignedIntValue], 0UL); + XCTAssertEqual([actualValue[0][@"type"] unsignedIntValue], 0UL); } else { - XCTAssertEqual([[actualValue[0] Type] unsignedIntValue], 0UL); + XCTAssertEqual([((CHIPDescriptorClusterDeviceType *) actualValue[0]).type unsignedIntValue], 0UL); } if ([actualValue[0] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[0][@"Revision"] unsignedShortValue], 1U); + XCTAssertEqual([actualValue[0][@"revision"] unsignedShortValue], 1U); } else { - XCTAssertEqual([[actualValue[0] Revision] unsignedShortValue], 1U); + XCTAssertEqual([((CHIPDescriptorClusterDeviceType *) actualValue[0]).revision unsignedShortValue], 1U); } } @@ -19688,7 +19688,7 @@ - (void)testSendClusterTestIdentifyCluster_000000_Identify XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPIdentifyClusterIdentifyPayload alloc] init]; - payload.IdentifyTime = [NSNumber numberWithUnsignedShort:0U]; + payload.identifyTime = [NSNumber numberWithUnsignedShort:0U]; [cluster identify:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Send Identify command and expect success response Error: %@", err); @@ -19885,49 +19885,49 @@ - (void)testSendClusterTestModeSelectCluster_000004_ReadAttribute id actualValue = values[@"value"]; XCTAssertEqual([actualValue count], 3); if ([actualValue[0] isKindOfClass:[NSDictionary class]]) { - XCTAssertTrue([actualValue[0][@"Label"] isEqualToString:@"Black"]); + XCTAssertTrue([actualValue[0][@"label"] isEqualToString:@"Black"]); } else { - XCTAssertTrue([[actualValue[0] Label] isEqualToString:@"Black"]); + XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label isEqualToString:@"Black"]); } if ([actualValue[0] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[0][@"Mode"] unsignedCharValue], 0); + XCTAssertEqual([actualValue[0][@"mode"] unsignedCharValue], 0); } else { - XCTAssertEqual([[actualValue[0] Mode] unsignedCharValue], 0); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode unsignedCharValue], 0); } if ([actualValue[0] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[0][@"SemanticTag"] unsignedIntValue], 0UL); + XCTAssertEqual([actualValue[0][@"semanticTag"] unsignedIntValue], 0UL); } else { - XCTAssertEqual([[actualValue[0] SemanticTag] unsignedIntValue], 0UL); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag unsignedIntValue], 0UL); } if ([actualValue[1] isKindOfClass:[NSDictionary class]]) { - XCTAssertTrue([actualValue[1][@"Label"] isEqualToString:@"Cappuccino"]); + XCTAssertTrue([actualValue[1][@"label"] isEqualToString:@"Cappuccino"]); } else { - XCTAssertTrue([[actualValue[1] Label] isEqualToString:@"Cappuccino"]); + XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label isEqualToString:@"Cappuccino"]); } if ([actualValue[1] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[1][@"Mode"] unsignedCharValue], 4); + XCTAssertEqual([actualValue[1][@"mode"] unsignedCharValue], 4); } else { - XCTAssertEqual([[actualValue[1] Mode] unsignedCharValue], 4); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode unsignedCharValue], 4); } if ([actualValue[1] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[1][@"SemanticTag"] unsignedIntValue], 0UL); + XCTAssertEqual([actualValue[1][@"semanticTag"] unsignedIntValue], 0UL); } else { - XCTAssertEqual([[actualValue[1] SemanticTag] unsignedIntValue], 0UL); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag unsignedIntValue], 0UL); } if ([actualValue[2] isKindOfClass:[NSDictionary class]]) { - XCTAssertTrue([actualValue[2][@"Label"] isEqualToString:@"Espresso"]); + XCTAssertTrue([actualValue[2][@"label"] isEqualToString:@"Espresso"]); } else { - XCTAssertTrue([[actualValue[2] Label] isEqualToString:@"Espresso"]); + XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label isEqualToString:@"Espresso"]); } if ([actualValue[2] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[2][@"Mode"] unsignedCharValue], 7); + XCTAssertEqual([actualValue[2][@"mode"] unsignedCharValue], 7); } else { - XCTAssertEqual([[actualValue[2] Mode] unsignedCharValue], 7); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode unsignedCharValue], 7); } if ([actualValue[2] isKindOfClass:[NSDictionary class]]) { - XCTAssertEqual([actualValue[2][@"SemanticTag"] unsignedIntValue], 0UL); + XCTAssertEqual([actualValue[2][@"semanticTag"] unsignedIntValue], 0UL); } else { - XCTAssertEqual([[actualValue[2] SemanticTag] unsignedIntValue], 0UL); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag unsignedIntValue], 0UL); } } @@ -19946,7 +19946,7 @@ - (void)testSendClusterTestModeSelectCluster_000005_ChangeToMode XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPModeSelectClusterChangeToModePayload alloc] init]; - payload.NewMode = [NSNumber numberWithUnsignedChar:4]; + payload.newMode = [NSNumber numberWithUnsignedChar:4]; [cluster changeToMode:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Change to Supported Mode Error: %@", err); @@ -19992,7 +19992,7 @@ - (void)testSendClusterTestModeSelectCluster_000007_ChangeToMode XCTAssertNotNil(cluster); __auto_type * payload = [[CHIPModeSelectClusterChangeToModePayload alloc] init]; - payload.NewMode = [NSNumber numberWithUnsignedChar:2]; + payload.newMode = [NSNumber numberWithUnsignedChar:2]; [cluster changeToMode:payload responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Change to Unsupported Mode Error: %@", err);