openharmony 鸿蒙 ndk-apis-telephony-radio

2025-06-12 浏览 (1)

Telephony Radio

Overview

Provides C APIs for the radio module.

Since: 13

Summary

File

NameDescription
telephony_radio.hDefines C APIs for the SSL/TLS certificate chain verification module.
File to include: <telephony/core_service/telephony_radio.h>
telephony_radio_type.hDefines data structures for the C APIs of the SSL/TLS certificate chain verification module.
File to include: <telephony/core_service/telephony_radio_type.h>

Structs

NameDescription
Telephony_NetworkStateNetwork status structure.

Macros

NameDescription
TELEPHONY_MAX_OPERATOR_LEN64
TELEPHONY_MAX_PLMN_NUMERIC_LEN6

Enums

NameDescription
Telephony_RadioResult {
TEL_RADIO_SUCCESS = 0,
TEL_RADIO_PERMISSION_DENIED = 201,
TEL_RADIO_ERR_INVALID_PARAM = 401,
TEL_RADIO_ERR_MARSHALLING_FAILED = 8300001,
TEL_RADIO_ERR_SERVICE_CONNECTION_FAILED = 8300002,
TEL_RADIO_ERR_OPERATION_FAILED = 8300003,
}
Result codes.
Telephony_RegState {
TEL_REG_STATE_NO_SERVICE = 0,
TEL_REG_STATE_IN_SERVICE = 1,
TEL_REG_STATE_EMERGENCY_CALL_ONLY = 2,
TEL_REG_STATE_POWER_OFF = 3,
}
Network registration status of the device.
Telephony_RadioTechnology {
TEL_RADIO_TECHNOLOGY_UNKNOWN = 0,
TEL_RADIO_TECHNOLOGY_GSM = 1,
TEL_RADIO_TECHNOLOGY_1XRTT = 2,
TEL_RADIO_TECHNOLOGY_WCDMA = 3,
TEL_RADIO_TECHNOLOGY_HSPA = 4,
TEL_RADIO_TECHNOLOGY_HSPAP = 5,
TEL_RADIO_TECHNOLOGY_TD_SCDMA = 6,
TEL_RADIO_TECHNOLOGY_EVDO = 7,
TEL_RADIO_TECHNOLOGY_EHRPD = 8,
TEL_RADIO_TECHNOLOGY_LTE = 9,
TEL_RADIO_TECHNOLOGY_LTE_CA = 10,
TEL_RADIO_TECHNOLOGY_IWLAN = 11,
TEL_RADIO_TECHNOLOGY_NR = 12,
}
Radio access technology (RAT) type of the device.
Telephony_NsaState {
TEL_NSA_STATE_NOT_SUPPORTED = 1,
TEL_NSA_STATE_NO_DETECTED = 2,
TEL_NSA_STATE_CONNECTED_DETECTED = 3,
TEL_NSA_STATE_IDLE_DETECTED = 4,
TEL_NSA_STATE_DUAL_CONNECTED = 5,
TEL_NSA_STATE_SA_ATTACHED = 6,
}
NSA network registration status of the device.

Functions

NameDescription
OH_Telephony_GetNetworkStateObtains the network status.
OH_Telephony_GetNetworkStateForSlotObtains the network status of the SIM card in the specified slot.

Enum Description

Telephony_RadioResult

enum Telephony_RadioResult

Description

Result codes.

Since: 13

ValueDescription
TEL_RADIO_SUCCESSSuccess.
TEL_RADIO_PERMISSION_DENIEDInvalid permission.
TEL_RADIO_ERR_INVALID_PARAMInvalid parameter.
TEL_RADIO_ERR_MARSHALLING_FAILEDMarshalling failure.
TEL_RADIO_ERR_SERVICE_CONNECTION_FAILEDTelephony service connection failure.
TEL_RADIO_ERR_OPERATION_FAILEDTelephony service operation failure.

Telephony_RegState

enum Telephony_RegState

Description Network registration status of the device.

Since: 13

ValueDescription
TEL_REG_STATE_NO_SERVICEThe device cannot use any services, including data, SMS, and call services.
TEL_REG_STATE_IN_SERVICEThe device can use services properly, including data, SMS, and call services.
TEL_REG_STATE_EMERGENCY_CALL_ONLYThe device can use only the emergency call service.
TEL_REG_STATE_POWER_OFFThe device cannot communicate with the network because the cellular radio service is disabled or the modem is powered off.

Telephony_RadioTechnology

enum Telephony_RadioTechnology

Description

RAT type of the device.

Since: 13

ValueDescription
TEL_RADIO_TECHNOLOGY_UNKNOWNUnknown RAT
TEL_RADIO_TECHNOLOGY_GSMGlobal System for Mobile Communication (GSM)
TEL_RADIO_TECHNOLOGY_1XRTTSingle-Carrier Radio Transmission Technology (1XRTT)
TEL_RADIO_TECHNOLOGY_WCDMAWideband Code Division Multiple Access (WCDMA)
TEL_RADIO_TECHNOLOGY_HSPAHigh Speed Packet Access (HSPA)
TEL_RADIO_TECHNOLOGY_HSPAPEvolved High Speed Packet Access (HSPA+)
TEL_RADIO_TECHNOLOGY_TD_SCDMATime Division Synchronous Code Division Multiple Access (TD-SCDMA)
TEL_RADIO_TECHNOLOGY_EVDOEvolution-Data Optimized (EVDO)
TEL_RADIO_TECHNOLOGY_EHRPDEvolved High Rate Package Data (EHRPD)
TEL_RADIO_TECHNOLOGY_LTELong Term Evolution (LTE)
TEL_RADIO_TECHNOLOGY_LTE_CALong Term Evolution_Carrier Aggregation (LTE_CA)
TEL_RADIO_TECHNOLOGY_IWLANIndustrial Wireless LAN (IWLAN)
TEL_RADIO_TECHNOLOGY_NRNew Radio (NR)

Telephony_NsaState

enum Telephony_NsaState

Description

NSA network registration status of the device.

Since: 13

ValueDescription
TEL_NSA_STATE_NOT_SUPPORTEDThe device is in idle or connected state in an LTE cell that does not support NSA.
TEL_NSA_STATE_NO_DETECTEDThe device is in the idle state in an LTE cell that supports NSA but not NR coverage detection.
TEL_NSA_STATE_CONNECTED_DETECTEDThe device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection.
TEL_NSA_STATE_IDLE_DETECTEDThe device is in the idle state in an LTE cell that supports NSA and NR coverage detection.
TEL_NSA_STATE_DUAL_CONNECTEDThe device is connected to the LTE/NR network in an LTE cell that supports NSA.
TEL_NSA_STATE_SA_ATTACHEDThe device is idle or connected to the NG-RAN cell when being attached to the 5G Core.

Function Description

OH_Telephony_GetNetworkState()

Telephony_RadioResult OH_Telephony_GetNetworkState(Telephony_NetworkState * state)

Description

Obtains the network status.

System capability: SystemCapability.Telephony.CoreService

Since: 13

Parameters

NameDescription
stateStructure of the network status information received by the user.

Returns

0: success.

201: invalid permission.

401: invalid parameter.

8300001: marshalling failure.

8300002: telephony service connection failure.

8300003: telephony service operation failure.

Required Permissions

ohos.permission.GET_NETWORK_INFO

OH_Telephony_GetNetworkStateForSlot()

Telephony_RadioResult OH_Telephony_GetNetworkStateForSlot(int32_t slotId, Telephony_NetworkState *state)

Description

Obtains the network status of the SIM card in the specified slot.

System capability: SystemCapability.Telephony.CoreService

Since: 13

Parameters

NameDescription
slotIdCard slot ID.
stateStructure of the network status information received by the user.

Returns

0: success.

201: invalid permission.

401: invalid parameter.

8300001: marshalling failure.

8300002: telephony service connection failure.

8300003: telephony service operation failure.

Required Permissions

ohos.permission.GET_NETWORK_INFO

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Telephony Kit

harmony 鸿蒙Telephony_NetworkState

harmony 鸿蒙Telephony Error Codes

harmony 鸿蒙js-apis-call-sys

harmony 鸿蒙@ohos.telephony.call (Call)

harmony 鸿蒙@ohos.telephony.esim (eSIM Management) (System API)

harmony 鸿蒙@ohos.telephony.esim (eSIM Management)

harmony 鸿蒙@ohos.telephony.observer (Observer) (System API)

harmony 鸿蒙@ohos.telephony.observer (Observer)

harmony 鸿蒙@ohos.telephony.radio (Radio) (System API)

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/YIKW5p