Skip to content

Commit 2ead5da

Browse files
Converted return type for Unsupported Attribtue according to spec
1 parent 5345c52 commit 2ead5da

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/app/clusters/scenes-server/SceneHandlerImpl.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ Type ConvertDefaultValueToWorkingValue(const EmberAfDefaultAttributeValue & defa
4040
{
4141
return static_cast<Type>(defaultValue.defaultValue);
4242
}
43-
else
44-
{
45-
Type sValue = 0;
46-
memcpy(&sValue, defaultValue.ptrToDefaultValue, sizeof(Type));
47-
return app::NumericAttributeTraits<Type>::StorageToWorking(sValue);
48-
}
43+
44+
Type sValue = 0;
45+
memcpy(&sValue, defaultValue.ptrToDefaultValue, sizeof(Type));
46+
return app::NumericAttributeTraits<Type>::StorageToWorking(sValue);
4947
}
5048

5149
/// CapAttributeID

src/app/clusters/scenes-server/scenes-server.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ CHIP_ERROR AddResponseOnError(CommandHandlerInterface::HandlerContext & ctx, Res
7171
{
7272
resp.status = to_underlying(Protocols::InteractionModel::Status::ResourceExhausted);
7373
}
74+
else if (CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute) == err)
75+
{
76+
// TODO: Confirm if we need to add UnsupportedAttribute status as a return for Scene Commands
77+
resp.status = to_underlying(Protocols::InteractionModel::Status::InvalidCommand);
78+
}
7479
else
7580
{
7681
resp.status = to_underlying(StatusIB(err).mStatus);

0 commit comments

Comments
 (0)