Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop generating attribute accessors for AttributeAccessInterface-only attributes. #26279

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::DeviceLayer;

void emberAfBasicInformationClusterInitCallback(EndpointId endpoint)
{
uint16_t year;
uint8_t month;
uint8_t dayOfMonth;
char cString[16] = "00000000";

if (GetDeviceInstanceInfoProvider()->GetManufacturingDate(year, month, dayOfMonth) == CHIP_NO_ERROR)
{
snprintf(cString, sizeof(cString), "%04u%02u%02u", year, month, dayOfMonth);
}
BasicInformation::Attributes::ManufacturingDate::Set(endpoint, CharSpan(cString));
}

void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size,
uint8_t * value)
{
Expand Down
14 changes: 0 additions & 14 deletions examples/lighting-app/infineon/cyw30739/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,6 @@ using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::DeviceLayer;

void emberAfBasicInformationClusterInitCallback(EndpointId endpoint)
{
uint16_t year;
uint8_t month;
uint8_t dayOfMonth;
char cString[16] = "00000000";

if (GetDeviceInstanceInfoProvider()->GetManufacturingDate(year, month, dayOfMonth) == CHIP_NO_ERROR)
{
snprintf(cString, sizeof(cString), "%04u%02u%02u", year, month, dayOfMonth);
}
BasicInformation::Attributes::ManufacturingDate::Set(endpoint, CharSpan(cString));
}

void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size,
uint8_t * value)

Expand Down
14 changes: 0 additions & 14 deletions examples/lock-app/infineon/cyw30739/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@ using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::DeviceLayer;

void emberAfBasicInformationClusterInitCallback(EndpointId endpoint)
{
uint16_t year;
uint8_t month;
uint8_t dayOfMonth;
char cString[16] = "00000000";

if (GetDeviceInstanceInfoProvider()->GetManufacturingDate(year, month, dayOfMonth) == CHIP_NO_ERROR)
{
snprintf(cString, sizeof(cString), "%04u%02u%02u", year, month, dayOfMonth);
}
BasicInformation::Attributes::ManufacturingDate::Set(endpoint, CharSpan(cString));
}

void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size,
uint8_t * value)
{
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-cert-bins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb
# ZAP Development install, so that it runs on both x64 and arm64
# Generally this should match with the ZAP version that is used for codegen within the
# specified SHA
ARG ZAP_VERSION=v2023.04.21-nightly
ARG ZAP_VERSION=v2023.04.27-nightly

# Ensure TARGETPLATFORM is set
RUN case ${TARGETPLATFORM} in \
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup/zap.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"mac-arm64",
"windows-amd64"
],
"tags": ["version:[email protected].21-nightly.1"]
"tags": ["version:[email protected].27-nightly.1"]
}
]
}
2 changes: 1 addition & 1 deletion scripts/tools/zap/zap_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Use scripts/tools/zap/version_update.py to manage ZAP versioning as many
# files may need updating for versions
#
MIN_ZAP_VERSION = '2023.4.21'
MIN_ZAP_VERSION = '2023.4.27'


class ZapTool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ namespace {{asUpperCamelCase parent.label}} {
namespace Attributes {

{{/first}}
{{#unless (isStrEqual storagePolicy "attributeAccessInterface")}}
{{#if_is_struct type}}
{{else if (canHaveSimpleAccessors this)}}
#error Attribute "{{name}}" in cluster "{{../name}}" is struct-typed and must be added to the attributeAccessInterfaceAttributes object in src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/zcl-with-test-extensions.json
{{/if_is_struct}}
namespace {{asUpperCamelCase label}} {

{{#*inline "clusterId"}}Clusters::{{asUpperCamelCase parent.label}}::Id{{/inline}}
Expand Down Expand Up @@ -133,7 +135,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectTy

} // namespace {{asUpperCamelCase label}}

{{/if_is_struct}}
{{/unless}}
{{#last}}
} // namespace Attributes
} // {{asUpperCamelCase parent.label}}
Expand Down
5 changes: 2 additions & 3 deletions src/app/zap-templates/templates/app/attributes/Accessors.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ namespace {{asUpperCamelCase parent.label}} {
namespace Attributes {

{{/first}}
{{#if_is_struct type}}
{{else if (canHaveSimpleAccessors this)}}
{{#unless (isStrEqual storagePolicy "attributeAccessInterface")}}
namespace {{asUpperCamelCase label}} {
EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value); // {{type}}
EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotNullable=true forceNotOptional=true}} value);
Expand All @@ -34,7 +33,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectTy
{{/if}}
} // namespace {{asUpperCamelCase label}}

{{/if_is_struct}}
{{/unless}}
{{#last}}
} // namespace Attributes
} // {{asUpperCamelCase parent.label}}
Expand Down
6 changes: 5 additions & 1 deletion src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@
"PacketUnicastTxCount",
"CurrentMaxRate",
"OverrunCount"
]
],
"Channel": ["Lineup", "CurrentChannel"],
"Media Playback": ["SampledPosition"],
"Application Launcher": ["CurrentApp"],
"Application Basic": ["Application"]
},
"defaultReportingPolicy": "mandatory",
"ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"],
Expand Down
6 changes: 5 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@
"PacketUnicastTxCount",
"CurrentMaxRate",
"OverrunCount"
]
],
"Channel": ["Lineup", "CurrentChannel"],
"Media Playback": ["SampledPosition"],
"Application Launcher": ["CurrentApp"],
"Application Basic": ["Application"]
},
"defaultReportingPolicy": "mandatory",
"ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"],
Expand Down
Loading