Skip to content

Commit f1bb116

Browse files
committed
Updated the Service Area code documentation following a review comment. Move the IsProgressElement to the delegate and added a default implementation.
1 parent b356de3 commit f1bb116

5 files changed

+191
-330
lines changed

src/app/clusters/service-area-server/service-area-cluster-objects.h

-6
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ inline constexpr size_t kMapNameMaxSize = 64u;
3535
*/
3636
struct LocationStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::LocationStruct::Type
3737
{
38-
/**
39-
* @brief This is a default constructor that initializes the location object with default values.
40-
*/
4138
LocationStructureWrapper()
4239
{
4340
Set(0, 0, CharSpan(), DataModel::Nullable<int16_t>(), DataModel::Nullable<AreaTypeTag>(),
@@ -274,9 +271,6 @@ struct LocationStructureWrapper : public chip::app::Clusters::ServiceArea::Struc
274271
*/
275272
struct MapStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::MapStruct::Type
276273
{
277-
/**
278-
* @brief This is a default constructor that initializes the map object with default values.
279-
*/
280274
MapStructureWrapper() { Set(0, CharSpan()); }
281275

282276
/**

src/app/clusters/service-area-server/service-area-delegate.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ bool Delegate::GetSupportedLocationById(uint32_t aLocationId, uint32_t & listInd
2424
return ret_value;
2525
};
2626

27-
/**
28-
* When we cannot guarantee that the restrictions imposed on the SupportedLocations, CurrentLocation and Progress attributes
29-
* can be upheld, these attributes are set to null.
30-
*
31-
* The user is free the redefine this method as their device may have more information on what has changed and may be able to
32-
* maintain the restrictions on these attributes by selectively editing them.
33-
*/
3427
void Delegate::HandleSupportedLocationsUpdated()
3528
{
3629
mInstance->ClearSelectedLocations();
@@ -99,3 +92,11 @@ bool Delegate::GetProgressElementById(uint32_t aLocationId, uint32_t & listIndex
9992

10093
return ret_value;
10194
};
95+
96+
bool Delegate::IsProgressElement(uint32_t aLocationId)
97+
{
98+
uint32_t index;
99+
Structs::ProgressStruct::Type progressElement;
100+
101+
return GetProgressElementById(aLocationId, index, progressElement);
102+
}

0 commit comments

Comments
 (0)