Skip to content

Commit 9961bb8

Browse files
authored
Add largeMessage property support to Commands based on the quality setting in xml. (project-chip#36310)
* Expose a bool-returning method 'CommandIsLarge' via the cluster-objects zap template. * Set the largeMessage=true for the 'CaptureSnapshot' command in AVStreamMgmt cluster xml.
1 parent 1e1c248 commit 9961bb8

File tree

7 files changed

+39
-0
lines changed

7 files changed

+39
-0
lines changed

src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ DataModel::CommandEntry CommandEntryFrom(const ConcreteClusterPath & clusterPath
241241
entry.info.flags.Set(DataModel::CommandQualityFlags::kFabricScoped,
242242
CommandIsFabricScoped(clusterPath.mClusterId, clusterCommandId));
243243

244+
entry.info.flags.Set(DataModel::CommandQualityFlags::kLargeMessage,
245+
CommandHasLargePayload(clusterPath.mClusterId, clusterCommandId));
244246
return entry;
245247
}
246248

src/app/data-model-provider/MetadataTypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ struct AttributeEntry
8383
static const AttributeEntry kInvalid;
8484
};
8585

86+
// Bitmask values for different Command qualities.
8687
enum class CommandQualityFlags : uint32_t
8788
{
8889
kFabricScoped = 0x0001,
8990
kTimed = 0x0002, // `T` quality on commands
91+
kLargeMessage = 0x0004, // `L` quality on commands
9092
};
9193

9294
struct CommandInfo

src/app/zap-templates/templates/app/cluster-objects-src.zapt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,21 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand)
261261
return false;
262262
}
263263

264+
bool CommandHasLargePayload(ClusterId aCluster, CommandId aCommand)
265+
{
266+
{{#zcl_clusters}}
267+
{{#zcl_commands}}
268+
{{#if isLargeMessage}}
269+
if ((aCluster == Clusters::{{asUpperCamelCase parent.name}}::Id) &&
270+
(aCommand == Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id))
271+
{
272+
return true;
273+
}
274+
{{/if}}
275+
{{/zcl_commands}}
276+
{{/zcl_clusters}}
277+
return false;
278+
}
279+
264280
} // namespace app
265281
} // namespace chip

src/app/zap-templates/templates/app/cluster-objects.zapt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public:
228228

229229
bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand);
230230
bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand);
231+
bool CommandHasLargePayload(ClusterId aCluster, CommandId aCommand);
231232

232233
} // namespace app
233234
} // namespace chip

src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,15 @@ Git: 0.9-fall2024-411-g9835b5cd7
380380

381381
<command code="0x0B" source="client" name="CaptureSnapshot" optional="true">
382382
<description>This command SHALL return a Snapshot from the camera.</description>
383+
<quality largeMessage="true"/>
383384
<access op="invoke" privilege="manage"/>
384385
<arg id="0" name="SnapshotStreamID" type="int16u"/>
385386
<arg id="1" name="RequestedResolution" type="VideoResolutionStruct"/>
386387
</command>
387388

388389
<command code="0x0C" source="server" name="CaptureSnapshotResponse" optional="true" disableDefaultResponse="true">
389390
<description>This command SHALL be sent by the device in response to the CaptureSnapshot command, carrying the requested snapshot.</description>
391+
<quality largeMessage="true"/>
390392
<arg id="0" name="Data" type="octet_string"/>
391393
<arg id="1" name="ImageCodec" type="ImageCodecEnum" min="0x00" max="0x00"/>
392394
<arg id="2" name="Resolution" type="VideoResolutionStruct"/>

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

Lines changed: 15 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)