blob: 07bd948a3e9b01b0c787003d24e8c19fb1942300 [file] [log] [blame]
// Copyright 2018 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.telephony.ril;
using zx;
/// Power State of the radio
type RadioPowerState = strict enum : uint8 {
OFF = 0x00;
ON = 0x01;
};
/// Errors that the Radio Interface Layer presents to modem
/// management interfaces
type RilError = strict enum : uint32 {
/// The radio on this interface is unavailable.
NO_RADIO = 0x01;
/// The request required a SIM card and none are unavailable.
NO_SIM = 0x02;
/// The baseband reported information for a type of cellular network
/// that is currently unsupported.
UNSUPPORTED_NETWORK_TYPE = 0x03;
/// An unknown error.
UNKNOWN_ERROR = 0x04;
/// An unknown transport error.
TRANSPORT_ERROR = 0x05;
};
protocol NetworkConnection {
Stop() -> (struct {
success bool;
});
};
// currently only ipv4 stuff, to drastically change
type NetworkSettings = struct {
ip_v4_addr uint32;
ip_v4_subnet uint32;
ip_v4_gateway uint32;
ip_v4_dns uint32;
mtu uint32;
};
/// The Standard Fuchsia RIL (FRIL)
@discoverable
protocol Setup {
/// Hand a transport `channel` to the RIL service connecting it to the modem. Most
/// modems will require this to be the first method called, since they are dependent
/// on this. If a connection is already active, it will return false. If the channel
/// is set successfully, it will return true.
///
/// Called globaly per-modem, not per client connection.
///
/// Implementation Detail: current services speak QMI but others will most likely speak other
/// binary formats.
ConnectTransport(resource struct {
channel zx.handle:CHANNEL;
}) -> () error RilError;
};
/// The Standard Fuchsia RIL (FRIL)
@discoverable
protocol RadioInterfaceLayer {
/// Retrieve the identity of the modem (currently `imei` only).
GetDeviceIdentity() -> (struct {
imei string;
}) error RilError;
/// Power state of the radio. Currently on On or Off.
RadioPowerStatus() -> (struct {
state RadioPowerState;
}) error RilError;
/// Activate a network connection.
StartNetwork(struct {
apn string;
}) -> (resource struct {
conn client_end:NetworkConnection;
}) error RilError;
/// Network settings known to the modem.
GetNetworkSettings() -> (struct {
settings NetworkSettings;
}) error RilError;
/// Signal Strength (dBm) for LTE networks (total received wideband power).
GetSignalStrength() -> (struct {
dbm float32;
}) error RilError;
/// Raw string to send to modem for development.
RawCommand(struct {
command string;
}) -> (struct {
result string;
}) error RilError;
};