Skip to content

Commit

Permalink
Removing chip:: from the types where not required, as per comments in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mhazley committed Jun 28, 2023
1 parent 59b22c3 commit 01848c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
17 changes: 2 additions & 15 deletions examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class FanAttrAccess : public AttributeAccessInterface
CHIP_ERROR FanAttrAccess::ReadPercentCurrent(EndpointId endpoint, AttributeValueEncoder & aEncoder)
{
// Return PercentSetting attribute value for now
DataModel::Nullable<chip::Percent> percentSetting;
DataModel::Nullable<Percent> percentSetting;
PercentSetting::Get(endpoint, percentSetting);
chip::Percent ret = 0;
Percent ret = 0;
if (!percentSetting.IsNull())
{
ret = percentSetting.Value();
Expand Down Expand Up @@ -103,18 +103,5 @@ CHIP_ERROR FanAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attribut

void emberAfFanControlClusterInitCallback(EndpointId endpoint)
{
// uint32_t featureMap = 0;

// featureMap |= to_underlying(FanControl::Feature::kMultiSpeed);
// featureMap |= to_underlying(FanControl::Feature::kAuto);
// featureMap |= to_underlying(FanControl::Feature::kWind);
// featureMap |= to_underlying(FanControl::Feature::kStep);
// featureMap |= to_underlying(FanControl::Feature::kRocking);
// featureMap |= to_underlying(FanControl::Feature::kAirflowDirection);

// FeatureMap::Set(endpoint, featureMap);
// WindSupport::Set(endpoint, 3);
// RockSupport::Set(endpoint, 3);

registerAttributeAccessOverride(&gAttrAccess);
}
21 changes: 10 additions & 11 deletions src/app/clusters/fan-control-server/fan-control-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,32 @@ bool HasFeature(EndpointId endpoint, Feature feature)
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}

inline bool SupportsMultiSpeed(chip::EndpointId endpointId)
inline bool SupportsMultiSpeed(EndpointId endpointId)
{
return HasFeature(endpointId, Feature::kMultiSpeed);
}

inline bool SupportsAuto(chip::EndpointId endpointId)
inline bool SupportsAuto(EndpointId endpointId)
{
return HasFeature(endpointId, Feature::kAuto);
}

inline bool SupportsRocking(chip::EndpointId endpointId)
inline bool SupportsRocking(EndpointId endpointId)
{
return HasFeature(endpointId, Feature::kRocking);
}

inline bool SupportsWind(chip::EndpointId endpointId)
inline bool SupportsWind(EndpointId endpointId)
{
return HasFeature(endpointId, Feature::kWind);
}

inline bool SupportsStep(chip::EndpointId endpointId)
inline bool SupportsStep(EndpointId endpointId)
{
return HasFeature(endpointId, Feature::kStep);
}

inline bool SupportsAirflowDirection(chip::EndpointId endpointId)
inline bool SupportsAirflowDirection(EndpointId endpointId)
{
return HasFeature(endpointId, Feature::kAirflowDirection);
}
Expand Down Expand Up @@ -207,7 +207,7 @@ MatterFanControlClusterServerPreAttributeChangedCallback(const ConcreteAttribute
case RockSetting::Id: {
if (SupportsRocking(attributePath.mEndpointId))
{
chip::BitMask<RockBitmap> rockSupport;
BitMask<RockBitmap> rockSupport;
EmberAfStatus status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
auto rawRockSupport = rockSupport.Raw();
Expand All @@ -229,7 +229,7 @@ MatterFanControlClusterServerPreAttributeChangedCallback(const ConcreteAttribute
case WindSetting::Id: {
if (SupportsWind(attributePath.mEndpointId))
{
chip::BitMask<WindBitmap> windSupport;
BitMask<WindBitmap> windSupport;
EmberAfStatus status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
auto rawWindSupport = windSupport.Raw();
Expand Down Expand Up @@ -402,9 +402,8 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
}
}

bool emberAfFanControlClusterStepCallback(chip::app::CommandHandler * commandObj,
const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::FanControl::Commands::Step::DecodableType & commandData)
bool emberAfFanControlClusterStepCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
const Commands::Step::DecodableType & commandData)
{
/*
* TODO: Clarification needed in spec issue #6496 - if this is tied to the SpeedSetting attribute, then
Expand Down

0 comments on commit 01848c3

Please sign in to comment.