blob: dc16db082b77717f81a2680150f2b02cffcbdbf4 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.developer.bridge;
enum FastbootError {
PROTOCOL_ERROR = 1;
COMMUNICATION_ERROR = 2;
REDISCOVERED_ERROR = 3;
[Deprecated]
TARGET_ERROR = 4;
[Deprecated]
NON_FASTBOOT_DEVICE = 5;
REBOOT_FAILED = 6;
};
/// Callback event listener for upload progress.
protocol UploadProgressListener {
OnError(string:MAX error);
OnStarted(uint64 size);
OnProgress(uint64 bytes_written);
OnFinished();
};
/// Callback event listener for when the device reboots to the
/// bootloader.
protocol RebootListener {
OnReboot();
};
[Discoverable]
protocol Fastboot {
Prepare(RebootListener listener) -> () error FastbootError;
GetVar(string:64 name) -> (string:64 value) error FastbootError;
Flash(string:64 partition_name, string:256 path, UploadProgressListener listener) -> () error FastbootError;
Erase(string:64 partition_name) -> () error FastbootError;
Reboot() -> () error FastbootError;
RebootBootloader(RebootListener listener) -> () error FastbootError;
ContinueBoot() -> () error FastbootError;
Stage(string:256 path, UploadProgressListener listener) -> () error FastbootError;
SetActive(string:64 slot) -> () error FastbootError;
Oem(string:64 command) -> () error FastbootError;
};