@@ -51,6 +51,9 @@ InvokeCommandRequest(Messaging::ExchangeManager * aExchangeMgr, const SessionHan
51
51
const Optional<uint16_t > & timedInvokeTimeoutMs,
52
52
const Optional<System::Clock::Timeout> & responseTimeout = NullOptional)
53
53
{
54
+ // InvokeCommandRequest expects responses, so cannot happen over a group session.
55
+ VerifyOrReturnError (!sessionHandle->IsGroupSession (), CHIP_ERROR_INVALID_ARGUMENT);
56
+
54
57
app::CommandPathParams commandPath = { endpointId, 0 , RequestObjectT::GetClusterId (), RequestObjectT::GetCommandId (),
55
58
(app::CommandPathFlags::kEndpointIdValid ) };
56
59
@@ -91,14 +94,13 @@ InvokeCommandRequest(Messaging::ExchangeManager * aExchangeMgr, const SessionHan
91
94
}
92
95
93
96
/*
94
- * A typed group command invocation function that takes as input a cluster-object representation of a command request and
95
- * callbacks when completed trought the done callback
97
+ * A typed group command invocation function that takes as input a cluster-object representation of a command request.
96
98
*
97
99
* The RequestObjectT is generally expected to be a ClusterName::Commands::CommandName::Type struct, but any object
98
100
* that can be encoded using the DataModel::Encode machinery and exposes the GetClusterId() and GetCommandId() functions
99
101
* and a ResponseType type is expected to work.
100
102
*
101
- * Since this sends a group command, no response will be received and all allocated rescources will be cleared before exing this
103
+ * Since this sends a group command, no response will be received and all allocated resources will be cleared before exiting this
102
104
* function
103
105
*/
104
106
template <typename RequestObjectT>
0 commit comments