blob: 396010f62a5e8bedb76d77e2e7ba5bbf86cd00f8 [file] [log] [blame] [edit]
#pragma once
#include <string>
#include "bios_settings.grpc.pb.h"
#include "grpcpp/server_context.h"
#include "grpcpp/support/status.h"
namespace blobs {
class BiosSettingsServiceImpl final
: public phosphor::bios::grpc_gen::BiosSettingsService::Service {
public:
explicit BiosSettingsServiceImpl(int instanceNumber,
const std::string& basePath)
: phosphor::bios::grpc_gen::BiosSettingsService::Service(),
instance(instanceNumber),
basePath_(basePath),
biosSettingsConfigFile(basePath + "/var/google/bios-settings.txtpb"),
configuredFilepath(basePath +
"/var/google/bios/configured-settings.txt"),
reportedFilepath(basePath + "/var/google/bios/reported-settings.txt") {}
grpc::Status GetBiosSettings(
[[maybe_unused]] grpc::ServerContext* context,
[[maybe_unused]] const google::protobuf::Empty* request,
phosphor::bios::BiosSettings* reply);
grpc::Status SetBiosSettings(
[[maybe_unused]] grpc::ServerContext* context,
const phosphor::bios::BiosSettings* request,
[[maybe_unused]] google::protobuf::Empty* reply);
grpc::Status GetSettings(
[[maybe_unused]] grpc::ServerContext* context,
[[maybe_unused]] const google::protobuf::Empty* request,
phosphor::bios::OpaqueSettings* reply);
grpc::Status ReportSettings([[maybe_unused]] grpc::ServerContext* context,
const phosphor::bios::OpaqueSettings* request,
[[maybe_unused]] google::protobuf::Empty* reply);
private:
int instance;
std::string basePath_;
// persistent path
std::string biosSettingsConfigFile;
std::string configuredFilepath;
std::string reportedFilepath;
};
} // namespace blobs