Skip to content

Commit

Permalink
Removed attribute-type.h from attribute-metadata and moved definition…
Browse files Browse the repository at this point in the history
…s inside of .cpp file (#35731)
  • Loading branch information
lpbeliveau-silabs authored Sep 23, 2024
1 parent 1597be7 commit 8bc3888
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/app/util/attribute-metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@

#include <app-common/zap-generated/attribute-type.h>

bool EmberAfAttributeMetadata::IsBoolean() const
{
return attributeType == ZCL_BOOLEAN_ATTRIBUTE_TYPE;
}

bool EmberAfAttributeMetadata::IsSignedIntegerAttribute() const
{
return chip::app::IsSignedAttributeType(attributeType);
}

bool emberAfIsStringAttributeType(EmberAfAttributeType attributeType)
{
return (attributeType == ZCL_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
Expand Down
5 changes: 2 additions & 3 deletions src/app/util/attribute-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#pragma once

#include <app-common/zap-generated/attribute-type.h>
#include <app/util/basic-types.h>
#include <cstdint>

Expand Down Expand Up @@ -161,12 +160,12 @@ struct EmberAfAttributeMetadata
/**
* Check wether this attribute is a boolean based on its type according to the spec.
*/
bool IsBoolean() const { return attributeType == ZCL_BOOLEAN_ATTRIBUTE_TYPE; }
bool IsBoolean() const;

/**
* Check wether this attribute is signed based on its type according to the spec.
*/
bool IsSignedIntegerAttribute() const { return chip::app::IsSignedAttributeType(attributeType); }
bool IsSignedIntegerAttribute() const;

/**
* Check whether this attribute has a define min and max.
Expand Down

0 comments on commit 8bc3888

Please sign in to comment.