blob: 7856e86f6d5dfb2bd313a28c03f4544155b3a45b [file] [log] [blame]
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "google3/host_commands.h"
#include "payload_update_common.hpp"
#include <optional>
#include <span>
#include <string>
#include <vector>
namespace google::hoth::tools
{
class DBusInterface
{
public:
virtual ~DBusInterface() = default;
virtual std::optional<std::string>
getPayloadVersion(const std::string& hothId,
payload_update::VersionType type) = 0;
virtual bool sendPayloadAndVerify(const std::string& hothId,
const std::string& payloadFile) = 0;
virtual bool
sendStaticWPPayloadAndVerify(const std::string& hothId,
const std::string& payloadFile) = 0;
virtual bool activatePayload(const std::string& hothId) = 0;
virtual bool deactivatePayload(const std::string& hothId) = 0;
virtual bool confirmPayload(const std::string& hothId) = 0;
virtual bool eraseStagingArea(const std::string& hothId) = 0;
virtual bool setTargetResetOption(const std::string& hothId,
ec_target_reset_option option) = 0;
virtual bool setSpsPassthrough(const std::string& hothId,
bool enable) = 0;
virtual std::optional<bool>
getSpsPassthrough(const std::string& hothId) = 0;
virtual bool expectConfirmPayload() = 0;
};
} // namespace google::hoth::tools