/* * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {AsyncCallback} from "./basic"; /** * Provides interfaces for applications to obtain the network state, cell information, signal information, * and device ID of the wireless cellular network (WCN), and provides a callback registration mechanism to * listen for changes of the network, cell, and signal status of the WCN. * * @since 6 * @sysCap SystemCapability.Telephony.Telephony */ declare namespace radio { /** * Obtains radio access technology (RAT) of the registered network. The system * returns RAT of the packet service (PS) and circuit service (CS) domain. * *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns an integer indicating the RAT in use. The values are as follows: *

* @permission ohos.permission.GET_NETWORK_INFO */ function getRadioTech(slotId: number, callback: AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void; function getRadioTech(slotId: number): Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>; /** * Obtains the network state of the registered network. * *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns a {@code NetworkState} object. * @permission ohos.permission.GET_NETWORK_INFO */ function getNetworkState(callback: AsyncCallback): void; function getNetworkState(slotId: number, callback: AsyncCallback): void; function getNetworkState(slotId?: number): Promise; /** * Obtains the network search mode of the SIM card in a specified slot. * * @param slotId Indicates the ID of the SIM card slot. * @param callback Returns the network search mode of the SIM card. Available values are as follows: *