diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt index 47247f7ed557cb..97b2576827079a 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt @@ -303,7 +303,11 @@ class DeviceProvisioningFragment : Fragment() { requireActivity(), getString( R.string.icd_registration_completed, - icdDeviceInfo.userActiveModeTriggerHint.toString() + icdDeviceInfo.userActiveModeTriggerHint.toString(), + icdDeviceInfo.userActiveModeTriggerInstruction, + icdDeviceInfo.idleModeDuration.toString(), + icdDeviceInfo.activeModeDuration.toString(), + icdDeviceInfo.activeModeThreshold.toString() ), Toast.LENGTH_LONG ) diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index c50bf0a22a74af..e0e709e1f946fd 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -791,6 +791,9 @@ void AndroidDeviceControllerWrapper::OnReadCommissioningInfo(const chip::Control memset(mUserActiveModeTriggerInstructionBuffer, 0x00, kUserActiveModeTriggerInstructionBufferLen); CopyCharSpanToMutableCharSpan(info.icd.userActiveModeTriggerInstruction, mUserActiveModeTriggerInstruction); + ChipLogProgress(AppServer, "OnReadCommissioningInfo ICD - IdleModeDuration=%u activeModeDuration=%u activeModeThreshold=%u", + info.icd.idleModeDuration, info.icd.activeModeDuration, info.icd.activeModeThreshold); + env->CallVoidMethod(mJavaObjectRef.ObjectRef(), onReadCommissioningInfoMethod, static_cast(info.basic.vendorId), static_cast(info.basic.productId), static_cast(info.network.wifi.endpoint), static_cast(info.network.thread.endpoint)); @@ -1035,7 +1038,7 @@ void AndroidDeviceControllerWrapper::OnICDRegistrationComplete(chip::NodeId icdN methodErr = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ICDDeviceInfo", icdDeviceInfoClass); VerifyOrReturn(methodErr == CHIP_NO_ERROR, ChipLogError(Controller, "Could not find class ICDDeviceInfo")); - icdDeviceInfoStructCtor = env->GetMethodID(icdDeviceInfoClass, "", "([BILjava/lang/String;JJJJI)V"); + icdDeviceInfoStructCtor = env->GetMethodID(icdDeviceInfoClass, "", "([BILjava/lang/String;JJIJJJJI)V"); VerifyOrReturn(icdDeviceInfoStructCtor != nullptr, ChipLogError(Controller, "Could not find ICDDeviceInfo constructor")); methodErr = @@ -1047,7 +1050,8 @@ void AndroidDeviceControllerWrapper::OnICDRegistrationComplete(chip::NodeId icdN icdDeviceInfoObj = env->NewObject( icdDeviceInfoClass, icdDeviceInfoStructCtor, jSymmetricKey, static_cast(mUserActiveModeTriggerHint.Raw()), - jUserActiveModeTriggerInstruction, static_cast(icdNodeId), static_cast(icdCounter), + jUserActiveModeTriggerInstruction, static_cast(mIdleModeDuration), static_cast(mActiveModeDuration), + static_cast(mActiveModeThreshold), static_cast(icdNodeId), static_cast(icdCounter), static_cast(mAutoCommissioner.GetCommissioningParameters().GetICDMonitoredSubject().Value()), static_cast(Controller()->GetFabricId()), static_cast(Controller()->GetFabricIndex())); diff --git a/src/controller/java/AndroidDeviceControllerWrapper.h b/src/controller/java/AndroidDeviceControllerWrapper.h index ae8b8aac2b58f8..f89a841945d099 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.h +++ b/src/controller/java/AndroidDeviceControllerWrapper.h @@ -271,6 +271,9 @@ class AndroidDeviceControllerWrapper : public chip::Controller::DevicePairingDel chip::MutableCharSpan mUserActiveModeTriggerInstruction = chip::MutableCharSpan(mUserActiveModeTriggerInstructionBuffer); chip::BitMask mUserActiveModeTriggerHint; + uint32_t mIdleModeDuration = 0; + uint32_t mActiveModeDuration = 0; + uint16_t mActiveModeThreshold = 0; chip::Controller::CommissioningParameters mCommissioningParameter; AndroidDeviceControllerWrapper(ChipDeviceControllerPtr controller, diff --git a/src/controller/java/src/chip/devicecontroller/ICDDeviceInfo.java b/src/controller/java/src/chip/devicecontroller/ICDDeviceInfo.java index 5d55e8cf291594..70cbeb61cff5f4 100644 --- a/src/controller/java/src/chip/devicecontroller/ICDDeviceInfo.java +++ b/src/controller/java/src/chip/devicecontroller/ICDDeviceInfo.java @@ -56,6 +56,9 @@ public int getBitIndex() { private final byte[] symmetricKey; private final Set userActiveModeTriggerHint; private final String userActiveModeTriggerInstruction; + private final long idleModeDuration; + private final long activeModeDuration; + private final int activeModeThreshold; private final long icdNodeId; private final long icdCounter; private final long monitoredSubject; @@ -66,6 +69,9 @@ public int getBitIndex() { byte[] symmetricKey, Set userActiveModeTriggerHint, String userActiveModeTriggerInstruction, + long idleModeDuration, + long activeModeDuration, + int activeModeThreshold, long icdNodeId, long icdCounter, long monitoredSubject, @@ -74,6 +80,9 @@ public int getBitIndex() { this.symmetricKey = symmetricKey; this.userActiveModeTriggerHint = userActiveModeTriggerHint; this.userActiveModeTriggerInstruction = userActiveModeTriggerInstruction; + this.idleModeDuration = idleModeDuration; + this.activeModeDuration = activeModeDuration; + this.activeModeThreshold = activeModeThreshold; this.icdNodeId = icdNodeId; this.icdCounter = icdCounter; this.monitoredSubject = monitoredSubject; @@ -85,6 +94,9 @@ public int getBitIndex() { byte[] symmetricKey, int userActiveModeTriggerHintRaw, String userActiveModeTriggerInstruction, + long idleModeDuration, + long activeModeDuration, + int activeModeThreshold, long icdNodeId, long icdCounter, long monitoredSubject, @@ -92,6 +104,9 @@ public int getBitIndex() { int fabricIndex) { this.symmetricKey = symmetricKey; this.userActiveModeTriggerInstruction = userActiveModeTriggerInstruction; + this.idleModeDuration = idleModeDuration; + this.activeModeDuration = activeModeDuration; + this.activeModeThreshold = activeModeThreshold; this.icdNodeId = icdNodeId; this.icdCounter = icdCounter; this.monitoredSubject = monitoredSubject; @@ -122,6 +137,21 @@ public String getUserActiveModeTriggerInstruction() { return userActiveModeTriggerInstruction; } + /** Returns the GetIdleModeDuration. */ + public long getIdleModeDuration() { + return idleModeDuration; + } + + /** Returns the GetActiveModeDuration. */ + public long getActiveModeDuration() { + return activeModeDuration; + } + + /** Returns the GetActiveModeThreshold. */ + public int getActiveModeThreshold() { + return activeModeThreshold; + } + /** Returns the ICD Node Id. */ public long getIcdNodeId() { return icdNodeId;