blob: 13990486628cd53b593deb9e54c3b5ab7d30b8c7 [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;
using fuchsia.device;
using fuchsia.net;
using fuchsia.buildinfo;
struct TargetIp {
fuchsia.net.IpAddress ip;
uint32 scope_id;
};
struct TargetIpPort {
fuchsia.net.IpAddress ip;
uint32 scope_id;
uint16 port;
};
// TODO(awdavies): Add serial number.
union TargetAddrInfo {
1: TargetIp ip;
2: TargetIpPort ip_port;
};
// TODO(awdavies): Add more target states once they're more well defined.
enum TargetState {
UNKNOWN = 1;
DISCONNECTED = 2;
PRODUCT = 3;
FASTBOOT = 4;
};
// TODO(awdavies): Add more target types. Hardware? Product state?
enum TargetType {
UNKNOWN = 1;
};
/// Current known state of the remote control
enum RemoteControlState {
UP = 1;
DOWN = 2;
UNKNOWN = 3;
};
table Target {
1: string:fuchsia.device.DEVICE_NAME_MAX nodename;
2: vector<TargetAddrInfo>:256 addresses;
3: uint64 age_ms;
4: RemoteControlState rcs_state;
5: TargetType target_type;
6: TargetState target_state;
// Contains the string used for the product in `fx set`, for example
// `fx set core.x64` would make this value "core".
7: string:fuchsia.buildinfo.MAX_STRING_LENGTH product_config;
// Contains the string used for the board in `fx set`, for example
// `fx set core.x64` would make this value "x64".
8: string:fuchsia.buildinfo.MAX_STRING_LENGTH board_config;
9: string:256 serial_number;
/// ssh_address is the preferred address to use to connect to the
/// device over SSH, and will include a port number if a custom SSH
/// port number has been set.
10: TargetAddrInfo ssh_address;
};
enum TargetRebootError {
UNKNOWN = 1;
/// Cannot reboot from fastboot to recovery.
FASTBOOT_TO_RECOVERY = 2;
/// There was an Overnet communication issue with the target.
TARGET_COMMUNICATION = 3;
/// There was a Fastboot protocol communication issue with the
/// target.
FASTBOOT_COMMUNICATION = 4;
};
enum TargetRebootState {
PRODUCT = 1;
BOOTLOADER = 2;
RECOVERY = 3;
};
[Discoverable]
protocol TargetControl {
Reboot(TargetRebootState state) -> () error TargetRebootError;
};