From a4c47e9735a8a439a86b99d85c246b49bf38c40d Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 1 Apr 2022 12:16:28 +0200 Subject: [PATCH] [chip-tool] Add optional event min argument to read/subscribe events commands (#16867) --- examples/chip-tool/commands/clusters/ReportCommand.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index 86ea8014d345d8..dfad33a1c614ab 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -289,6 +289,7 @@ class ReportCommand : public ModelCommand, public chip::app::ReadClient::Callbac chip::app::ReadPrepareParams params(device->GetSecureSession().Value()); params.mpEventPathParamsList = eventPathParams; params.mEventPathParamsListSize = pathsCount; + params.mEventNumber = mEventNumber.ValueOr(0); params.mpAttributePathParamsList = nullptr; params.mAttributePathParamsListSize = 0; @@ -317,6 +318,8 @@ class ReportCommand : public ModelCommand, public chip::app::ReadClient::Callbac // up needing it in our class's shared code. chip::Optional mFabricFiltered; + chip::Optional mEventNumber; + CHIP_ERROR mError = CHIP_NO_ERROR; }; @@ -448,6 +451,7 @@ class ReadEvent : public ReportCommand { AddArgument("cluster-id", 0, UINT32_MAX, &mClusterIds); AddArgument("event-id", 0, UINT32_MAX, &mEventIds); + AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); } @@ -455,6 +459,7 @@ class ReadEvent : public ReportCommand ReportCommand("read-event-by-id", credsIssuerConfig), mClusterIds(1, clusterId) { AddArgument("event-id", 0, UINT32_MAX, &mEventIds); + AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); } @@ -464,6 +469,7 @@ class ReadEvent : public ReportCommand mClusterIds(1, clusterId), mEventIds(1, eventId) { AddArgument("event-name", eventName); + AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); } @@ -489,6 +495,7 @@ class SubscribeEvent : public ReportCommand AddArgument("event-id", 0, UINT32_MAX, &mEventIds); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); } @@ -498,6 +505,7 @@ class SubscribeEvent : public ReportCommand AddArgument("event-id", 0, UINT32_MAX, &mEventIds); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); } @@ -509,6 +517,7 @@ class SubscribeEvent : public ReportCommand AddArgument("attr-name", eventName); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); }