| // 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 |
| enum RadioPowerState : uint8 { |
| OFF = 0x00; |
| ON = 0x01; |
| }; |
| |
| /// Errors that the Radio Interface Layer presents to modem |
| /// management interfaces |
| enum RilError : 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() -> (bool success); |
| }; |
| |
| // currently only ipv4 stuff, to drastically change |
| struct NetworkSettings { |
| uint32 ip_v4_addr; |
| uint32 ip_v4_subnet; |
| uint32 ip_v4_gateway; |
| uint32 ip_v4_dns; |
| uint32 mtu; |
| }; |
| |
| /// 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(zx.handle:CHANNEL channel) -> () error RilError; |
| }; |
| |
| /// The Standard Fuchsia RIL (FRIL) |
| [Discoverable] |
| protocol RadioInterfaceLayer { |
| /// Retrieve the identity of the modem (currently `imei` only). |
| GetDeviceIdentity() -> (string imei) error RilError; |
| |
| /// Power state of the radio. Currently on On or Off. |
| RadioPowerStatus() -> (RadioPowerState state) error RilError; |
| |
| /// Activate a network connection. |
| StartNetwork(string apn) -> (NetworkConnection conn) error RilError; |
| |
| /// Network settings known to the modem. |
| GetNetworkSettings() -> (NetworkSettings settings) error RilError; |
| |
| /// Signal Strength (dBm) for LTE networks (total received wideband power). |
| GetSignalStrength() -> (float32 dbm) error RilError; |
| |
| /// Raw string to send to modem for development. |
| RawCommand(string command) -> (string result) error RilError; |
| }; |