blob: 651fc1ef7cdbe5fe5286d20d14ace997ccf42400 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Definitions for tether API calls.
syntax = "proto2";
package chromeos.tether;
option optimize_for = LITE_RUNTIME;
// Types of messages which are sent between tether hosts and tether clients.
enum MessageType {
UNKNOWN_TYPE = 0;
TETHER_AVAILABILITY_REQUEST = 1;
TETHER_AVAILABILITY_RESPONSE = 2;
CONNECT_TETHERING_REQUEST = 3;
CONNECT_TETHERING_RESPONSE = 4;
DISCONNECT_TETHERING_REQUEST = 5;
KEEP_ALIVE_TICKLE = 6;
KEEP_ALIVE_TICKLE_RESPONSE = 7;
}
// Meant to communicate the host's current Wifi status. This is intended to
// allow the client to warn the user that Tether will disconnect the host's
// Wi-Fi, if applicable.
// Next id: 3
message WifiStatus {
enum StatusCode {
STATUS_UNKNOWN = 0;
CONNECTED = 1;
NOT_CONNECTED = 2;
}
optional StatusCode status_code = 1;
// The SSID of the Wifi the host is currently connected to.
optional string ssid = 2;
}
// Contains details about a device (presumably the host).
// Next id: 7
message DeviceStatus {
// Battery, from 0 to 100;
optional int32 battery_percentage = 1;
// For example, "Google Fi" or "Verizon".
optional string cell_provider = 2;
// Number of "bars", from 0 to 4.
optional int32 connection_strength = 3;
optional WifiStatus wifi_status = 4;
// True if Data Saver is on.
optional bool is_data_saver_enabled = 5;
// True if cellular data is enabled and a connection can be established.
optional bool is_cell_data_available = 6;
}
// Next id: 1
message TetherAvailabilityRequest {}
// Next id: 7
message TetherAvailabilityResponse {
enum ResponseCode {
UNKNOWN_ERROR = 0;
TETHER_AVAILABLE = 1;
SETUP_NEEDED = 2;
NO_RECEPTION = 3;
NO_SIM_CARD = 4;
NOTIFICATIONS_DISABLED_LEGACY = 5;
NOTIFICATIONS_DISABLED_WITH_NOTIFICATION_CHANNEL = 6;
}
optional ResponseCode response_code = 1;
optional DeviceStatus device_status = 2;
}
// Next id: 1
message ConnectTetheringRequest {}
// Next id: 8
message ConnectTetheringResponse {
enum ResponseCode {
UNKNOWN_ERROR = 0;
SUCCESS = 1;
PROVISIONING_FAILED = 2;
TETHERING_TIMEOUT = 3;
TETHERING_UNSUPPORTED = 4;
NO_CELL_DATA = 5;
ENABLING_HOTSPOT_FAILED = 6;
ENABLING_HOTSPOT_TIMEOUT = 7;
}
optional ResponseCode response_code = 1;
// SSID for the new hotspot.
optional string ssid = 2;
// Password for the new hotspot.
optional string password = 3;
optional DeviceStatus device_status = 4;
}
// Next id: 1
message KeepAliveTickle {}
// Next id: 2
message KeepAliveTickleResponse {
optional DeviceStatus device_status = 1;
}
// Next id: 1
message DisconnectTetheringRequest {}