1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup Telephony 18 * @{ 19 * 20 * @brief Provides C interface for the telephony radio. 21 * 22 * @since 13 23 */ 24 25 /** 26 * @file telephony_radio.h 27 * 28 * @brief Provides C interface for the telephony radio. 29 * 30 * @kit TelephonyKit 31 * @syscap SystemCapability.Telephony.CoreService 32 * @library libtelephony_radio.so 33 * @since 13 34 */ 35 36 #ifndef NATIVE_TELEPHONY_RADIO_API_H 37 #define NATIVE_TELEPHONY_RADIO_API_H 38 39 #include "telephony_radio_type.h" 40 #include "stdint.h" 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 /** 46 * @brief Obtains the radio network state. 47 * 48 * @param state Pointer to the network state. 49 * @return the result defines in {@link Telephony_RadioResult}. 50 * {@link TEL_RADIO_SUCCESS} Success. 51 * {@link TEL_RADIO_PERMISSION_DENIED} Permission denied. 52 * {@link TEL_RADIO_ERR_MARSHALLING_FAILED} Low probability Marshalling failed, try again later. 53 * {@link TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED} Unable to connect to telephony service, try again later. 54 * {@link TEL_RADIO_ERR_OPERATION_FAILED} Operation failed in telephony service, try again later. 55 * {@link TEL_RADIO_ERR_INVALID_PARAM} Invalid parameter. 56 * @permission ohos.permission.GET_NETWORK_INFO 57 * @syscap SystemCapability.Telephony.CoreService 58 * @since 13 59 */ 60 Telephony_RadioResult OH_Telephony_GetNetworkState(Telephony_NetworkState *state); 61 62 /** 63 * @brief Obtains the radio network state for given slot id. 64 * 65 * @param slotId the number of slot, 0 for card slot 1, 1 for card slot 2. 66 * @param state Pointer to the network state. 67 * @return the result defines in {@link Telephony_RadioResult}. 68 * {@link TEL_RADIO_SUCCESS} Success. 69 * {@link TEL_RADIO_PERMISSION_DENIED} Permission denied. 70 * {@link TEL_RADIO_ERR_MARSHALLING_FAILED} Low probability Marshalling failed, try again later. 71 * {@link TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED} Unable to connect to telephony service, try again later. 72 * {@link TEL_RADIO_ERR_OPERATION_FAILED} Operation failed in telephony service, try again later. 73 * {@link TEL_RADIO_ERR_INVALID_PARAM} Invalid parameter. 74 * @permission ohos.permission.GET_NETWORK_INFO 75 * @syscap SystemCapability.Telephony.CoreService 76 * @since 13 77 */ 78 Telephony_RadioResult OH_Telephony_GetNetworkStateForSlot(int32_t slotId, Telephony_NetworkState *state); 79 #ifdef __cplusplus 80 } 81 #endif 82 83 #endif // NATIVE_TELEPHONY_RADIO_API_H 84 /** @} */ 85