Skip to content

Commit

Permalink
Cleanup some unused functionality from app/util/util.cpp (project-c…
Browse files Browse the repository at this point in the history
…hip#32382)

* Remove unused zclClusterNames method and usage. Intent is to make util.cpp less dependent on generated code

* Remove one more undefined and never used definition
  • Loading branch information
andy31415 authored Mar 1, 2024
1 parent 42727b1 commit a986606
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 999 deletions.
5 changes: 0 additions & 5 deletions src/app/common/templates/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
"name": "ZCL callback header",
"output": "callback.h"
},
{
"path": "../../zap-templates/templates/app/print-cluster.zapt",
"name": "ZCL print-cluster header",
"output": "print-cluster.h"
},
{
"path": "../../zap-templates/templates/app/attributes/Accessors.zapt",
"name": "Attributes Accessors header",
Expand Down
37 changes: 0 additions & 37 deletions src/app/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app-common/zap-generated/print-cluster.h>
#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
Expand All @@ -41,23 +40,6 @@ using namespace chip;

using chip::Protocols::InteractionModel::Status;

//------------------------------------------------------------------------------
// Forward Declarations

//------------------------------------------------------------------------------
// Globals

const EmberAfClusterName zclClusterNames[] = {
CLUSTER_IDS_TO_NAMES // defined in print-cluster.h
{ kInvalidClusterId, nullptr }, // terminator
};

#ifdef MATTER_DM_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS
MATTER_DM_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS
#endif

//------------------------------------------------------------------------------

// Is the device identifying?
bool emberAfIsDeviceIdentifying(EndpointId endpoint)
{
Expand Down Expand Up @@ -174,25 +156,6 @@ void MatterPowerTopologyPluginServerInitCallback() {}
void MatterElectricalEnergyMeasurementPluginServerInitCallback() {}
void MatterElectricalPowerMeasurementPluginServerInitCallback() {}

// ****************************************
// Print out information about each cluster
// ****************************************

uint16_t emberAfFindClusterNameIndex(ClusterId cluster)
{
static_assert(sizeof(ClusterId) == 4, "May need to adjust our index type or somehow define it in terms of cluster id type");
uint16_t index = 0;
while (zclClusterNames[index].id != kInvalidClusterId)
{
if (zclClusterNames[index].id == cluster)
{
return index;
}
index++;
}
return 0xFFFF;
}

#if (CHIP_CONFIG_BIG_ENDIAN_TARGET)
#define EM_BIG_ENDIAN true
#else
Expand Down
10 changes: 0 additions & 10 deletions src/app/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,7 @@
#include <app/util/af-types.h>
#include <app/util/endpoint-config-api.h>

// Cluster name structure
typedef struct
{
chip::ClusterId id;
const char * name;
} EmberAfClusterName;

extern const EmberAfClusterName zclClusterNames[];

void emberAfInit();
uint16_t emberAfFindClusterNameIndex(chip::ClusterId cluster);

/**
* Retrieves the difference between the two passed values.
Expand Down
26 changes: 0 additions & 26 deletions src/app/zap-templates/templates/app/print-cluster.zapt

This file was deleted.

Loading

0 comments on commit a986606

Please sign in to comment.