1e41f4b71Sopenharmony_ci# Telephony Radio
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## Overview
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciProvides C APIs for the radio module.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci**Since**: 13
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci## Summary
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci### File
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci| Name| Description|
17e41f4b71Sopenharmony_ci| -------- | -------- |
18e41f4b71Sopenharmony_ci| [telephony_radio.h](telephony__radio_8h.md) | Defines C APIs for the SSL/TLS certificate chain verification module.|
19e41f4b71Sopenharmony_ci| [telephony_radio_type.h](telephony__radio__type_8h.md) | Defines data structures for the C APIs of the SSL/TLS certificate chain verification module.|
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci### Structs
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci| Name| Description|
25e41f4b71Sopenharmony_ci| -------- | -------- |
26e41f4b71Sopenharmony_ci| [Telephony_NetworkState](_telephony__network_state.md) | Network status structure.|
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci### Macros
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci| Name                              | Description|
31e41f4b71Sopenharmony_ci| ---------------------------------- | ---- |
32e41f4b71Sopenharmony_ci| **TELEPHONY_MAX_OPERATOR_LEN**     | 64   |
33e41f4b71Sopenharmony_ci| **TELEPHONY_MAX_PLMN_NUMERIC_LEN** | 6    |
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci### Enums
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci| Name| Description|
38e41f4b71Sopenharmony_ci| -------- | -------- |
39e41f4b71Sopenharmony_ci| [Telephony_RadioResult](#telephony_radioresult) { <br>TEL_RADIO_SUCCESS = 0,<br>TEL_RADIO_PERMISSION_DENIED = 201,<br>TEL_RADIO_ERR_INVALID_PARAM = 401,<br>TEL_RADIO_ERR_MARSHALLING_FAILED = 8300001,<br>TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED = 8300002,<br>TEL_RADIO_ERR_OPERATION_FAILED = 8300003,<br>} | Result codes.|
40e41f4b71Sopenharmony_ci| [Telephony_RegState](#telephony_regstate) {<br>TEL_REG_STATE_NO_SERVICE = 0,<br>TEL_REG_STATE_IN_SERVICE = 1,<br>TEL_REG_STATE_EMERGENCY_CALL_ONLY = 2,<br>TEL_REG_STATE_POWER_OFF = 3,<br>} | Network registration status of the device. |
41e41f4b71Sopenharmony_ci| [Telephony_RadioTechnology](#telephony_radiotechnology) {<br>TEL_RADIO_TECHNOLOGY_UNKNOWN = 0,<br>TEL_RADIO_TECHNOLOGY_GSM = 1,<br>TEL_RADIO_TECHNOLOGY_1XRTT = 2,<br>TEL_RADIO_TECHNOLOGY_WCDMA = 3,<br>TEL_RADIO_TECHNOLOGY_HSPA = 4,<br>TEL_RADIO_TECHNOLOGY_HSPAP = 5,<br>TEL_RADIO_TECHNOLOGY_TD_SCDMA = 6,<br>TEL_RADIO_TECHNOLOGY_EVDO = 7,<br>TEL_RADIO_TECHNOLOGY_EHRPD = 8,<br>TEL_RADIO_TECHNOLOGY_LTE = 9,<br>TEL_RADIO_TECHNOLOGY_LTE_CA = 10,<br>TEL_RADIO_TECHNOLOGY_IWLAN = 11,<br>TEL_RADIO_TECHNOLOGY_NR = 12,<br>} | Radio access technology (RAT) type of the device.  |
42e41f4b71Sopenharmony_ci| [Telephony_NsaState](#telephony_nsastate) {<br>TEL_NSA_STATE_NOT_SUPPORTED = 1,<br>TEL_NSA_STATE_NO_DETECTED = 2,<br>TEL_NSA_STATE_CONNECTED_DETECTED = 3,<br>TEL_NSA_STATE_IDLE_DETECTED = 4,<br>TEL_NSA_STATE_DUAL_CONNECTED = 5,<br>TEL_NSA_STATE_SA_ATTACHED = 6,<br>} | NSA network registration status of the device.|
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci### Functions
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci| Name| Description|
47e41f4b71Sopenharmony_ci| -------- | -------- |
48e41f4b71Sopenharmony_ci| [OH_Telephony_GetNetworkState](#oh_telephony_getnetworkstate) | Obtains the network status.            |
49e41f4b71Sopenharmony_ci| [OH_Telephony_GetNetworkStateForSlot](#oh_telephony_getnetworkstateforslot) | Obtains the network status of the SIM card in the specified slot.|
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci## Enum Description
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci### Telephony_RadioResult
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ci```
57e41f4b71Sopenharmony_cienum Telephony_RadioResult
58e41f4b71Sopenharmony_ci```
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci**Description**
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ciResult codes.
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci**Since**: 13
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci| Value| Description|
67e41f4b71Sopenharmony_ci| -------- | -------- |
68e41f4b71Sopenharmony_ci| TEL_RADIO_SUCCESS | Success.|
69e41f4b71Sopenharmony_ci| TEL_RADIO_PERMISSION_DENIED | Invalid permission.|
70e41f4b71Sopenharmony_ci| TEL_RADIO_ERR_INVALID_PARAM | Invalid parameter.|
71e41f4b71Sopenharmony_ci| TEL_RADIO_ERR_MARSHALLING_FAILED | Marshalling failure.|
72e41f4b71Sopenharmony_ci| TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED | Telephony service connection failure.|
73e41f4b71Sopenharmony_ci| TEL_RADIO_ERR_OPERATION_FAILED | Telephony service operation failure.|
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci### Telephony_RegState
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci```
79e41f4b71Sopenharmony_cienum Telephony_RegState
80e41f4b71Sopenharmony_ci```
81e41f4b71Sopenharmony_ci**Description**
82e41f4b71Sopenharmony_ci Network registration status of the device.
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci**Since**: 13
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ci| Value| Description|
87e41f4b71Sopenharmony_ci| -------- | -------- |
88e41f4b71Sopenharmony_ci| TEL_REG_STATE_NO_SERVICE | The device cannot use any services, including data, SMS, and call services.|
89e41f4b71Sopenharmony_ci| TEL_REG_STATE_IN_SERVICE | The device can use services properly, including data, SMS, and call services.|
90e41f4b71Sopenharmony_ci| TEL_REG_STATE_EMERGENCY_CALL_ONLY | The device can use only the emergency call service.|
91e41f4b71Sopenharmony_ci| TEL_REG_STATE_POWER_OFF | The device cannot communicate with the network because the cellular radio service is disabled or the modem is powered off.|
92e41f4b71Sopenharmony_ci
93e41f4b71Sopenharmony_ci### Telephony_RadioTechnology
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci```
96e41f4b71Sopenharmony_cienum Telephony_RadioTechnology
97e41f4b71Sopenharmony_ci```
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci**Description**
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_ci  RAT type of the device.
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci**Since**: 13
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ci| Value                       | Description                                                        |
106e41f4b71Sopenharmony_ci| ----------------------------- | ------------------------------------------------------------ |
107e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_UNKNOWN  | Unknown RAT                                   |
108e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_GSM      | Global System for Mobile Communication (GSM) |
109e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_1XRTT    | Single-Carrier Radio Transmission Technology (1XRTT)|
110e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_WCDMA    | Wideband Code Division Multiple Access (WCDMA)|
111e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_HSPA     | High Speed Packet Access (HSPA)              |
112e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_HSPAP    | Evolved High Speed Packet Access (HSPA+)    |
113e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_TD_SCDMA | Time Division Synchronous Code Division Multiple Access (TD-SCDMA)|
114e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_EVDO     | Evolution-Data Optimized (EVDO)                   |
115e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_EHRPD    | Evolved High Rate Package Data (EHRPD)       |
116e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_LTE      | Long Term Evolution (LTE)                    |
117e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_LTE_CA   | Long Term Evolution_Carrier Aggregation (LTE_CA)|
118e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_IWLAN    | Industrial Wireless LAN (IWLAN)              |
119e41f4b71Sopenharmony_ci| TEL_RADIO_TECHNOLOGY_NR       | New Radio (NR)                               |
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci### Telephony_NsaState
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ci```
124e41f4b71Sopenharmony_cienum Telephony_NsaState
125e41f4b71Sopenharmony_ci```
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci**Description**
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ciNSA network registration status of the device.
130e41f4b71Sopenharmony_ci
131e41f4b71Sopenharmony_ci**Since**: 13
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ci| Value                          | Description                                                      |
134e41f4b71Sopenharmony_ci| -------------------------------- | ---------------------------------------------------------- |
135e41f4b71Sopenharmony_ci| TEL_NSA_STATE_NOT_SUPPORTED      | The device is in idle or connected state in an LTE cell that does not support NSA.        |
136e41f4b71Sopenharmony_ci| TEL_NSA_STATE_NO_DETECTED        | The device is in the idle state in an LTE cell that supports NSA but not NR coverage detection.|
137e41f4b71Sopenharmony_ci| TEL_NSA_STATE_CONNECTED_DETECTED | The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection.         |
138e41f4b71Sopenharmony_ci| TEL_NSA_STATE_IDLE_DETECTED      | The device is in the idle state in an LTE cell that supports NSA and NR coverage detection.          |
139e41f4b71Sopenharmony_ci| TEL_NSA_STATE_DUAL_CONNECTED     | The device is connected to the LTE/NR network in an LTE cell that supports NSA.              |
140e41f4b71Sopenharmony_ci| TEL_NSA_STATE_SA_ATTACHED        | The device is idle or connected to the NG-RAN cell when being attached to the 5G Core.     |
141e41f4b71Sopenharmony_ci
142e41f4b71Sopenharmony_ci## Function Description
143e41f4b71Sopenharmony_ci
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ci### OH_Telephony_GetNetworkState()
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci```
148e41f4b71Sopenharmony_ciTelephony_RadioResult OH_Telephony_GetNetworkState(Telephony_NetworkState * state)
149e41f4b71Sopenharmony_ci```
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ci**Description**
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ciObtains the network status.
154e41f4b71Sopenharmony_ci
155e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_ci**Since**: 13
158e41f4b71Sopenharmony_ci
159e41f4b71Sopenharmony_ci**Parameters**
160e41f4b71Sopenharmony_ci
161e41f4b71Sopenharmony_ci| Name| Description|
162e41f4b71Sopenharmony_ci| -------- | -------- |
163e41f4b71Sopenharmony_ci| state | Structure of the network status information received by the user.|
164e41f4b71Sopenharmony_ci
165e41f4b71Sopenharmony_ci**Returns**
166e41f4b71Sopenharmony_ci
167e41f4b71Sopenharmony_ci**0**: success.
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ci**201**: invalid permission.
170e41f4b71Sopenharmony_ci
171e41f4b71Sopenharmony_ci**401**: invalid parameter.
172e41f4b71Sopenharmony_ci
173e41f4b71Sopenharmony_ci**8300001**: marshalling failure.
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ci**8300002**: telephony service connection failure.
176e41f4b71Sopenharmony_ci
177e41f4b71Sopenharmony_ci**8300003**: telephony service operation failure.
178e41f4b71Sopenharmony_ci
179e41f4b71Sopenharmony_ci**Required Permissions**
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ciohos.permission.GET_NETWORK_INFO
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci### OH_Telephony_GetNetworkStateForSlot()
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ci```
186e41f4b71Sopenharmony_ciTelephony_RadioResult OH_Telephony_GetNetworkStateForSlot(int32_t slotId, Telephony_NetworkState *state)
187e41f4b71Sopenharmony_ci```
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ci**Description**
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ciObtains the network status of the SIM card in the specified slot.
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci**Since**: 13
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ci**Parameters**
198e41f4b71Sopenharmony_ci
199e41f4b71Sopenharmony_ci| Name  | Description                          |
200e41f4b71Sopenharmony_ci| ------ | ------------------------------ |
201e41f4b71Sopenharmony_ci| slotId | Card slot ID.                        |
202e41f4b71Sopenharmony_ci| state  | Structure of the network status information received by the user.|
203e41f4b71Sopenharmony_ci
204e41f4b71Sopenharmony_ci**Returns**
205e41f4b71Sopenharmony_ci
206e41f4b71Sopenharmony_ci**0**: success.
207e41f4b71Sopenharmony_ci
208e41f4b71Sopenharmony_ci**201**: invalid permission.
209e41f4b71Sopenharmony_ci
210e41f4b71Sopenharmony_ci**401**: invalid parameter.
211e41f4b71Sopenharmony_ci
212e41f4b71Sopenharmony_ci8300001: marshalling failure.
213e41f4b71Sopenharmony_ci
214e41f4b71Sopenharmony_ci**8300002**: telephony service connection failure.
215e41f4b71Sopenharmony_ci
216e41f4b71Sopenharmony_ci**8300003**: telephony service operation failure.
217e41f4b71Sopenharmony_ci
218e41f4b71Sopenharmony_ci**Required Permissions**
219e41f4b71Sopenharmony_ci
220e41f4b71Sopenharmony_ciohos.permission.GET_NETWORK_INFO
221