18
18
#include < app-common/zap-generated/attributes/Accessors.h>
19
19
#include < rvc-service-area-delegate.h>
20
20
21
+ using namespace chip ;
21
22
using namespace chip ::app::Clusters;
22
23
using namespace chip ::app::Clusters::ServiceArea;
23
24
@@ -74,14 +75,13 @@ CHIP_ERROR RvcServiceAreaDelegate::Init()
74
75
// *************************************************************************
75
76
// command support
76
77
77
- bool RvcServiceAreaDelegate::IsSetSelectedLocationsAllowed (char * statusText)
78
+ bool RvcServiceAreaDelegate::IsSetSelectedLocationsAllowed (MutableCharSpan statusText)
78
79
{
79
80
return true ; // TODO IMPLEMENT
80
81
};
81
82
82
83
bool RvcServiceAreaDelegate::IsValidSelectLocationsSet (const Commands::SelectLocations::DecodableType & req,
83
- SelectLocationsStatus & locationStatus, char * statusText,
84
- bool & useStatusText)
84
+ SelectLocationsStatus & locationStatus, MutableCharSpan statusText)
85
85
{
86
86
bool ret_value = false ;
87
87
@@ -90,7 +90,7 @@ bool RvcServiceAreaDelegate::IsValidSelectLocationsSet(const Commands::SelectLoc
90
90
return ret_value;
91
91
};
92
92
93
- bool RvcServiceAreaDelegate::HandleSkipCurrentLocation (char * skipStatusText)
93
+ bool RvcServiceAreaDelegate::HandleSkipCurrentLocation (MutableCharSpan skipStatusText)
94
94
{
95
95
bool ret_value = false ;
96
96
@@ -177,23 +177,20 @@ bool RvcServiceAreaDelegate::AddSupportedLocation(const LocationStructureWrapper
177
177
178
178
bool RvcServiceAreaDelegate::ModifySupportedLocation (uint32_t listIndex, const LocationStructureWrapper & modifiedLocation)
179
179
{
180
- bool ret_value = false ;
181
-
182
180
// The server instance (caller) is responsible for ensuring that there are no duplicate location IDs, list size not exceeded,
183
181
// etc.
184
182
185
183
// Double-check that locationID's match.
186
- VerifyOrExit ((modifiedLocation.locationID == mSupportedLocations [listIndex].locationID ),
187
- ChipLogError (Zcl, " ModifySupportedLocation - new locationID %u does not match existing locationID %u" ,
188
- modifiedLocation.locationID , mSupportedLocations [listIndex].locationID ));
184
+ if (modifiedLocation.locationID != mSupportedLocations [listIndex].locationID )
185
+ {
186
+ ChipLogError (Zcl, " ModifySupportedLocation - locationID's do not match, new locationID %u, existing locationID %u" ,
187
+ modifiedLocation.locationID , mSupportedLocations [listIndex].locationID );
188
+ return false ;
189
+ }
189
190
190
191
// checks passed, update the attribute
191
192
mSupportedLocations [listIndex] = modifiedLocation;
192
- ret_value = true ;
193
-
194
- exit :
195
-
196
- return ret_value;
193
+ return true ;
197
194
}
198
195
199
196
bool RvcServiceAreaDelegate::ClearSupportedLocations ()
@@ -285,22 +282,19 @@ bool RvcServiceAreaDelegate::AddSupportedMap(const MapStructureWrapper & newMap,
285
282
286
283
bool RvcServiceAreaDelegate::ModifySupportedMap (uint32_t listIndex, const MapStructureWrapper & modifiedMap)
287
284
{
288
- bool ret_value = false ;
289
-
290
285
// The server instance (caller) is responsible for ensuring that there are no duplicate location IDs, list size not exceeded,
291
286
// etc.
292
287
293
288
// Double-check that mapID's match.
294
- VerifyOrExit ((modifiedMap.mapID == mSupportedMaps [listIndex].mapID ),
295
- ChipLogError (Zcl, " ModifySupportedMap - mapID's do not match, new mapID %u, existing mapID %u" , modifiedMap.mapID ,
296
- mSupportedMaps [listIndex].mapID ));
289
+ if (modifiedMap.mapID != mSupportedMaps [listIndex].mapID ) {
290
+ ChipLogError (Zcl, " ModifySupportedMap - mapID's do not match, new mapID %u, existing mapID %u" , modifiedMap.mapID ,
291
+ mSupportedMaps [listIndex].mapID );
292
+ return false ;
293
+ }
297
294
298
295
// save modified map
299
296
mSupportedMaps [listIndex] = modifiedMap;
300
- ret_value = true ;
301
-
302
- exit :
303
- return ret_value;
297
+ return true ;
304
298
}
305
299
306
300
bool RvcServiceAreaDelegate::ClearSupportedMaps ()
0 commit comments