@@ -57,10 +57,38 @@ class ThermostatAttrAccess : public chip::app::AttributeAccessInterface, public
57
57
CHIP_ERROR Write (const ConcreteDataAttributePath & aPath, chip::app::AttributeValueDecoder & aDecoder) override ;
58
58
59
59
private:
60
+ /* *
61
+ * @brief Set the Active Preset to a given preset handle, or null
62
+ *
63
+ * @param endpoint The endpoint
64
+ * @param presetHandle The handle of the preset to set active, or null to clear the active preset
65
+ * @return Success if the active preset was updated, an error code if not
66
+ */
60
67
Protocols::InteractionModel::Status SetActivePreset (EndpointId endpoint, DataModel::Nullable<ByteSpan> presetHandle);
68
+
69
+ /* *
70
+ * @brief Apply a preset to the pending lists of presets during an atomic write
71
+ *
72
+ * @param delegate The current ThermostatDelegate
73
+ * @param preset The preset to append
74
+ * @return CHIP_NO_ERROR if successful, an error code if not
75
+ */
61
76
CHIP_ERROR AppendPendingPreset (Thermostat::Delegate * delegate, const Structs::PresetStruct::Type & preset);
77
+
78
+ /* *
79
+ * @brief Verifies if the pending presets for a given endpoint are valid
80
+ *
81
+ * @param endpoint The endpoint
82
+ * @return Success if the list of pending presets is valid, an error code if not
83
+ */
62
84
Protocols::InteractionModel::Status PrecommitPresets (EndpointId endpoint);
63
85
86
+ /* *
87
+ * @brief Callback for when the server is removed from a given fabric; all associated atomic writes are reset
88
+ *
89
+ * @param fabricTable The fabric table
90
+ * @param fabricIndex The fabric index
91
+ */
64
92
void OnFabricRemoved (const FabricTable & fabricTable, FabricIndex fabricIndex) override ;
65
93
66
94
/* *
@@ -79,26 +107,69 @@ class ThermostatAttrAccess : public chip::app::AttributeAccessInterface, public
79
107
* @param[in] endpoint The endpoint.
80
108
* @param[in] originatorNodeId The originator scoped node id.
81
109
* @param[in] state Whether or not an atomic write is open or closed.
110
+ * @param attributeStatuses The set of attribute status structs the atomic write should be associated with
111
+ * @return true if it was able to update the atomic write state
112
+ * @return false if it was unable to update the atomic write state
82
113
*/
83
-
84
114
bool
85
115
SetAtomicWrite (EndpointId endpoint, ScopedNodeId originatorNodeId, AtomicWriteState state,
86
116
Platform::ScopedMemoryBufferWithSize<Globals::Structs::AtomicAttributeStatusStruct::Type> & attributeStatuses);
87
117
118
+ /* *
119
+ * @brief Sets the atomic write state for the given endpoint and originatorNodeId
120
+ *
121
+ */
88
122
/* *
89
123
* @brief Resets the atomic write for a given endpoint
90
124
*
91
125
* @param endpoint The endpoint
92
126
*/
93
127
void ResetAtomicWrite (EndpointId endpoint);
94
128
129
+ /* *
130
+ * @brief Checks if a given endpoint has an atomic write open, optionally filtered by an attribute ID
131
+ *
132
+ * @param endpoint The endpoint
133
+ * @param attributeId The optional attribute ID to filter on
134
+ * @return true if the endpoint has an open atomic write
135
+ * @return false if the endpoint does not have an open atomic write
136
+ */
95
137
bool InAtomicWrite (EndpointId endpoint, Optional<AttributeId> attributeId = NullOptional);
96
138
139
+ /* *
140
+ * @brief Checks if a given endpoint has an atomic write open for a given subject descriptor, optionally filtered by an
141
+ * attribute ID
142
+ *
143
+ * @param endpoint The endpoint
144
+ * @param subjectDescriptor The subject descriptor for the client making a read or write request
145
+ * @param attributeId The optional attribute ID to filter on
146
+ * @return true if the endpoint has an open atomic write
147
+ * @return false if the endpoint does not have an open atomic write
148
+ */
97
149
bool InAtomicWrite (EndpointId endpoint, const Access::SubjectDescriptor & subjectDescriptor,
98
150
Optional<AttributeId> attributeId = NullOptional);
99
151
152
+ /* *
153
+ * @brief Checks if a given endpoint has an atomic write open for a given command invocation, optionally filtered by an
154
+ * attribute ID
155
+ *
156
+ * @param endpoint The endpoint
157
+ * @param commandObj The CommandHandler for the invoked command
158
+ * @param attributeId The optional attribute ID to filter on
159
+ * @return true if the endpoint has an open atomic write
160
+ * @return false if the endpoint does not have an open atomic write
161
+ */
100
162
bool InAtomicWrite (EndpointId endpoint, CommandHandler * commandObj, Optional<AttributeId> attributeId = NullOptional);
101
163
164
+ /* *
165
+ * @brief Checks if a given endpoint has an atomic write open for a given command invocation and a list of attributes
166
+ *
167
+ * @param endpoint The endpoint
168
+ * @param commandObj The CommandHandler for the invoked command
169
+ * @param attributeStatuses The list of attribute statuses whose attributeIds must match the open atomic write
170
+ * @return true if the endpoint has an open atomic write
171
+ * @return false if the endpoint does not have an open atomic write
172
+ */
102
173
bool
103
174
InAtomicWrite (EndpointId endpoint, CommandHandler * commandObj,
104
175
Platform::ScopedMemoryBufferWithSize<Globals::Structs::AtomicAttributeStatusStruct::Type> & attributeStatuses);
0 commit comments