Skip to content

Commit 46be675

Browse files
authored
Merge branch 'master' into feature/fix-cluster-revisions
2 parents 618997a + d7a7928 commit 46be675

File tree

4 files changed

+22
-56
lines changed

4 files changed

+22
-56
lines changed

examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h

-12
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,6 @@ class RvcOperationalStateDelegate : public Delegate
9090
*/
9191
void HandleResumeStateCallback(OperationalState::GenericOperationalError & err) override;
9292

93-
/**
94-
* Handle Command Callback in application: Start
95-
* @param[out] get operational error after callback.
96-
*/
97-
void HandleStartStateCallback(OperationalState::GenericOperationalError & err) override;
98-
99-
/**
100-
* Handle Command Callback in application: Stop
101-
* @param[out] get operational error after callback.
102-
*/
103-
void HandleStopStateCallback(OperationalState::GenericOperationalError & err) override;
104-
10593
/**
10694
* Handle the GoHome command.
10795
* @param err

examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp

-28
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,6 @@ void RvcOperationalStateDelegate::HandleResumeStateCallback(OperationalState::Ge
7070
}
7171
}
7272

73-
void RvcOperationalStateDelegate::HandleStartStateCallback(OperationalState::GenericOperationalError & err)
74-
{
75-
// placeholder implementation
76-
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning));
77-
if (error == CHIP_NO_ERROR)
78-
{
79-
err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
80-
}
81-
else
82-
{
83-
err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
84-
}
85-
}
86-
87-
void RvcOperationalStateDelegate::HandleStopStateCallback(OperationalState::GenericOperationalError & err)
88-
{
89-
// placeholder implementation
90-
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));
91-
if (error == CHIP_NO_ERROR)
92-
{
93-
err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
94-
}
95-
else
96-
{
97-
err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
98-
}
99-
}
100-
10173
void RvcOperationalStateDelegate::HandleGoHomeCommandCallback(OperationalState::GenericOperationalError & err)
10274
{
10375
// placeholder implementation

examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h

-16
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,6 @@ class RvcOperationalStateDelegate : public RvcOperationalState::Delegate
9999
*/
100100
void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override;
101101

102-
/**
103-
* Handle Command Callback in application: Start
104-
* @param[out] get operational error after callback.
105-
*/
106-
void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{
107-
// This command in not supported.
108-
};
109-
110-
/**
111-
* Handle Command Callback in application: Stop
112-
* @param[out] get operational error after callback.
113-
*/
114-
void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{
115-
// This command in not supported.
116-
};
117-
118102
void SetPauseCallback(HandleOpStateCommand aCallback, RvcDevice * aInstance)
119103
{
120104
mPauseCallback = aCallback;

src/app/clusters/operational-state-server/operational-state-server.h

+22
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,32 @@ namespace RvcOperationalState {
341341
class Delegate : public OperationalState::Delegate
342342
{
343343
public:
344+
/**
345+
* Handle Command Callback in application: GoHome
346+
* @param[out] err operational error after callback.
347+
*/
344348
virtual void HandleGoHomeCommandCallback(OperationalState::GenericOperationalError & err)
345349
{
346350
err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue));
347351
};
352+
353+
/**
354+
* The start command is not supported by the RvcOperationalState cluster hence this method should never be called.
355+
* This is a dummy implementation of the handler method so the consumer of this class does not need to define it.
356+
*/
357+
void HandleStartStateCallback(OperationalState::GenericOperationalError & err) override
358+
{
359+
err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue));
360+
};
361+
362+
/**
363+
* The stop command is not supported by the RvcOperationalState cluster hence this method should never be called.
364+
* This is a dummy implementation of the handler method so the consumer of this class does not need to define it.
365+
*/
366+
void HandleStopStateCallback(OperationalState::GenericOperationalError & err) override
367+
{
368+
err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue));
369+
};
348370
};
349371

350372
class Instance : public OperationalState::Instance

0 commit comments

Comments
 (0)