Skip to content

Commit

Permalink
[nxp][examples][common][lock-app] Add DiagnosticLog and Update zap file
Browse files Browse the repository at this point in the history
 * Add DiagnosticLogs in lock-app ZclCallbacks.cpp
 * Update zap file: enable door-lock attributes

Signed-off-by: Andrei Menzopol <[email protected]>
Signed-off-by: Ethan Tan <[email protected]>
  • Loading branch information
andrei-menzopol committed Oct 21, 2024
1 parent 1a87789 commit 0f97f5f
Show file tree
Hide file tree
Showing 3 changed files with 496 additions and 22 deletions.
17 changes: 17 additions & 0 deletions examples/lock-app/nxp/common/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,20 @@
#include "UserInterfaceFeedback.h"
#endif

#if CONFIG_DIAG_LOGS_DEMO
#include <DiagnosticLogsProviderDelegateImpl.h>
#include <app/clusters/diagnostic-logs-server/diagnostic-logs-server.h>
#endif

using namespace ::chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::DoorLock;
using chip::app::DataModel::Nullable;

#if CONFIG_DIAG_LOGS_DEMO
using namespace ::chip::app::Clusters::DiagnosticLogs;
#endif

void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
Expand Down Expand Up @@ -158,3 +167,11 @@ void emberAfPluginDoorLockOnAutoRelock(chip::EndpointId endpointId)
DoorLockServer::Instance().SetLockState(1, DlLockState::kLocked, OperationSourceEnum::kAuto, NullNullable, NullNullable,
NullNullable, NullNullable);
}

#if CONFIG_DIAG_LOGS_DEMO
void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint)
{
auto & logProvider = LogProvider::GetInstance();
DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider);
}
#endif
35 changes: 34 additions & 1 deletion examples/lock-app/nxp/zap/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,10 @@ endpoint 0 {
callback attribute serverList;
callback attribute clientList;
callback attribute partsList;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
callback attribute clusterRevision;
}
Expand All @@ -2400,7 +2404,7 @@ endpoint 0 {
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute featureMap default = 1;
callback attribute clusterRevision;
}

Expand Down Expand Up @@ -2439,6 +2443,10 @@ endpoint 0 {
ram attribute updatePossible default = 1;
ram attribute updateState default = 0;
ram attribute updateStateProgress default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

Expand Down Expand Up @@ -2622,6 +2630,10 @@ endpoint 0 {
callback attribute windowStatus;
callback attribute adminFabricIndex;
callback attribute adminVendorId;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

Expand All @@ -2636,6 +2648,10 @@ endpoint 0 {
callback attribute commissionedFabrics;
callback attribute trustedRootCertificates;
callback attribute currentFabricIndex;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

Expand All @@ -2658,6 +2674,10 @@ endpoint 0 {
callback attribute groupTable;
callback attribute maxGroupsPerFabric;
callback attribute maxGroupKeysPerFabric;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
callback attribute clusterRevision;

Expand Down Expand Up @@ -2772,6 +2792,19 @@ endpoint 1 {
handle command GetYearDayScheduleResponse;
handle command ClearYearDaySchedule;
handle command SetHolidaySchedule;
handle command GetHolidaySchedule;
handle command GetHolidayScheduleResponse;
handle command ClearHolidaySchedule;
handle command SetUser;
handle command GetUser;
handle command GetUserResponse;
handle command ClearUser;
handle command SetCredential;
handle command SetCredentialResponse;
handle command GetCredentialStatus;
handle command GetCredentialStatusResponse;
handle command ClearCredential;
handle command UnboltDoor;
handle command SetAliroReaderConfig;
handle command ClearAliroReaderConfig;
}
Expand Down
Loading

0 comments on commit 0f97f5f

Please sign in to comment.