Skip to content

Commit 1b89c4a

Browse files
committed
Add documentation to methods
1 parent e1b7033 commit 1b89c4a

File tree

1 file changed

+72
-1
lines changed

1 file changed

+72
-1
lines changed

src/app/clusters/thermostat-server/thermostat-server.h

+72-1
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,38 @@ class ThermostatAttrAccess : public chip::app::AttributeAccessInterface, public
5757
CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, chip::app::AttributeValueDecoder & aDecoder) override;
5858

5959
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+
*/
6067
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+
*/
6176
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+
*/
6284
Protocols::InteractionModel::Status PrecommitPresets(EndpointId endpoint);
6385

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+
*/
6492
void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex) override;
6593

6694
/**
@@ -79,26 +107,69 @@ class ThermostatAttrAccess : public chip::app::AttributeAccessInterface, public
79107
* @param[in] endpoint The endpoint.
80108
* @param[in] originatorNodeId The originator scoped node id.
81109
* @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
82113
*/
83-
84114
bool
85115
SetAtomicWrite(EndpointId endpoint, ScopedNodeId originatorNodeId, AtomicWriteState state,
86116
Platform::ScopedMemoryBufferWithSize<Globals::Structs::AtomicAttributeStatusStruct::Type> & attributeStatuses);
87117

118+
/**
119+
* @brief Sets the atomic write state for the given endpoint and originatorNodeId
120+
*
121+
*/
88122
/**
89123
* @brief Resets the atomic write for a given endpoint
90124
*
91125
* @param endpoint The endpoint
92126
*/
93127
void ResetAtomicWrite(EndpointId endpoint);
94128

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+
*/
95137
bool InAtomicWrite(EndpointId endpoint, Optional<AttributeId> attributeId = NullOptional);
96138

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+
*/
97149
bool InAtomicWrite(EndpointId endpoint, const Access::SubjectDescriptor & subjectDescriptor,
98150
Optional<AttributeId> attributeId = NullOptional);
99151

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+
*/
100162
bool InAtomicWrite(EndpointId endpoint, CommandHandler * commandObj, Optional<AttributeId> attributeId = NullOptional);
101163

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+
*/
102173
bool
103174
InAtomicWrite(EndpointId endpoint, CommandHandler * commandObj,
104175
Platform::ScopedMemoryBufferWithSize<Globals::Structs::AtomicAttributeStatusStruct::Type> & attributeStatuses);

0 commit comments

Comments
 (0)