// Copyright 2022 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto3";

package chromiumos.test.api;

option go_package = "go.chromium.org/chromiumos/config/go/test/api";

import "chromiumos/build/api/firmware_config.proto";

// FirmwareProvisionStartupMetadata can be passed to
// ProvisionStartupRequest.metadata
message FirmwareProvisionStartupMetadata {
  reserved 1;
  reserved "cache_server_address";
}

// FirmwareProvisionInstallMetadata can be passed to InstallRequest.metadata
message FirmwareProvisionInstallMetadata {
  // Detailed Request allows you to specify individual versions of
  // AP_RW, AP_RO, EC_RO, and PD_RO.
  // Service will extract the images from firmware archive and install
  // them individually over futility.
  // ec_ro over Servo is flashed using flash_ec.
  chromiumos.build.api.FirmwareConfig firmware_config = 1;

  enum OperatingSystem {
    UNKNOWN = 0;
    CHROMEOS = 1;
    ANDROID = 2;
  }

  // The expected operating system of the device.
  OperatingSystem os = 2;
}

// FirmwareProvisionResponse records the response of the firmware provisioning.
message FirmwareProvisionResponse {
  // If the provisioning failed, here is the detailed error message.
  // Deprecated: Use InstallResponse.message instead.
  string error_message = 1 [deprecated = true];
  // The firmware versions on the DUT (if success), or the versions that were
  // attempted to be flashed (if failed).
  string ap_ro_version = 2;
  string ap_rw_version = 3;
  string ec_ro_version = 4;
  string ec_rw_version = 5;
}
