Skip to content

Commit

Permalink
Remove PowerSourceFeature from the allow list of defines (#25218)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Jun 29, 2023
1 parent 9c4d1e0 commit 3911379
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
10 changes: 6 additions & 4 deletions examples/bridge-app/linux/include/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,18 @@ class DevicePowerSource : public Device
kChanged_Description = kChanged_Last << 2,
} Changed;

DevicePowerSource(const char * szDeviceName, std::string szLocation, uint32_t aFeatureMap) :
Device(szDeviceName, szLocation), mFeatureMap(aFeatureMap){};
DevicePowerSource(const char * szDeviceName, std::string szLocation,
chip::BitFlags<chip::app::Clusters::PowerSource::PowerSourceFeature> aFeatureMap) :
Device(szDeviceName, szLocation),
mFeatureMap(aFeatureMap){};

using DeviceCallback_fn = std::function<void(DevicePowerSource *, DevicePowerSource::Changed_t)>;
void SetChangeCallback(DeviceCallback_fn aChanged_CB) { mChanged_CB = aChanged_CB; }

void SetBatChargeLevel(uint8_t aBatChargeLevel);
void SetDescription(std::string aDescription);

inline uint32_t GetFeatureMap() { return mFeatureMap; };
inline uint32_t GetFeatureMap() { return mFeatureMap.Raw(); };
inline uint8_t GetBatChargeLevel() { return mBatChargeLevel; };
inline uint8_t GetOrder() { return mOrder; };
inline uint8_t GetStatus() { return mStatus; };
Expand All @@ -202,7 +204,7 @@ class DevicePowerSource : public Device
uint8_t mOrder = 0;
uint8_t mStatus = 0;
std::string mDescription = "Primary Battery";
uint32_t mFeatureMap;
chip::BitFlags<chip::app::Clusters::PowerSource::PowerSourceFeature> mFeatureMap;
DeviceCallback_fn mChanged_CB;
};

Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ int main(int argc, char * argv[])

// Setup composed device with two temperature sensors and a power source
ComposedDevice ComposedDevice("Composed Device", "Bedroom");
DevicePowerSource ComposedPowerSource("Composed Power Source", "Bedroom", EMBER_AF_POWER_SOURCE_FEATURE_BATTERY);
DevicePowerSource ComposedPowerSource("Composed Power Source", "Bedroom", PowerSource::PowerSourceFeature::kBattery);

ComposedDevice.SetReachable(true);
ComposedTempSensor1.SetReachable(true);
Expand Down
1 change: 0 additions & 1 deletion src/app/common/templates/config-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ DefineBitmaps:
- BarrierControlSafetyStatus
- ColorLoopUpdateFlags
- LevelControlFeature
- PowerSourceFeature

# We need a more configurable way of deciding which clusters have which init functions....
# See https://github.com/project-chip/connectedhomeip/issues/4369
Expand Down
8 changes: 0 additions & 8 deletions zzz_generated/app-common/app-common/zap-generated/enums.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3911379

Please sign in to comment.