blob: 518c761cef67f415c12092c921a4f25eda982127 [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;
TARGET_ERROR = 4;
NON_FASTBOOT_DEVICE = 5;
};
/// 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 {
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;
};