blob: b625299056af218f29e3aa43d25b1591dba9f139 [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;
};
closed protocol NetworkConnection {
strict 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
closed 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.
strict ConnectTransport(resource struct {
channel zx.Handle:CHANNEL;
}) -> () error RilError;
};
/// The Standard Fuchsia RIL (FRIL)
@discoverable
closed protocol RadioInterfaceLayer {
/// Retrieve the identity of the modem (currently `imei` only).
strict GetDeviceIdentity() -> (struct {
imei string:MAX;
}) error RilError;
/// Power state of the radio. Currently on On or Off.
strict RadioPowerStatus() -> (struct {
state RadioPowerState;
}) error RilError;
/// Activate a network connection.
strict StartNetwork(struct {
apn string:MAX;
}) -> (resource struct {
conn client_end:NetworkConnection;
}) error RilError;
/// Network settings known to the modem.
strict GetNetworkSettings() -> (struct {
settings NetworkSettings;
}) error RilError;
/// Signal Strength (dBm) for LTE networks (total received wideband power).
strict GetSignalStrength() -> (struct {
dbm float32;
}) error RilError;
/// Raw string to send to modem for development.
strict RawCommand(struct {
command string:MAX;
}) -> (struct {
result string:MAX;
}) error RilError;
};