Skip to content

Commit

Permalink
Fix reading attribute activeLocale failure
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Jan 25, 2022
1 parent 8541f47 commit 332471a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ using namespace chip::app::Clusters::LocalizationConfiguration::Attributes;

namespace {

constexpr size_t kMaxActiveLocaleLength = 35;

class LocalizationConfigurationAttrAccess : public AttributeAccessInterface
{
public:
Expand Down Expand Up @@ -150,7 +152,9 @@ void emberAfLocalizationConfigurationClusterServerInitCallback(EndpointId endpoi
{
DeviceLayer::AttributeList<CharSpan, DeviceLayer::kMaxLanguageTags> supportedLocales;
CharSpan validLocale;
MutableCharSpan activeLocale;

char outBuffer[kMaxActiveLocaleLength] = "";
MutableCharSpan activeLocale(outBuffer, kMaxActiveLocaleLength);
EmberAfStatus status = ActiveLocale::Get(endpoint, activeLocale);

VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Failed to read ActiveLocale with error: 0x%02x", status));
Expand Down

0 comments on commit 332471a

Please sign in to comment.