Skip to content

Commit 25fa56f

Browse files
tehampsonj-ororke
authored andcommitted
Add StayActiveDuration to KeepActive in BridgedDevInfo (project-chip#34631)
1 parent 2809924 commit 25fa56f

File tree

20 files changed

+94
-25
lines changed

20 files changed

+94
-25
lines changed

examples/placeholder/linux/apps/app1/config.matter

+5-1
Original file line numberDiff line numberDiff line change
@@ -2441,8 +2441,12 @@ cluster BridgedDeviceBasicInformation = 57 {
24412441
readonly attribute bitmap32 featureMap = 65532;
24422442
readonly attribute int16u clusterRevision = 65533;
24432443

2444+
request struct KeepActiveRequest {
2445+
int32u stayActiveDuration = 0;
2446+
}
2447+
24442448
/** The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. */
2445-
command KeepActive(): DefaultSuccess = 128;
2449+
command KeepActive(KeepActiveRequest): DefaultSuccess = 128;
24462450
}
24472451

24482452
/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices.

examples/placeholder/linux/apps/app2/config.matter

+5-1
Original file line numberDiff line numberDiff line change
@@ -2398,8 +2398,12 @@ cluster BridgedDeviceBasicInformation = 57 {
23982398
readonly attribute bitmap32 featureMap = 65532;
23992399
readonly attribute int16u clusterRevision = 65533;
24002400

2401+
request struct KeepActiveRequest {
2402+
int32u stayActiveDuration = 0;
2403+
}
2404+
24012405
/** The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. */
2402-
command KeepActive(): DefaultSuccess = 128;
2406+
command KeepActive(KeepActiveRequest): DefaultSuccess = 128;
24032407
}
24042408

24052409
/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices.

src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ limitations under the License.
9696

9797
<command source="client" code="0x80" name="KeepActive" optional="true" apiMaturity="provisional">
9898
<description> The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active.</description>
99+
<arg name="StayActiveDuration" type="int32u"/>
99100
</command>
100101

101102
<event side="server" code="0x00" name="StartUp" priority="critical" optional="true">

src/controller/data_model/controller-clusters.matter

+5-1
Original file line numberDiff line numberDiff line change
@@ -2346,8 +2346,12 @@ cluster BridgedDeviceBasicInformation = 57 {
23462346
readonly attribute bitmap32 featureMap = 65532;
23472347
readonly attribute int16u clusterRevision = 65533;
23482348

2349+
request struct KeepActiveRequest {
2350+
int32u stayActiveDuration = 0;
2351+
}
2352+
23492353
/** The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. */
2350-
command KeepActive(): DefaultSuccess = 128;
2354+
command KeepActive(KeepActiveRequest): DefaultSuccess = 128;
23512355
}
23522356

23532357
/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices.

src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -15050,14 +15050,18 @@ public long initWithDevice(long devicePtr, int endpointId) {
1505015050
return 0L;
1505115051
}
1505215052

15053-
public void keepActive(DefaultClusterCallback callback) {
15054-
keepActive(callback, 0);
15053+
public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration) {
15054+
keepActive(callback, stayActiveDuration, 0);
1505515055
}
1505615056

15057-
public void keepActive(DefaultClusterCallback callback, int timedInvokeTimeoutMs) {
15057+
public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration, int timedInvokeTimeoutMs) {
1505815058
final long commandId = 128L;
1505915059

1506015060
ArrayList<StructElement> elements = new ArrayList<>();
15061+
final long stayActiveDurationFieldID = 0L;
15062+
BaseTLVType stayActiveDurationtlvValue = new UIntType(stayActiveDuration);
15063+
elements.add(new StructElement(stayActiveDurationFieldID, stayActiveDurationtlvValue));
15064+
1506115065
StructType commandArgs = new StructType(elements);
1506215066
invoke(new InvokeCallbackImpl(callback) {
1506315067
@Override

src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -4520,7 +4520,24 @@ public static Command value(long id) throws NoSuchFieldError {
45204520
}
45214521
throw new NoSuchFieldError();
45224522
}
4523-
}@Override
4523+
}public enum KeepActiveCommandField {StayActiveDuration(0),;
4524+
private final int id;
4525+
KeepActiveCommandField(int id) {
4526+
this.id = id;
4527+
}
4528+
4529+
public int getID() {
4530+
return id;
4531+
}
4532+
public static KeepActiveCommandField value(int id) throws NoSuchFieldError {
4533+
for (KeepActiveCommandField field : KeepActiveCommandField.values()) {
4534+
if (field.getID() == id) {
4535+
return field;
4536+
}
4537+
}
4538+
throw new NoSuchFieldError();
4539+
}
4540+
}@Override
45244541
public String getAttributeName(long id) throws NoSuchFieldError {
45254542
return Attribute.value(id).toString();
45264543
}

src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java

+5
Original file line numberDiff line numberDiff line change
@@ -24259,10 +24259,15 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() {
2425924259
Map<String, InteractionInfo> bridgedDeviceBasicInformationClusterInteractionInfoMap = new LinkedHashMap<>();
2426024260

2426124261
Map<String, CommandParameterInfo> bridgedDeviceBasicInformationkeepActiveCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
24262+
24263+
CommandParameterInfo bridgedDeviceBasicInformationkeepActivestayActiveDurationCommandParameterInfo = new CommandParameterInfo("stayActiveDuration", Long.class, Long.class);
24264+
bridgedDeviceBasicInformationkeepActiveCommandParams.put("stayActiveDuration",bridgedDeviceBasicInformationkeepActivestayActiveDurationCommandParameterInfo);
2426224265
InteractionInfo bridgedDeviceBasicInformationkeepActiveInteractionInfo = new InteractionInfo(
2426324266
(cluster, callback, commandArguments) -> {
2426424267
((ChipClusters.BridgedDeviceBasicInformationCluster) cluster)
2426524268
.keepActive((DefaultClusterCallback) callback
24269+
, (Long)
24270+
commandArguments.get("stayActiveDuration")
2426624271
);
2426724272
},
2426824273
() -> new DelegatedDefaultClusterCallback(),

src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import matter.controller.cluster.structs.*
4040
import matter.controller.model.AttributePath
4141
import matter.controller.model.CommandPath
4242
import matter.tlv.AnonymousTag
43+
import matter.tlv.ContextSpecificTag
4344
import matter.tlv.TlvReader
4445
import matter.tlv.TlvWriter
4546

@@ -100,11 +101,14 @@ class BridgedDeviceBasicInformationCluster(
100101
object SubscriptionEstablished : AttributeListAttributeSubscriptionState()
101102
}
102103

103-
suspend fun keepActive(timedInvokeTimeout: Duration? = null) {
104+
suspend fun keepActive(stayActiveDuration: UInt, timedInvokeTimeout: Duration? = null) {
104105
val commandId: UInt = 128u
105106

106107
val tlvWriter = TlvWriter()
107108
tlvWriter.startStructure(AnonymousTag)
109+
110+
val TAG_STAY_ACTIVE_DURATION_REQ: Int = 0
111+
tlvWriter.put(ContextSpecificTag(TAG_STAY_ACTIVE_DURATION_REQ), stayActiveDuration)
108112
tlvWriter.endStructure()
109113

110114
val request: InvokeRequest =

src/controller/python/chip/clusters/CHIPClusters.py

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/python/chip/clusters/Objects.py

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRClusters.h

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/cluster-objects.h

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/chip-tool/zap-generated/cluster/Commands.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)