Rvc op state delegate dummy start stop handlers (#31764)
* Added dummy implementations of the start and stop handler methods to the RvcOperationalState::Delegate class.
* Removed the start and stop handler methods defined in the all-clusters-app RvcOperationalStateDelegate.
* Removed the start and stop handler methods defined in the rvc-app RvcOperationalStateDelegate.
* Restyled by clang-format
* Apply typo fixes from code review
Co-authored-by: Petru Lauric <81822411+plauric@users.noreply.github.com>
---------
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Petru Lauric <81822411+plauric@users.noreply.github.com>
diff --git a/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h
index 89a3e69..4417f9f 100644
--- a/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h
+++ b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h
@@ -91,18 +91,6 @@
void HandleResumeStateCallback(OperationalState::GenericOperationalError & err) override;
/**
- * Handle Command Callback in application: Start
- * @param[out] get operational error after callback.
- */
- void HandleStartStateCallback(OperationalState::GenericOperationalError & err) override;
-
- /**
- * Handle Command Callback in application: Stop
- * @param[out] get operational error after callback.
- */
- void HandleStopStateCallback(OperationalState::GenericOperationalError & err) override;
-
- /**
* Handle the GoHome command.
* @param err
*/
diff --git a/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp b/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp
index 946110b..e41ae2b 100644
--- a/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp
@@ -70,34 +70,6 @@
}
}
-void RvcOperationalStateDelegate::HandleStartStateCallback(OperationalState::GenericOperationalError & err)
-{
- // placeholder implementation
- auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning));
- if (error == CHIP_NO_ERROR)
- {
- err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
- }
- else
- {
- err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
- }
-}
-
-void RvcOperationalStateDelegate::HandleStopStateCallback(OperationalState::GenericOperationalError & err)
-{
- // placeholder implementation
- auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));
- if (error == CHIP_NO_ERROR)
- {
- err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
- }
- else
- {
- err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
- }
-}
-
void RvcOperationalStateDelegate::HandleGoHomeCommandCallback(OperationalState::GenericOperationalError & err)
{
// placeholder implementation
diff --git a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h
index 400dfd6..e40ba64 100644
--- a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h
+++ b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h
@@ -99,22 +99,6 @@
*/
void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override;
- /**
- * Handle Command Callback in application: Start
- * @param[out] get operational error after callback.
- */
- void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{
- // This command in not supported.
- };
-
- /**
- * Handle Command Callback in application: Stop
- * @param[out] get operational error after callback.
- */
- void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{
- // This command in not supported.
- };
-
void SetPauseCallback(HandleOpStateCommand aCallback, RvcDevice * aInstance)
{
mPauseCallback = aCallback;
diff --git a/src/app/clusters/operational-state-server/operational-state-server.h b/src/app/clusters/operational-state-server/operational-state-server.h
index e4ab6d9..5a461c2 100644
--- a/src/app/clusters/operational-state-server/operational-state-server.h
+++ b/src/app/clusters/operational-state-server/operational-state-server.h
@@ -341,10 +341,32 @@
class Delegate : public OperationalState::Delegate
{
public:
+ /**
+ * Handle Command Callback in application: GoHome
+ * @param[out] err operational error after callback.
+ */
virtual void HandleGoHomeCommandCallback(OperationalState::GenericOperationalError & err)
{
err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue));
};
+
+ /**
+ * The start command is not supported by the RvcOperationalState cluster hence this method should never be called.
+ * This is a dummy implementation of the handler method so the consumer of this class does not need to define it.
+ */
+ void HandleStartStateCallback(OperationalState::GenericOperationalError & err) override
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue));
+ };
+
+ /**
+ * The stop command is not supported by the RvcOperationalState cluster hence this method should never be called.
+ * This is a dummy implementation of the handler method so the consumer of this class does not need to define it.
+ */
+ void HandleStopStateCallback(OperationalState::GenericOperationalError & err) override
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue));
+ };
};
class Instance : public OperationalState::Instance