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

Remove PowerSourceFeature from the allow list of defines #25218

Merged
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
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.