File tree 1 file changed +6
-8
lines changed
src/app/codegen-data-model
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -304,16 +304,14 @@ CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttribu
304
304
return CHIP_IM_GLOBAL_STATUS (UnsupportedWrite);
305
305
}
306
306
307
- if ((*attributeMetadata)->IsReadOnly () && !request.operationFlags .Has (InteractionModel::OperationFlags::kInternal ))
307
+ // Internal is allowed to bypass timed writes and read-only.
308
+ if (!request.operationFlags .Has (InteractionModel::OperationFlags::kInternal ))
308
309
{
309
- // Internal is allowed to try to bypass read-only updates, however otherwise we deny read-only
310
- // updates
311
- return CHIP_IM_GLOBAL_STATUS (UnsupportedWrite);
312
- }
310
+ VerifyOrReturnError (!(*attributeMetadata)->IsReadOnly (), CHIP_IM_GLOBAL_STATUS (UnsupportedWrite));
313
311
314
- if ( (*attributeMetadata)->MustUseTimedWrite () && !request. writeFlags . Has (InteractionModel::WriteFlags:: kTimed ))
315
- {
316
- return CHIP_IM_GLOBAL_STATUS (NeedsTimedInteraction);
312
+ VerifyOrReturnError (! (*attributeMetadata)->MustUseTimedWrite () ||
313
+ request. writeFlags . Has (InteractionModel::WriteFlags:: kTimed ),
314
+ CHIP_IM_GLOBAL_STATUS (NeedsTimedInteraction) );
317
315
}
318
316
319
317
if (request.path .mDataVersion .HasValue ())
You can’t perform that action at this time.
0 commit comments