@@ -134,7 +134,7 @@ CHIP_ERROR Instance::ReadSupportedAreas(AttributeValueEncoder & aEncoder)
134
134
{
135
135
if (mDelegate ->GetNumberOfSupportedAreas () == 0 )
136
136
{
137
- return aEncoder.EncodeNull ();
137
+ return aEncoder.EncodeEmptyList ();
138
138
}
139
139
140
140
return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
@@ -153,7 +153,7 @@ CHIP_ERROR Instance::ReadSupportedMaps(AttributeValueEncoder & aEncoder)
153
153
{
154
154
if (mDelegate ->GetNumberOfSupportedMaps () == 0 )
155
155
{
156
- return aEncoder.EncodeNull ();
156
+ return aEncoder.EncodeEmptyList ();
157
157
}
158
158
159
159
return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
@@ -172,7 +172,7 @@ CHIP_ERROR Instance::ReadSelectedAreas(AttributeValueEncoder & aEncoder)
172
172
{
173
173
if (mDelegate ->GetNumberOfSelectedAreas () == 0 )
174
174
{
175
- return aEncoder.EncodeNull ();
175
+ return aEncoder.EncodeEmptyList ();
176
176
}
177
177
178
178
return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
@@ -191,7 +191,7 @@ CHIP_ERROR Instance::ReadProgress(AttributeValueEncoder & aEncoder)
191
191
{
192
192
if (mDelegate ->GetNumberOfProgressElements () == 0 )
193
193
{
194
- return aEncoder.EncodeNull ();
194
+ return aEncoder.EncodeEmptyList ();
195
195
}
196
196
197
197
return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
@@ -224,9 +224,8 @@ void Instance::HandleSelectAreasCmd(HandlerContext & ctx, const Commands::Select
224
224
225
225
size_t numberOfLocations = 0 ;
226
226
// Get the number of Selected Locations in the command parameter and check that it is valid.
227
- if (!req.newAreas .IsNull ())
228
227
{
229
- if (CHIP_NO_ERROR != req.newAreas .Value (). ComputeSize (&numberOfLocations))
228
+ if (CHIP_NO_ERROR != req.newAreas .ComputeSize (&numberOfLocations))
230
229
{
231
230
ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::InvalidCommand);
232
231
return ;
@@ -244,14 +243,14 @@ void Instance::HandleSelectAreasCmd(HandlerContext & ctx, const Commands::Select
244
243
// if number of selected locations in parameter matches number in attribute - the locations *might* be the same
245
244
bool matchesCurrentSelectedAreas = (numberOfLocations == mDelegate ->GetNumberOfSelectedAreas ());
246
245
247
- if (!req. newAreas . IsNull () )
246
+ if (numberOfLocations != 0 )
248
247
{
249
248
// do as much parameter validation as we can
250
249
{
251
250
uint32_t ignoredIndex = 0 ;
252
251
uint32_t oldSelectedLocation;
253
252
uint32_t i = 0 ;
254
- auto iLocationIter = req.newAreas .Value (). begin ();
253
+ auto iLocationIter = req.newAreas .begin ();
255
254
while (iLocationIter.Next ())
256
255
{
257
256
uint32_t aSelectedLocation = iLocationIter.GetValue ();
@@ -266,7 +265,7 @@ void Instance::HandleSelectAreasCmd(HandlerContext & ctx, const Commands::Select
266
265
267
266
// Checking for duplicate locations.
268
267
uint32_t j = 0 ;
269
- auto jLocationIter = req.newAreas .Value (). begin ();
268
+ auto jLocationIter = req.newAreas .begin ();
270
269
while (j < i)
271
270
{
272
271
jLocationIter
@@ -343,9 +342,9 @@ void Instance::HandleSelectAreasCmd(HandlerContext & ctx, const Commands::Select
343
342
// and the SelectedAreas attribute SHALL be set to the value of the newAreas field.
344
343
mDelegate ->ClearSelectedAreas ();
345
344
346
- if (!req. newAreas . IsNull () )
345
+ if (numberOfLocations != 0 )
347
346
{
348
- auto locationIter = req.newAreas .Value (). begin ();
347
+ auto locationIter = req.newAreas .begin ();
349
348
uint32_t ignored;
350
349
while (locationIter.Next ())
351
350
{
0 commit comments