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

Rvc op state delegate dummy start stop handlers #31764

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
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,6 @@ class RvcOperationalStateDelegate : public Delegate
*/
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,34 +70,6 @@ void RvcOperationalStateDelegate::HandleResumeStateCallback(OperationalState::Ge
}
}

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,6 @@ class RvcOperationalStateDelegate : public RvcOperationalState::Delegate
*/
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,32 @@ namespace RvcOperationalState {
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
Expand Down
Loading