diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index dbe4e60174e231..5a3a3307020604 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -32,8 +32,7 @@ class ReportCommand : public ModelCommand, public chip::app::ReadClient::Callbac ModelCommand(commandName, credsIssuerConfig), mBufferedReadAdapter(*this) {} - virtual void OnAttributeSubscription(){}; - virtual void OnEventSubscription(){}; + virtual void OnSubscription(){}; /////////// ReadClient Callback Interface ///////// void OnAttributeData(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data, @@ -105,7 +104,7 @@ class ReportCommand : public ModelCommand, public chip::app::ReadClient::Callbac SetCommandExitStatus(mError); } - void OnSubscriptionEstablished(uint64_t subscriptionId) override { OnAttributeSubscription(); } + void OnSubscriptionEstablished(uint64_t subscriptionId) override { OnSubscription(); } protected: CHIP_ERROR ReportAttribute(ChipDevice * device, std::vector endpointIds, @@ -431,11 +430,9 @@ class SubscribeAttribute : public ReportCommand mDataVersion); } - chip::System::Clock::Timeout GetWaitDuration() const override { return ReportCommand::GetWaitDuration(); } - - void OnAttributeSubscription() override + void OnSubscription() override { - // The ReadClient instance can not be released directly into the OnAttributeSubscription + // The ReadClient instance can not be released directly into the OnSubscription // callback since it happens to be called by ReadClient itself which is doing additional // work after that. chip::DeviceLayer::PlatformMgr().ScheduleWork( @@ -547,9 +544,7 @@ class SubscribeEvent : public ReportCommand chip::app::ReadClient::InteractionType::Subscribe, mMinInterval, mMaxInterval); } - chip::System::Clock::Timeout GetWaitDuration() const override { return ReportCommand::GetWaitDuration(); } - - void OnEventSubscription() override + void OnSubscription() override { // The ReadClient instance can not be released directly into the OnEventSubscription // callback since it happens to be called by ReadClient itself which is doing additional