Skip to content

Commit

Permalink
Added support for read OperatingMode in the server
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Jan 11, 2024
1 parent 9d0b14e commit 17a4f0f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,11 @@ cluster UserLabel = 65 {
cluster IcdManagement = 70 {
revision 2;

enum OperatingModeEnum : enum8 {
kSITOperatingMode = 0;
kLITOperatingMode = 1;
}

bitmap Feature : bitmap32 {
kCheckInProtocolSupport = 0x1;
kUserActiveModeTrigger = 0x2;
Expand Down Expand Up @@ -1423,6 +1428,7 @@ cluster IcdManagement = 70 {
readonly attribute optional int16u clientsSupportedPerFabric = 5;
readonly attribute optional UserActiveModeTriggerBitmap userActiveModeTriggerHint = 6;
readonly attribute optional char_string<128> userActiveModeTriggerInstruction = 7;
readonly attribute optional OperatingModeEnum operatingMode = 8;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class IcdManagementAttributeAccess : public AttributeAccessInterface
CHIP_ERROR ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadICDCounter(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadClientsSupportedPerFabric(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadOperatingMode(EndpointId endpoint, AttributeValueEncoder & encoder);

PersistentStorageDelegate * mStorage = nullptr;
Crypto::SymmetricKeystore * mSymmetricKeystore = nullptr;
Expand Down Expand Up @@ -94,6 +95,9 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath &

case IcdManagement::Attributes::ClientsSupportedPerFabric::Id:
return ReadClientsSupportedPerFabric(aPath.mEndpointId, aEncoder);

case IcdManagement::Attributes::OperatingMode::Id:
return ReadOperatingMode(aPath.mEndpointId, aEncoder);
}

return CHIP_NO_ERROR;
Expand Down Expand Up @@ -157,6 +161,11 @@ CHIP_ERROR IcdManagementAttributeAccess::ReadClientsSupportedPerFabric(EndpointI
return encoder.Encode(mICDConfigurationData->GetClientsSupportedPerFabric());
}

CHIP_ERROR IcdManagementAttributeAccess::ReadOperatingMode(EndpointId endpoint, AttributeValueEncoder & encoder)
{
return encoder.Encode(mICDConfigurationData->GetICDMode());
}

/**
* @brief Implementation of Fabric Delegate for ICD Management cluster
*/
Expand Down

0 comments on commit 17a4f0f

Please sign in to comment.