diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt index c665adaeb97b47..4ceb3d2164147b 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt @@ -450,7 +450,7 @@ class WildcardFragment : Fragment() { private suspend fun readCurrentFabricIndex() : UInt { val context = requireContext() - val endpointId = 0L + val endpointId = 0 val clusterId = 62L // OperationalCredentials val attributeId = 5L // CurrentFabricIndex val deviceId = addressUpdateFragment.deviceId diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt index 7eb38a0d4f950a..f509ad32d38732 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt @@ -79,7 +79,7 @@ class PairOnNetworkLongImInvokeCommand( tlvWriter.endStructure() val element: InvokeElement = InvokeElement.newInstance( /* endpointId= */ - 0L, CLUSTER_ID_IDENTIFY, IDENTIFY_COMMAND, tlvWriter.getEncoded(), null + 0, CLUSTER_ID_IDENTIFY, IDENTIFY_COMMAND, tlvWriter.getEncoded(), null ) currentCommissioner() diff --git a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java index 6f4e6eb98c52e2..f93897f2d2a582 100644 --- a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java +++ b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java @@ -18,7 +18,7 @@ public ContentAppEndpointManagerImpl(Context context) { this.context = context; } - public String sendCommand(int endpointId, int clusterId, int commandId, String commandPayload) { + public String sendCommand(int endpointId, long clusterId, long commandId, String commandPayload) { Log.d(TAG, "Received a command for endpointId " + endpointId + ". Message " + commandPayload); ContentApp discoveredApp = @@ -54,7 +54,7 @@ public String sendCommand(int endpointId, int clusterId, int commandId, String c return "Success"; } - public String readAttribute(int endpointId, int clusterId, int attributeId) { + public String readAttribute(int endpointId, long clusterId, long attributeId) { Log.d( TAG, "Received a attribute read request for endpointId " diff --git a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/ContentAppAgentService.java b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/ContentAppAgentService.java index cc311b9481e194..542e8e4f93f33c 100644 --- a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/ContentAppAgentService.java +++ b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/ContentAppAgentService.java @@ -107,12 +107,12 @@ public IBinder onBind(final Intent intent) { } public static String sendCommand( - Context context, String packageName, int clusterId, int commandId, String payload) { + Context context, String packageName, long clusterId, long commandId, String payload) { Intent in = new Intent(MatterIntentConstants.ACTION_MATTER_COMMAND); Bundle extras = new Bundle(); extras.putByteArray(MatterIntentConstants.EXTRA_COMMAND_PAYLOAD, payload.getBytes()); - extras.putInt(MatterIntentConstants.EXTRA_COMMAND_ID, commandId); - extras.putInt(MatterIntentConstants.EXTRA_CLUSTER_ID, clusterId); + extras.putLong(MatterIntentConstants.EXTRA_COMMAND_ID, commandId); + extras.putLong(MatterIntentConstants.EXTRA_CLUSTER_ID, clusterId); in.putExtras(extras); in.setPackage(packageName); int flags = Intent.FLAG_INCLUDE_STOPPED_PACKAGES; @@ -127,13 +127,13 @@ public static String sendCommand( } public static String sendAttributeReadRequest( - Context context, String packageName, int clusterId, int attributeId) { + Context context, String packageName, long clusterId, long attributeId) { Intent in = new Intent(MatterIntentConstants.ACTION_MATTER_COMMAND); Bundle extras = new Bundle(); extras.putString( MatterIntentConstants.EXTRA_ATTRIBUTE_ACTION, MatterIntentConstants.ATTRIBUTE_ACTION_READ); - extras.putInt(MatterIntentConstants.EXTRA_ATTRIBUTE_ID, attributeId); - extras.putInt(MatterIntentConstants.EXTRA_CLUSTER_ID, clusterId); + extras.putLong(MatterIntentConstants.EXTRA_ATTRIBUTE_ID, attributeId); + extras.putLong(MatterIntentConstants.EXTRA_CLUSTER_ID, clusterId); in.putExtras(extras); in.setPackage(packageName); int flags = Intent.FLAG_INCLUDE_STOPPED_PACKAGES; diff --git a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/MatterServant.java b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/MatterServant.java index 00963fa1f7e2ae..79b02f01386769 100644 --- a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/MatterServant.java +++ b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/MatterServant.java @@ -82,36 +82,26 @@ public void init(@NonNull Context context) { mTvApp = new TvApp( (app, clusterId, endpoint) -> { - switch (clusterId) { - case Clusters.ClusterId_KeypadInput: - app.setKeypadInputManager(endpoint, new KeypadInputManagerStub(endpoint)); - break; - case Clusters.ClusterId_WakeOnLan: - app.setWakeOnLanManager(endpoint, new WakeOnLanManagerStub(endpoint)); - break; - case Clusters.ClusterId_MediaInput: - app.setMediaInputManager(endpoint, new MediaInputManagerStub(endpoint)); - break; - case Clusters.ClusterId_ContentLauncher: - app.setContentLaunchManager(endpoint, new ContentLaunchManagerStub(endpoint)); - break; - case Clusters.ClusterId_LowPower: - app.setLowPowerManager(endpoint, new LowPowerManagerStub(endpoint)); - break; - case Clusters.ClusterId_MediaPlayback: - app.setMediaPlaybackManager(endpoint, new MediaPlaybackManagerStub(endpoint)); - break; - case Clusters.ClusterId_Channel: - app.setChannelManager(endpoint, new ChannelManagerStub(endpoint)); - break; - case Clusters.ClusterId_OnOff: - mOnOffEndpoint = endpoint; - app.setOnOffManager(endpoint, new OnOffManagerStub(endpoint)); - break; - case Clusters.ClusterId_LevelControl: - mLevelEndpoint = endpoint; - app.setLevelManager(endpoint, new LevelManagerStub(endpoint)); - break; + if (clusterId == Clusters.ClusterId_KeypadInput) { + app.setKeypadInputManager(endpoint, new KeypadInputManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_WakeOnLan) { + app.setWakeOnLanManager(endpoint, new WakeOnLanManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_MediaInput) { + app.setMediaInputManager(endpoint, new MediaInputManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_ContentLauncher) { + app.setContentLaunchManager(endpoint, new ContentLaunchManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_LowPower) { + app.setLowPowerManager(endpoint, new LowPowerManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_MediaPlayback) { + app.setMediaPlaybackManager(endpoint, new MediaPlaybackManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_Channel) { + app.setChannelManager(endpoint, new ChannelManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_OnOff) { + mOnOffEndpoint = endpoint; + app.setOnOffManager(endpoint, new OnOffManagerStub(endpoint)); + } else if (clusterId == Clusters.ClusterId_LevelControl) { + mLevelEndpoint = endpoint; + app.setLevelManager(endpoint, new LevelManagerStub(endpoint)); } }); mTvApp.setDACProvider(new DACProviderStub()); diff --git a/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp b/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp index 0565d364e2719f..54e4ee633ce7d9 100644 --- a/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp +++ b/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp @@ -49,7 +49,7 @@ std::string ContentAppAttributeDelegate::Read(const chip::app::ConcreteReadAttri jstring resp = (jstring) env->CallObjectMethod(mContentAppEndpointManager, mReadAttributeMethod, static_cast(aPath.mEndpointId), - static_cast(aPath.mClusterId), static_cast(aPath.mAttributeId)); + static_cast(aPath.mClusterId), static_cast(aPath.mAttributeId)); if (env->ExceptionCheck()) { ChipLogError(Zcl, "Java exception in ContentAppAttributeDelegate::Read"); diff --git a/examples/tv-app/android/java/ContentAppAttributeDelegate.h b/examples/tv-app/android/java/ContentAppAttributeDelegate.h index 4ec02712201d7b..9d22bbc5fff7aa 100644 --- a/examples/tv-app/android/java/ContentAppAttributeDelegate.h +++ b/examples/tv-app/android/java/ContentAppAttributeDelegate.h @@ -67,7 +67,7 @@ class ContentAppAttributeDelegate VerifyOrReturn(ContentAppEndpointManagerClass != nullptr, ChipLogError(Zcl, "Failed to get ContentAppEndpointManager Java class")); - mReadAttributeMethod = env->GetMethodID(ContentAppEndpointManagerClass, "readAttribute", "(III)Ljava/lang/String;"); + mReadAttributeMethod = env->GetMethodID(ContentAppEndpointManagerClass, "readAttribute", "(IJJ)Ljava/lang/String;"); if (mReadAttributeMethod == nullptr) { ChipLogError(Zcl, "Failed to access ContentAppEndpointManager 'readAttribute' method"); diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp index b477b75333866b..1ad6ef2fa40311 100644 --- a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp +++ b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp @@ -73,7 +73,7 @@ void ContentAppCommandDelegate::InvokeCommand(CommandHandlerInterface::HandlerCo jstring resp = (jstring) env->CallObjectMethod( mContentAppEndpointManager, mSendCommandMethod, static_cast(handlerContext.mRequestPath.mEndpointId), - static_cast(handlerContext.mRequestPath.mClusterId), static_cast(handlerContext.mRequestPath.mCommandId), + static_cast(handlerContext.mRequestPath.mClusterId), static_cast(handlerContext.mRequestPath.mCommandId), jsonString.jniValue()); if (env->ExceptionCheck()) { @@ -108,7 +108,7 @@ Status ContentAppCommandDelegate::InvokeCommand(EndpointId epId, ClusterId clust jstring resp = (jstring) env->CallObjectMethod(mContentAppEndpointManager, mSendCommandMethod, static_cast(epId), - static_cast(clusterId), static_cast(commandId), jsonString.jniValue()); + static_cast(clusterId), static_cast(commandId), jsonString.jniValue()); if (env->ExceptionCheck()) { ChipLogError(Zcl, "Java exception in ContentAppCommandDelegate::sendCommand"); diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.h b/examples/tv-app/android/java/ContentAppCommandDelegate.h index 610a2c7069f29d..156fa287f2ef9a 100644 --- a/examples/tv-app/android/java/ContentAppCommandDelegate.h +++ b/examples/tv-app/android/java/ContentAppCommandDelegate.h @@ -96,7 +96,7 @@ class ContentAppCommandDelegate : public CommandHandlerInterface ChipLogError(Zcl, "Failed to get ContentAppEndpointManager Java class")); mSendCommandMethod = - env->GetMethodID(ContentAppEndpointManagerClass, "sendCommand", "(IIILjava/lang/String;)Ljava/lang/String;"); + env->GetMethodID(ContentAppEndpointManagerClass, "sendCommand", "(IJJLjava/lang/String;)Ljava/lang/String;"); if (mSendCommandMethod == nullptr) { ChipLogError(Zcl, "Failed to access ContentAppEndpointManager 'sendCommand' method"); diff --git a/examples/tv-app/android/java/TVApp-JNI.cpp b/examples/tv-app/android/java/TVApp-JNI.cpp index a8eeba37344923..d7081419c0c645 100644 --- a/examples/tv-app/android/java/TVApp-JNI.cpp +++ b/examples/tv-app/android/java/TVApp-JNI.cpp @@ -64,7 +64,7 @@ void TvAppJNI::InitializeWithObjects(jobject app) jclass managerClass = env->GetObjectClass(mTvAppObject); VerifyOrReturn(managerClass != nullptr, ChipLogError(Zcl, "Failed to get TvAppJNI Java class")); - mPostClusterInitMethod = env->GetMethodID(managerClass, "postClusterInit", "(II)V"); + mPostClusterInitMethod = env->GetMethodID(managerClass, "postClusterInit", "(JI)V"); if (mPostClusterInitMethod == nullptr) { ChipLogError(Zcl, "Failed to access ChannelManager 'postClusterInit' method"); @@ -79,7 +79,7 @@ void TvAppJNI::PostClusterInit(int clusterId, int endpoint) VerifyOrReturn(mTvAppObject != nullptr, ChipLogError(Zcl, "TvAppJNI::mTvAppObject null")); VerifyOrReturn(mPostClusterInitMethod != nullptr, ChipLogError(Zcl, "TvAppJNI::mPostClusterInitMethod null")); - env->CallVoidMethod(mTvAppObject, mPostClusterInitMethod, static_cast(clusterId), static_cast(endpoint)); + env->CallVoidMethod(mTvAppObject, mPostClusterInitMethod, static_cast(clusterId), static_cast(endpoint)); if (env->ExceptionCheck()) { ChipLogError(Zcl, "Failed to call TvAppJNI 'postClusterInit' method"); diff --git a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/Clusters.java b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/Clusters.java index 7d7761a7b2050b..5322af22c97ae5 100644 --- a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/Clusters.java +++ b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/Clusters.java @@ -18,121 +18,121 @@ public class Clusters { - public static final int ClusterId_PowerConfiguration = 0x00000001; - public static final int ClusterId_DeviceTemperatureConfiguration = 0x00000002; - public static final int ClusterId_Identify = 0x00000003; - public static final int ClusterId_Groups = 0x00000004; - public static final int ClusterId_Scenes = 0x00000005; - public static final int ClusterId_OnOff = 0x00000006; - public static final int ClusterId_OnOffSwitchConfiguration = 0x00000007; - public static final int ClusterId_LevelControl = 0x00000008; - public static final int ClusterId_Alarms = 0x00000009; - public static final int ClusterId_Time = 0x0000000A; - public static final int ClusterId_BinaryInputBasic = 0x0000000F; - public static final int ClusterId_PowerProfile = 0x0000001A; - public static final int ClusterId_ApplianceControl = 0x0000001B; - public static final int ClusterId_PulseWidthModulation = 0x0000001C; - public static final int ClusterId_Descriptor = 0x0000001D; - public static final int ClusterId_Binding = 0x0000001E; - public static final int ClusterId_AccessControl = 0x0000001F; - public static final int ClusterId_PollControl = 0x00000020; - public static final int ClusterId_Actions = 0x00000025; - public static final int ClusterId_Basic = 0x00000028; - public static final int ClusterId_OtaSoftwareUpdateProvider = 0x00000029; - public static final int ClusterId_OtaSoftwareUpdateRequestor = 0x0000002A; - public static final int ClusterId_LocalizationConfiguration = 0x0000002B; - public static final int ClusterId_LocalizationTimeFormat = 0x0000002C; - public static final int ClusterId_LocalizationUnit = 0x0000002D; - public static final int ClusterId_PowerSourceConfiguration = 0x0000002E; - public static final int ClusterId_PowerSource = 0x0000002F; - public static final int ClusterId_GeneralCommissioning = 0x00000030; - public static final int ClusterId_NetworkCommissioning = 0x00000031; - public static final int ClusterId_DiagnosticLogs = 0x00000032; - public static final int ClusterId_GeneralDiagnostics = 0x00000033; - public static final int ClusterId_SoftwareDiagnostics = 0x00000034; - public static final int ClusterId_ThreadNetworkDiagnostics = 0x00000035; - public static final int ClusterId_WiFiNetworkDiagnostics = 0x00000036; - public static final int ClusterId_EthernetNetworkDiagnostics = 0x00000037; - public static final int ClusterId_TimeSynchronization = 0x00000038; - public static final int ClusterId_BridgedDeviceBasic = 0x00000039; - public static final int ClusterId_Switch = 0x0000003B; - public static final int ClusterId_AdministratorCommissioning = 0x0000003C; - public static final int ClusterId_OperationalCredentials = 0x0000003E; - public static final int ClusterId_GroupKeyManagement = 0x0000003F; - public static final int ClusterId_FixedLabel = 0x00000040; - public static final int ClusterId_UserLabel = 0x00000041; - public static final int ClusterId_ProxyConfiguration = 0x00000042; - public static final int ClusterId_ProxyDiscovery = 0x00000043; - public static final int ClusterId_ProxyValid = 0x00000044; - public static final int ClusterId_BooleanState = 0x00000045; - public static final int ClusterId_ModeSelect = 0x00000050; - public static final int ClusterId_ShadeConfiguration = 0x00000100; - public static final int ClusterId_DoorLock = 0x00000101; - public static final int ClusterId_WindowCovering = 0x00000102; - public static final int ClusterId_BarrierControl = 0x00000103; - public static final int ClusterId_PumpConfigurationAndControl = 0x00000200; - public static final int ClusterId_Thermostat = 0x00000201; - public static final int ClusterId_FanControl = 0x00000202; - public static final int ClusterId_DehumidificationControl = 0x00000203; - public static final int ClusterId_ThermostatUserInterfaceConfiguration = 0x00000204; - public static final int ClusterId_ColorControl = 0x00000300; - public static final int ClusterId_BallastConfiguration = 0x00000301; - public static final int ClusterId_IlluminanceMeasurement = 0x00000400; - public static final int ClusterId_TemperatureMeasurement = 0x00000402; - public static final int ClusterId_PressureMeasurement = 0x00000403; - public static final int ClusterId_FlowMeasurement = 0x00000404; - public static final int ClusterId_RelativeHumidityMeasurement = 0x00000405; - public static final int ClusterId_OccupancySensing = 0x00000406; - public static final int ClusterId_CarbonMonoxideConcentrationMeasurement = 0x0000040C; - public static final int ClusterId_CarbonDioxideConcentrationMeasurement = 0x0000040D; - public static final int ClusterId_EthyleneConcentrationMeasurement = 0x0000040E; - public static final int ClusterId_EthyleneOxideConcentrationMeasurement = 0x0000040F; - public static final int ClusterId_HydrogenConcentrationMeasurement = 0x00000410; - public static final int ClusterId_HydrogenSulphideConcentrationMeasurement = 0x00000411; - public static final int ClusterId_NitricOxideConcentrationMeasurement = 0x00000412; - public static final int ClusterId_NitrogenDioxideConcentrationMeasurement = 0x00000413; - public static final int ClusterId_OxygenConcentrationMeasurement = 0x00000414; - public static final int ClusterId_OzoneConcentrationMeasurement = 0x00000415; - public static final int ClusterId_SulfurDioxideConcentrationMeasurement = 0x00000416; - public static final int ClusterId_DissolvedOxygenConcentrationMeasurement = 0x00000417; - public static final int ClusterId_BromateConcentrationMeasurement = 0x00000418; - public static final int ClusterId_ChloraminesConcentrationMeasurement = 0x00000419; - public static final int ClusterId_ChlorineConcentrationMeasurement = 0x0000041A; - public static final int ClusterId_FecalColiformAndEColiConcentrationMeasurement = 0x0000041B; - public static final int ClusterId_FluorideConcentrationMeasurement = 0x0000041C; - public static final int ClusterId_HaloaceticAcidsConcentrationMeasurement = 0x0000041D; - public static final int ClusterId_TotalTrihalomethanesConcentrationMeasurement = 0x0000041E; - public static final int ClusterId_TotalColiformBacteriaConcentrationMeasurement = 0x0000041F; - public static final int ClusterId_TurbidityConcentrationMeasurement = 0x00000420; - public static final int ClusterId_CopperConcentrationMeasurement = 0x00000421; - public static final int ClusterId_LeadConcentrationMeasurement = 0x00000422; - public static final int ClusterId_ManganeseConcentrationMeasurement = 0x00000423; - public static final int ClusterId_SulfateConcentrationMeasurement = 0x00000424; - public static final int ClusterId_BromodichloromethaneConcentrationMeasurement = 0x00000425; - public static final int ClusterId_BromoformConcentrationMeasurement = 0x00000426; - public static final int ClusterId_ChlorodibromomethaneConcentrationMeasurement = 0x00000427; - public static final int ClusterId_ChloroformConcentrationMeasurement = 0x00000428; - public static final int ClusterId_SodiumConcentrationMeasurement = 0x00000429; - public static final int ClusterId_IasZone = 0x00000500; - public static final int ClusterId_IasAce = 0x00000501; - public static final int ClusterId_IasWd = 0x00000502; - public static final int ClusterId_WakeOnLan = 0x00000503; - public static final int ClusterId_Channel = 0x00000504; - public static final int ClusterId_TargetNavigator = 0x00000505; - public static final int ClusterId_MediaPlayback = 0x00000506; - public static final int ClusterId_MediaInput = 0x00000507; - public static final int ClusterId_LowPower = 0x00000508; - public static final int ClusterId_KeypadInput = 0x00000509; - public static final int ClusterId_ContentLauncher = 0x0000050A; - public static final int ClusterId_AudioOutput = 0x0000050B; - public static final int ClusterId_ApplicationLauncher = 0x0000050C; - public static final int ClusterId_ApplicationBasic = 0x0000050D; - public static final int ClusterId_AccountLogin = 0x0000050E; - public static final int ClusterId_TestCluster = 0xFFF1FC05; - public static final int ClusterId_Messaging = 0x00000703; - public static final int ClusterId_ApplianceIdentification = 0x00000B00; - public static final int ClusterId_MeterIdentification = 0x00000B01; - public static final int ClusterId_ApplianceEventsAndAlert = 0x00000B02; - public static final int ClusterId_ApplianceStatistics = 0x00000B03; - public static final int ClusterId_ElectricalMeasurement = 0x00000B04; + public static final long ClusterId_PowerConfiguration = 0x00000001; + public static final long ClusterId_DeviceTemperatureConfiguration = 0x00000002; + public static final long ClusterId_Identify = 0x00000003; + public static final long ClusterId_Groups = 0x00000004; + public static final long ClusterId_Scenes = 0x00000005; + public static final long ClusterId_OnOff = 0x00000006; + public static final long ClusterId_OnOffSwitchConfiguration = 0x00000007; + public static final long ClusterId_LevelControl = 0x00000008; + public static final long ClusterId_Alarms = 0x00000009; + public static final long ClusterId_Time = 0x0000000A; + public static final long ClusterId_BinaryInputBasic = 0x0000000F; + public static final long ClusterId_PowerProfile = 0x0000001A; + public static final long ClusterId_ApplianceControl = 0x0000001B; + public static final long ClusterId_PulseWidthModulation = 0x0000001C; + public static final long ClusterId_Descriptor = 0x0000001D; + public static final long ClusterId_Binding = 0x0000001E; + public static final long ClusterId_AccessControl = 0x0000001F; + public static final long ClusterId_PollControl = 0x00000020; + public static final long ClusterId_Actions = 0x00000025; + public static final long ClusterId_Basic = 0x00000028; + public static final long ClusterId_OtaSoftwareUpdateProvider = 0x00000029; + public static final long ClusterId_OtaSoftwareUpdateRequestor = 0x0000002A; + public static final long ClusterId_LocalizationConfiguration = 0x0000002B; + public static final long ClusterId_LocalizationTimeFormat = 0x0000002C; + public static final long ClusterId_LocalizationUnit = 0x0000002D; + public static final long ClusterId_PowerSourceConfiguration = 0x0000002E; + public static final long ClusterId_PowerSource = 0x0000002F; + public static final long ClusterId_GeneralCommissioning = 0x00000030; + public static final long ClusterId_NetworkCommissioning = 0x00000031; + public static final long ClusterId_DiagnosticLogs = 0x00000032; + public static final long ClusterId_GeneralDiagnostics = 0x00000033; + public static final long ClusterId_SoftwareDiagnostics = 0x00000034; + public static final long ClusterId_ThreadNetworkDiagnostics = 0x00000035; + public static final long ClusterId_WiFiNetworkDiagnostics = 0x00000036; + public static final long ClusterId_EthernetNetworkDiagnostics = 0x00000037; + public static final long ClusterId_TimeSynchronization = 0x00000038; + public static final long ClusterId_BridgedDeviceBasic = 0x00000039; + public static final long ClusterId_Switch = 0x0000003B; + public static final long ClusterId_AdministratorCommissioning = 0x0000003C; + public static final long ClusterId_OperationalCredentials = 0x0000003E; + public static final long ClusterId_GroupKeyManagement = 0x0000003F; + public static final long ClusterId_FixedLabel = 0x00000040; + public static final long ClusterId_UserLabel = 0x00000041; + public static final long ClusterId_ProxyConfiguration = 0x00000042; + public static final long ClusterId_ProxyDiscovery = 0x00000043; + public static final long ClusterId_ProxyValid = 0x00000044; + public static final long ClusterId_BooleanState = 0x00000045; + public static final long ClusterId_ModeSelect = 0x00000050; + public static final long ClusterId_ShadeConfiguration = 0x00000100; + public static final long ClusterId_DoorLock = 0x00000101; + public static final long ClusterId_WindowCovering = 0x00000102; + public static final long ClusterId_BarrierControl = 0x00000103; + public static final long ClusterId_PumpConfigurationAndControl = 0x00000200; + public static final long ClusterId_Thermostat = 0x00000201; + public static final long ClusterId_FanControl = 0x00000202; + public static final long ClusterId_DehumidificationControl = 0x00000203; + public static final long ClusterId_ThermostatUserInterfaceConfiguration = 0x00000204; + public static final long ClusterId_ColorControl = 0x00000300; + public static final long ClusterId_BallastConfiguration = 0x00000301; + public static final long ClusterId_IlluminanceMeasurement = 0x00000400; + public static final long ClusterId_TemperatureMeasurement = 0x00000402; + public static final long ClusterId_PressureMeasurement = 0x00000403; + public static final long ClusterId_FlowMeasurement = 0x00000404; + public static final long ClusterId_RelativeHumidityMeasurement = 0x00000405; + public static final long ClusterId_OccupancySensing = 0x00000406; + public static final long ClusterId_CarbonMonoxideConcentrationMeasurement = 0x0000040C; + public static final long ClusterId_CarbonDioxideConcentrationMeasurement = 0x0000040D; + public static final long ClusterId_EthyleneConcentrationMeasurement = 0x0000040E; + public static final long ClusterId_EthyleneOxideConcentrationMeasurement = 0x0000040F; + public static final long ClusterId_HydrogenConcentrationMeasurement = 0x00000410; + public static final long ClusterId_HydrogenSulphideConcentrationMeasurement = 0x00000411; + public static final long ClusterId_NitricOxideConcentrationMeasurement = 0x00000412; + public static final long ClusterId_NitrogenDioxideConcentrationMeasurement = 0x00000413; + public static final long ClusterId_OxygenConcentrationMeasurement = 0x00000414; + public static final long ClusterId_OzoneConcentrationMeasurement = 0x00000415; + public static final long ClusterId_SulfurDioxideConcentrationMeasurement = 0x00000416; + public static final long ClusterId_DissolvedOxygenConcentrationMeasurement = 0x00000417; + public static final long ClusterId_BromateConcentrationMeasurement = 0x00000418; + public static final long ClusterId_ChloraminesConcentrationMeasurement = 0x00000419; + public static final long ClusterId_ChlorineConcentrationMeasurement = 0x0000041A; + public static final long ClusterId_FecalColiformAndEColiConcentrationMeasurement = 0x0000041B; + public static final long ClusterId_FluorideConcentrationMeasurement = 0x0000041C; + public static final long ClusterId_HaloaceticAcidsConcentrationMeasurement = 0x0000041D; + public static final long ClusterId_TotalTrihalomethanesConcentrationMeasurement = 0x0000041E; + public static final long ClusterId_TotalColiformBacteriaConcentrationMeasurement = 0x0000041F; + public static final long ClusterId_TurbidityConcentrationMeasurement = 0x00000420; + public static final long ClusterId_CopperConcentrationMeasurement = 0x00000421; + public static final long ClusterId_LeadConcentrationMeasurement = 0x00000422; + public static final long ClusterId_ManganeseConcentrationMeasurement = 0x00000423; + public static final long ClusterId_SulfateConcentrationMeasurement = 0x00000424; + public static final long ClusterId_BromodichloromethaneConcentrationMeasurement = 0x00000425; + public static final long ClusterId_BromoformConcentrationMeasurement = 0x00000426; + public static final long ClusterId_ChlorodibromomethaneConcentrationMeasurement = 0x00000427; + public static final long ClusterId_ChloroformConcentrationMeasurement = 0x00000428; + public static final long ClusterId_SodiumConcentrationMeasurement = 0x00000429; + public static final long ClusterId_IasZone = 0x00000500; + public static final long ClusterId_IasAce = 0x00000501; + public static final long ClusterId_IasWd = 0x00000502; + public static final long ClusterId_WakeOnLan = 0x00000503; + public static final long ClusterId_Channel = 0x00000504; + public static final long ClusterId_TargetNavigator = 0x00000505; + public static final long ClusterId_MediaPlayback = 0x00000506; + public static final long ClusterId_MediaInput = 0x00000507; + public static final long ClusterId_LowPower = 0x00000508; + public static final long ClusterId_KeypadInput = 0x00000509; + public static final long ClusterId_ContentLauncher = 0x0000050A; + public static final long ClusterId_AudioOutput = 0x0000050B; + public static final long ClusterId_ApplicationLauncher = 0x0000050C; + public static final long ClusterId_ApplicationBasic = 0x0000050D; + public static final long ClusterId_AccountLogin = 0x0000050E; + public static final long ClusterId_TestCluster = 0xFFF1FC05; + public static final long ClusterId_Messaging = 0x00000703; + public static final long ClusterId_ApplianceIdentification = 0x00000B00; + public static final long ClusterId_MeterIdentification = 0x00000B01; + public static final long ClusterId_ApplianceEventsAndAlert = 0x00000B02; + public static final long ClusterId_ApplianceStatistics = 0x00000B03; + public static final long ClusterId_ElectricalMeasurement = 0x00000B04; } diff --git a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/ContentAppEndpointManager.java b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/ContentAppEndpointManager.java index 92c5e5243b85ad..ed6253fd446ed9 100644 --- a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/ContentAppEndpointManager.java +++ b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/ContentAppEndpointManager.java @@ -2,7 +2,7 @@ public interface ContentAppEndpointManager { - public String sendCommand(int endpointId, int clusterId, int commandId, String commandPayload); + public String sendCommand(int endpointId, long clusterId, long commandId, String commandPayload); - public String readAttribute(int endpointId, int clusterId, int attributeId); + public String readAttribute(int endpointId, long clusterId, long attributeId); } diff --git a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvApp.java b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvApp.java index 92c41fdebc7e6f..d8bb564370afa4 100644 --- a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvApp.java +++ b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvApp.java @@ -28,7 +28,7 @@ public TvApp(TvAppCallback callback) { nativeInit(); } - private void postClusterInit(int clusterId, int endpoint) { + private void postClusterInit(long clusterId, int endpoint) { Log.d(TAG, "postClusterInit for " + clusterId + " at " + endpoint); if (mCallback != null) { mCallback.onClusterInit(this, clusterId, endpoint); diff --git a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvAppCallback.java b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvAppCallback.java index 27d2c7e1aa1e2b..d5bf7a090bc0de 100644 --- a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvAppCallback.java +++ b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/TvAppCallback.java @@ -17,5 +17,5 @@ package com.matter.tv.server.tvapp; public interface TvAppCallback { - void onClusterInit(TvApp app, int clusterId, int endpoint); + void onClusterInit(TvApp app, long clusterId, int endpoint); } diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index 017f377b59e1d2..d004de149235cb 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -334,10 +334,10 @@ void ReportCallback::UpdateClusterDataVersion() // SetDataVersion to NodeState jmethodID setDataVersionMethod; - CHIP_ERROR err = JniReferences::GetInstance().FindMethod(env, mNodeStateObj, "setDataVersion", "(IJI)V", &setDataVersionMethod); + CHIP_ERROR err = JniReferences::GetInstance().FindMethod(env, mNodeStateObj, "setDataVersion", "(IJJ)V", &setDataVersionMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Could not find setDataVersion method")); env->CallVoidMethod(mNodeStateObj, setDataVersionMethod, static_cast(lastConcreteClusterPath.mEndpointId), - static_cast(lastConcreteClusterPath.mClusterId), static_cast(committedDataVersion.Value())); + static_cast(lastConcreteClusterPath.mClusterId), static_cast(committedDataVersion.Value())); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe()); } @@ -428,11 +428,11 @@ CHIP_ERROR CreateChipAttributePath(const app::ConcreteDataAttributePath & aPath, JniClass attributePathJniCls(attributePathCls); jmethodID attributePathCtor = - env->GetStaticMethodID(attributePathCls, "newInstance", "(JJJ)Lchip/devicecontroller/model/ChipAttributePath;"); + env->GetStaticMethodID(attributePathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipAttributePath;"); VerifyOrReturnError(attributePathCtor != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - outObj = - env->CallStaticObjectMethod(attributePathCls, attributePathCtor, aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId); + outObj = env->CallStaticObjectMethod(attributePathCls, attributePathCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mAttributeId)); VerifyOrReturnError(outObj != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); return err; @@ -449,7 +449,7 @@ CHIP_ERROR InvokeCallback::CreateInvokeElement(const app::ConcreteCommandPath & JniClass invokeElementJniCls(invokeElementCls); jmethodID invokeElementCtor = env->GetStaticMethodID(invokeElementCls, "newInstance", - "(JJJ[BLjava/lang/String;)Lchip/devicecontroller/model/InvokeElement;"); + "(IJJ[BLjava/lang/String;)Lchip/devicecontroller/model/InvokeElement;"); VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); VerifyOrReturnError(invokeElementCtor != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); @@ -480,13 +480,15 @@ CHIP_ERROR InvokeCallback::CreateInvokeElement(const app::ConcreteCommandPath & ReturnErrorOnFailure(err); UtfString jsonString(env, JsonToString(json).c_str()); - outObj = env->CallStaticObjectMethod(invokeElementCls, invokeElementCtor, aPath.mEndpointId, aPath.mClusterId, - aPath.mCommandId, jniByteArray.jniValue(), jsonString.jniValue()); + outObj = env->CallStaticObjectMethod(invokeElementCls, invokeElementCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mCommandId), + jniByteArray.jniValue(), jsonString.jniValue()); } else { - outObj = env->CallStaticObjectMethod(invokeElementCls, invokeElementCtor, aPath.mEndpointId, aPath.mClusterId, - aPath.mCommandId, nullptr, nullptr); + outObj = env->CallStaticObjectMethod(invokeElementCls, invokeElementCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mCommandId), nullptr, + nullptr); } VerifyOrReturnError(outObj != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); @@ -504,10 +506,11 @@ CHIP_ERROR ReportCallback::CreateChipEventPath(const app::ConcreteEventPath & aP JniClass eventPathJniCls(eventPathCls); jmethodID eventPathCtor = - env->GetStaticMethodID(eventPathCls, "newInstance", "(JJJ)Lchip/devicecontroller/model/ChipEventPath;"); + env->GetStaticMethodID(eventPathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipEventPath;"); VerifyOrReturnError(eventPathCtor != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - outObj = env->CallStaticObjectMethod(eventPathCls, eventPathCtor, aPath.mEndpointId, aPath.mClusterId, aPath.mEventId); + outObj = env->CallStaticObjectMethod(eventPathCls, eventPathCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mEventId)); VerifyOrReturnError(outObj != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); return err; @@ -558,8 +561,9 @@ CHIP_ERROR ReportCallback::OnResubscriptionNeeded(app::ReadClient * apReadClient env, mResubscriptionAttemptCallbackRef, "onResubscriptionAttempt", "(II)V", &onResubscriptionAttemptMethod)); DeviceLayer::StackUnlock unlock; - env->CallVoidMethod(mResubscriptionAttemptCallbackRef, onResubscriptionAttemptMethod, aTerminationCause.AsInteger(), - apReadClient->ComputeTimeTillNextSubscription()); + env->CallVoidMethod(mResubscriptionAttemptCallbackRef, onResubscriptionAttemptMethod, + static_cast(aTerminationCause.AsInteger()), + static_cast(apReadClient->ComputeTimeTillNextSubscription())); VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); return CHIP_NO_ERROR; } @@ -763,10 +767,11 @@ CHIP_ERROR ReportEventCallback::CreateChipEventPath(const app::ConcreteEventPath JniClass eventPathJniCls(eventPathCls); jmethodID eventPathCtor = - env->GetStaticMethodID(eventPathCls, "newInstance", "(JJJ)Lchip/devicecontroller/model/ChipEventPath;"); + env->GetStaticMethodID(eventPathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipEventPath;"); VerifyOrReturnError(eventPathCtor != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - outObj = env->CallStaticObjectMethod(eventPathCls, eventPathCtor, aPath.mEndpointId, aPath.mClusterId, aPath.mEventId); + outObj = env->CallStaticObjectMethod(eventPathCls, eventPathCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mEventId)); VerifyOrReturnError(outObj != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); return err; @@ -811,8 +816,9 @@ CHIP_ERROR ReportEventCallback::OnResubscriptionNeeded(app::ReadClient * apReadC env, mResubscriptionAttemptCallbackRef, "onResubscriptionAttempt", "(II)V", &onResubscriptionAttemptMethod)); DeviceLayer::StackUnlock unlock; - env->CallVoidMethod(mResubscriptionAttemptCallbackRef, onResubscriptionAttemptMethod, aTerminationCause.AsInteger(), - apReadClient->ComputeTimeTillNextSubscription()); + env->CallVoidMethod(mResubscriptionAttemptCallbackRef, onResubscriptionAttemptMethod, + static_cast(aTerminationCause.AsInteger()), + static_cast(apReadClient->ComputeTimeTillNextSubscription())); return CHIP_NO_ERROR; } @@ -996,8 +1002,7 @@ void InvokeCallback::OnResponse(app::CommandSender * apCommandSender, const app: VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Unable to find onError method: %s", ErrorStr(err))); DeviceLayer::StackUnlock unlock; - env->CallVoidMethod(mJavaCallbackRef, onResponseMethod, invokeElementObj, - static_cast>(aStatusIB.mStatus)); + env->CallVoidMethod(mJavaCallbackRef, onResponseMethod, invokeElementObj, static_cast(aStatusIB.mStatus)); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe()); } diff --git a/src/controller/java/AndroidCurrentFabricRemover.cpp b/src/controller/java/AndroidCurrentFabricRemover.cpp index 1029177ae3db31..4c4ab28412719c 100644 --- a/src/controller/java/AndroidCurrentFabricRemover.cpp +++ b/src/controller/java/AndroidCurrentFabricRemover.cpp @@ -38,7 +38,7 @@ AndroidCurrentFabricRemover::AndroidCurrentFabricRemover(DeviceController * cont env->ExceptionClear(); } - mOnErrorMethod = env->GetMethodID(callbackClass, "onError", "(IJ)V"); + mOnErrorMethod = env->GetMethodID(callbackClass, "onError", "(JI)V"); if (mOnErrorMethod == nullptr) { ChipLogError(Controller, "Failed to access callback 'onError' method"); diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index b1c8b02ff2e597..466c7d6ba92bdb 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -528,7 +528,8 @@ void AndroidDeviceControllerWrapper::OnCommissioningComplete(NodeId deviceId, CH CHIP_ERROR err = JniReferences::GetInstance().FindMethod(env, mJavaObjectRef, "onCommissioningComplete", "(JI)V", &onCommissioningCompleteMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Error finding Java method: %" CHIP_ERROR_FORMAT, err.Format())); - env->CallVoidMethod(mJavaObjectRef, onCommissioningCompleteMethod, static_cast(deviceId), error.AsInteger()); + env->CallVoidMethod(mJavaObjectRef, onCommissioningCompleteMethod, static_cast(deviceId), + static_cast(error.AsInteger())); if (ssidStr != nullptr) { @@ -560,7 +561,7 @@ void AndroidDeviceControllerWrapper::OnCommissioningStatusUpdate(PeerId peerId, UtfString jStageCompleted(env, StageToString(stageCompleted)); env->CallVoidMethod(mJavaObjectRef, onCommissioningStatusUpdateMethod, static_cast(peerId.GetNodeId()), - jStageCompleted.jniValue(), error.AsInteger()); + jStageCompleted.jniValue(), static_cast(error.AsInteger())); } void AndroidDeviceControllerWrapper::OnReadCommissioningInfo(const chip::Controller::ReadCommissioningInfo & info) diff --git a/src/controller/java/src/chip/devicecontroller/model/AttributeWriteRequest.java b/src/controller/java/src/chip/devicecontroller/model/AttributeWriteRequest.java index b479076e13e40a..0b74693480f5ba 100644 --- a/src/controller/java/src/chip/devicecontroller/model/AttributeWriteRequest.java +++ b/src/controller/java/src/chip/devicecontroller/model/AttributeWriteRequest.java @@ -107,7 +107,7 @@ public static AttributeWriteRequest newInstance( /** Create a new {@link AttributeWriteRequest} with only concrete ids. */ public static AttributeWriteRequest newInstance( - long endpointId, long clusterId, long attributeId, byte[] tlv) { + int endpointId, long clusterId, long attributeId, byte[] tlv) { return new AttributeWriteRequest( ChipPathId.forId(endpointId), ChipPathId.forId(clusterId), @@ -117,11 +117,7 @@ public static AttributeWriteRequest newInstance( } public static AttributeWriteRequest newInstance( - long endpointId, - long clusterId, - long attributeId, - byte[] tlv, - Optional dataVersion) { + int endpointId, long clusterId, long attributeId, byte[] tlv, Optional dataVersion) { return new AttributeWriteRequest( ChipPathId.forId(endpointId), ChipPathId.forId(clusterId), diff --git a/src/controller/java/src/chip/devicecontroller/model/ChipAttributePath.java b/src/controller/java/src/chip/devicecontroller/model/ChipAttributePath.java index 31d7a366994c2b..f4b085f0350de4 100644 --- a/src/controller/java/src/chip/devicecontroller/model/ChipAttributePath.java +++ b/src/controller/java/src/chip/devicecontroller/model/ChipAttributePath.java @@ -74,7 +74,7 @@ public static ChipAttributePath newInstance( } /** Create a new {@link ChipAttributePath} with only concrete ids. */ - public static ChipAttributePath newInstance(long endpointId, long clusterId, long attributeId) { + public static ChipAttributePath newInstance(int endpointId, long clusterId, long attributeId) { return new ChipAttributePath( ChipPathId.forId(endpointId), ChipPathId.forId(clusterId), ChipPathId.forId(attributeId)); } diff --git a/src/controller/java/src/chip/devicecontroller/model/ChipEventPath.java b/src/controller/java/src/chip/devicecontroller/model/ChipEventPath.java index b5d1a95315516a..5f6f7c6dcd6be5 100644 --- a/src/controller/java/src/chip/devicecontroller/model/ChipEventPath.java +++ b/src/controller/java/src/chip/devicecontroller/model/ChipEventPath.java @@ -98,7 +98,7 @@ public static ChipEventPath newInstance( /** Create a new {@link ChipEventPath} with only concrete ids. */ public static ChipEventPath newInstance( - long endpointId, long clusterId, long eventId, boolean isUrgent) { + int endpointId, long clusterId, long eventId, boolean isUrgent) { return new ChipEventPath( ChipPathId.forId(endpointId), ChipPathId.forId(clusterId), diff --git a/src/controller/java/src/chip/devicecontroller/model/ClusterState.java b/src/controller/java/src/chip/devicecontroller/model/ClusterState.java index d31069ceac2953..8507682968edc5 100644 --- a/src/controller/java/src/chip/devicecontroller/model/ClusterState.java +++ b/src/controller/java/src/chip/devicecontroller/model/ClusterState.java @@ -26,7 +26,7 @@ public final class ClusterState { private Map attributes; private Map> events; - private Optional dataVersion; + private Optional dataVersion; public ClusterState( Map attributes, Map> events) { @@ -43,11 +43,11 @@ public Map> getEventStates() { return events; } - public void setDataVersion(int version) { + public void setDataVersion(long version) { dataVersion = Optional.of(version); } - public Optional getDataVersion() { + public Optional getDataVersion() { return dataVersion; } diff --git a/src/controller/java/src/chip/devicecontroller/model/InvokeElement.java b/src/controller/java/src/chip/devicecontroller/model/InvokeElement.java index 413d5ac8f4e1dc..2ae4b55ff423e6 100644 --- a/src/controller/java/src/chip/devicecontroller/model/InvokeElement.java +++ b/src/controller/java/src/chip/devicecontroller/model/InvokeElement.java @@ -119,7 +119,7 @@ public static InvokeElement newInstance( /** Create a new {@link InvokeElement} with only concrete ids. */ public static InvokeElement newInstance( - long endpointId, + int endpointId, long clusterId, long commandId, @Nullable byte[] tlv, diff --git a/src/controller/java/src/chip/devicecontroller/model/NodeState.java b/src/controller/java/src/chip/devicecontroller/model/NodeState.java index 7e84997085bc00..c60e3b6205b2cd 100644 --- a/src/controller/java/src/chip/devicecontroller/model/NodeState.java +++ b/src/controller/java/src/chip/devicecontroller/model/NodeState.java @@ -35,7 +35,7 @@ public Map getEndpointStates() { } // Called from native code only, which ignores access modifiers. - private void setDataVersion(int endpointId, long clusterId, int dataVersion) { + private void setDataVersion(int endpointId, long clusterId, long dataVersion) { EndpointState endpointState = getEndpointState(endpointId); ClusterState clusterState = endpointState.getClusterState(clusterId); diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 1a4fae9e22ff32..66c16eb74dc70a 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -290,7 +290,7 @@ CHIP_ERROR JniReferences::CallSubscriptionEstablished(jobject javaCallback, long &subscriptionEstablishedMethod); VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - env->CallVoidMethod(javaCallback, subscriptionEstablishedMethod, subscriptionId); + env->CallVoidMethod(javaCallback, subscriptionEstablishedMethod, static_cast(subscriptionId)); VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); return err;