Skip to content

Commit

Permalink
Regenerated files from XMLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hicklin committed Jan 4, 2024
1 parent 0976e3b commit 8cff269
Show file tree
Hide file tree
Showing 23 changed files with 439 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3556,6 +3556,8 @@ cluster RvcOperationalState = 97 {
command Start(): OperationalCommandResponse = 2;
/** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */
command Resume(): OperationalCommandResponse = 3;
/** On receipt of this command, the device SHALL start seeking the charging dock, if possible in the current state of the device. */
command GoHome(): OperationalCommandResponse = 128;
}

/** Attributes and commands for monitoring HEPA filters in a device */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,8 @@ cluster RvcOperationalState = 97 {
command Start(): OperationalCommandResponse = 2;
/** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */
command Resume(): OperationalCommandResponse = 3;
/** On receipt of this command, the device SHALL start seeking the charging dock, if possible in the current state of the device. */
command GoHome(): OperationalCommandResponse = 128;
}

endpoint 0 {
Expand Down
2 changes: 2 additions & 0 deletions examples/rvc-app/rvc-common/rvc-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,8 @@ cluster RvcOperationalState = 97 {
command Start(): OperationalCommandResponse = 2;
/** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */
command Resume(): OperationalCommandResponse = 3;
/** On receipt of this command, the device SHALL start seeking the charging dock, if possible in the current state of the device. */
command GoHome(): OperationalCommandResponse = 128;
}

endpoint 0 {
Expand Down
2 changes: 2 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3892,6 +3892,8 @@ cluster RvcOperationalState = 97 {
command Start(): OperationalCommandResponse = 2;
/** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */
command Resume(): OperationalCommandResponse = 3;
/** On receipt of this command, the device SHALL start seeking the charging dock, if possible in the current state of the device. */
command GoHome(): OperationalCommandResponse = 128;
}

/** Attributes and commands for monitoring HEPA filters in a device */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26323,6 +26323,32 @@ public void onResponse(StructType invokeStructValue) {
}}, commandId, value, timedInvokeTimeoutMs);
}

public void goHome(OperationalCommandResponseCallback callback) {
goHome(callback, 0);
}

public void goHome(OperationalCommandResponseCallback callback, int timedInvokeTimeoutMs) {
final long commandId = 128L;

ArrayList<StructElement> elements = new ArrayList<>();
StructType value = new StructType(elements);
invoke(new InvokeCallbackImpl(callback) {
@Override
public void onResponse(StructType invokeStructValue) {
final long commandResponseStateFieldID = 0L;
ChipStructs.RvcOperationalStateClusterErrorStateStruct commandResponseState = null;
for (StructElement element: invokeStructValue.value()) {
if (element.contextTagNum() == commandResponseStateFieldID) {
if (element.value(BaseTLVType.class).type() == TLVType.Struct) {
StructType castingValue = element.value(StructType.class);
commandResponseState = ChipStructs.RvcOperationalStateClusterErrorStateStruct.decodeTlv(castingValue);
}
}
}
callback.onSuccess(commandResponseState);
}}, commandId, value, timedInvokeTimeoutMs);
}

public interface OperationalCommandResponseCallback extends BaseClusterCallback {
void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct commandResponseState);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8509,7 +8509,8 @@ public enum Command {
Pause(0L),
Stop(1L),
Start(2L),
Resume(3L),;
Resume(3L),
GoHome(128L),;
private final long id;
Command(long id) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22781,6 +22781,18 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() {
);
rvcOperationalStateClusterInteractionInfoMap.put("resume", rvcOperationalStateresumeInteractionInfo);

Map<String, CommandParameterInfo> rvcOperationalStategoHomeCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo rvcOperationalStategoHomeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.RvcOperationalStateCluster) cluster)
.goHome((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback
);
},
() -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(),
rvcOperationalStategoHomeCommandParams
);
rvcOperationalStateClusterInteractionInfoMap.put("goHome", rvcOperationalStategoHomeInteractionInfo);

commandMap.put("rvcOperationalState", rvcOperationalStateClusterInteractionInfoMap);

Map<String, InteractionInfo> hepaFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,48 @@ class RvcOperationalStateCluster(
return OperationalCommandResponse(commandResponseState_decoded)
}

suspend fun goHome(timedInvokeTimeout: Duration? = null): OperationalCommandResponse {
val commandId: UInt = 128u

val tlvWriter = TlvWriter()
tlvWriter.startStructure(AnonymousTag)
tlvWriter.endStructure()

val request: InvokeRequest =
InvokeRequest(
CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
tlvPayload = tlvWriter.getEncoded(),
timedRequest = timedInvokeTimeout
)

val response: InvokeResponse = controller.invoke(request)
logger.log(Level.FINE, "Invoke command succeeded: ${response}")

val tlvReader = TlvReader(response.payload)
tlvReader.enterStructure(AnonymousTag)
val TAG_COMMAND_RESPONSE_STATE: Int = 0
var commandResponseState_decoded: RvcOperationalStateClusterErrorStateStruct? = null

while (!tlvReader.isEndOfContainer()) {
val tag = tlvReader.peekElement().tag

if (tag == ContextSpecificTag(TAG_COMMAND_RESPONSE_STATE)) {
commandResponseState_decoded =
RvcOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader)
} else {
tlvReader.skipElement()
}
}

if (commandResponseState_decoded == null) {
throw IllegalStateException("commandResponseState not found in TLV")
}

tlvReader.exitContainer()

return OperationalCommandResponse(commandResponseState_decoded)
}

suspend fun readPhaseListAttribute(): PhaseListAttribute {
val ATTRIBUTE_ID: UInt = 0u

Expand Down
6 changes: 6 additions & 0 deletions src/controller/python/chip/clusters/CHIPClusters.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8cff269

Please sign in to comment.