• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef NATIVE_TELEPHONY_RADIO_API_H
17 #define NATIVE_TELEPHONY_RADIO_API_H
18 
19 /**
20  * @file telephony_radio.h
21  *
22  * @brief Provides C interface for the telephony radio.
23  *
24  * @kit TelephonyKit
25  * @syscap SystemCapability.Telephony.CoreService
26  * @library libtelephony_radio.so
27  * @since 13
28  */
29 
30 #include "telephony_radio_type.h"
31 #include "stdint.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 /**
37  * @brief Obtains the radio network state.
38  *
39  * @param state Pointer to the network state.
40  * @return the result defines in {@link Telephony_RadioResult}.
41  *         {@link TEL_RADIO_SUCCESS} Success.
42  *         {@link TEL_RADIO_PERMISSION_DENIED} Permission denied.
43  *         {@link TEL_RADIO_ERR_MARSHALLING_FAILED} Low probability Marshalling failed, try again later.
44  *         {@link TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED} Unable to connect to telephony service, try again later.
45  *         {@link TEL_RADIO_ERR_OPERATION_FAILED} Operation failed in telephony service, try again later.
46  *         {@link TEL_RADIO_ERR_INVALID_PARAM} Invalid parameter.
47  * @permission ohos.permission.GET_NETWORK_INFO
48  * @syscap SystemCapability.Telephony.CoreService
49  * @since 13
50  */
51 Telephony_RadioResult OH_Telephony_GetNetworkState(Telephony_NetworkState *state);
52 
53 /**
54  * @brief Obtains the radio network state for given slot id.
55  *
56  * @param slotId the number of slot, 0 for card slot 1, 1 for card slot 2.
57  * @param state Pointer to the network state.
58  * @return the result defines in {@link Telephony_RadioResult}.
59  *         {@link TEL_RADIO_SUCCESS} Success.
60  *         {@link TEL_RADIO_PERMISSION_DENIED} Permission denied.
61  *         {@link TEL_RADIO_ERR_MARSHALLING_FAILED} Low probability Marshalling failed, try again later.
62  *         {@link TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED} Unable to connect to telephony service, try again later.
63  *         {@link TEL_RADIO_ERR_OPERATION_FAILED} Operation failed in telephony service, try again later.
64  *         {@link TEL_RADIO_ERR_INVALID_PARAM} Invalid parameter.
65  * @permission ohos.permission.GET_NETWORK_INFO
66  * @syscap SystemCapability.Telephony.CoreService
67  * @since 13
68  */
69 Telephony_RadioResult OH_Telephony_GetNetworkStateForSlot(int32_t slotId, Telephony_NetworkState *state);
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif // NATIVE_TELEPHONY_RADIO_API_H
75