b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | /*-----------------------------------------------------------------------------------------------*/ |
| 2 | /** |
| 3 | @file ql_nw.h |
| 4 | @brief network registration API |
| 5 | */ |
| 6 | /*-----------------------------------------------------------------------------------------------*/ |
| 7 | |
| 8 | /*------------------------------------------------------------------------------------------------- |
| 9 | Copyright (c) 2024 mobiletek Wireless Solution, Co., Ltd. All Rights Reserved. |
| 10 | mobiletek Wireless Solution Proprietary and Confidential. |
| 11 | -------------------------------------------------------------------------------------------------*/ |
| 12 | |
| 13 | /*------------------------------------------------------------------------------------------------- |
| 14 | EDIT HISTORY |
| 15 | This section contains comments describing changes made to the file. |
| 16 | Notice that changes are listed in reverse chronological order. |
| 17 | $Header: $ |
| 18 | when who what, where, why |
| 19 | -------- --------- ----------------------------------------------------------------- |
| 20 | 20241022 yq.wang Created . |
| 21 | -------------------------------------------------------------------------------------------------*/ |
| 22 | |
| 23 | |
| 24 | #ifndef __QL_NW_H__ |
| 25 | #define __QL_NW_H__ |
| 26 | |
| 27 | #ifdef __cplusplus |
| 28 | extern "C" { |
| 29 | #endif |
| 30 | |
| 31 | |
| 32 | #define QL_NW_MODE_NONE 0x00 /**< No network. */ |
| 33 | #define QL_NW_MODE_GSM 0x01 /**< Include GSM networks. */ |
| 34 | #define QL_NW_MODE_WCDMA 0x02 /**< Include WCDMA networks. */ |
| 35 | #define QL_NW_MODE_CDMA 0x04 /**< Include CDMA networks. */ |
| 36 | #define QL_NW_MODE_EVDO 0x08 /**< Include EVDO networks. */ |
| 37 | #define QL_NW_MODE_LTE 0x10 /**< Include LTE networks. */ |
| 38 | #define QL_NW_MODE_TDSCDMA 0x20 /**< Include TDSCDMA networks. */ |
| 39 | #define QL_NW_MODE_NR5G 0x40 /**< Include NR5G networks. */ |
| 40 | #define QL_NW_MODE_PRL 0x10000 /**< Give preference according to the preferred roaming list. */ |
| 41 | |
| 42 | #define QL_NW_NR5G_SO_NONE 0X00 /**< No service option */ |
| 43 | #define QL_NW_NR5G_SO_TDD 0X01 /**< Include service option TDD, Time Division Duplex */ |
| 44 | #define QL_NW_NR5G_SO_SUB6 0X02 /**< Include service option SUB6, 5G frequency, SUB_6GHz */ |
| 45 | #define QL_NW_NR5G_SO_MMWAVE 0X04 /**< Include service option MMWARE, 5G frequency, 30~300GHz */ |
| 46 | #define QL_NW_NR5G_SO_NSA 0X08 /**< Include service option NSA, Non_Stand Alone, 5G base station and 4G core network */ |
| 47 | #define QL_NW_NR5G_SO_SA 0X10 /**< Include service option SA, Stan Alone, 5G base station and 5G core network */ |
| 48 | |
| 49 | #define QL_NW_LOWER_POWER_MASK_DISABLE 0x00 |
| 50 | #define QL_NW_LOWER_POWER_MASK_NORMAL 0x01 |
| 51 | #define QL_NW_LOWER_POWER_MASK_NETWORK 0x02 |
| 52 | #define QL_NW_LOWER_POWER_MASK_SIM 0x04 |
| 53 | #define QL_NW_LOWER_POWER_MASK_SMS 0x08 |
| 54 | #define QL_NW_LOWER_POWER_MASK_VOICE 0x10 |
| 55 | |
| 56 | #define QL_NW_NITZ_BUF_LEN 30 |
| 57 | #define QL_NW_SCAN_MAX_LIST_NUM 40 |
| 58 | #define QL_NW_MAX_GSM_CELL_INFO_NUM 20 |
| 59 | #define QL_NW_MAX_UMTS_CELL_INFO_NUM 20 |
| 60 | #define QL_NW_MAX_LTE_CELL_INFO_NUM 20 |
| 61 | |
| 62 | #define QL_NW_MAX_WEA_ALERT_LENGTH_V01 512 |
| 63 | #define QL_NW_MAX_ETWS_ALERT_LENGTH_V01 256 |
| 64 | |
l.yang | e4f94f4 | 2025-04-29 18:08:39 -0700 | [diff] [blame] | 65 | typedef enum |
| 66 | { |
| 67 | QL_SIM_SLOT_INVALID = 0x000, /**< Invalid slot. */ |
| 68 | QL_SIM_SLOT_1 = 0xB01, /**< Identify card in slot 1. */ |
| 69 | QL_SIM_SLOT_2 = 0xB02, /**< Identify card in slot 2. */ |
| 70 | } QL_SIM_SLOT_E; |
| 71 | |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 72 | typedef enum QL_NW_SIGNAL_STRENGTH_LEVEL_ENUM |
| 73 | { |
| 74 | QL_NW_SIGNAL_STRENGTH_LEVEL_MIN = -1, |
| 75 | QL_NW_SIGNAL_STRENGTH_LEVEL_NONE = 0, /**< none or unknown signal strength level */ |
| 76 | QL_NW_SIGNAL_STRENGTH_LEVEL_POOR = 1, /**< poor signal strength level */ |
| 77 | QL_NW_SIGNAL_STRENGTH_LEVEL_MODERATE = 2, /**< moderate signal strength level */ |
| 78 | QL_NW_SIGNAL_STRENGTH_LEVEL_GOOD = 3, /**< good signal strength level */ |
| 79 | QL_NW_SIGNAL_STRENGTH_LEVEL_GREAT = 4, /**< great signal strength level */ |
| 80 | QL_NW_SIGNAL_STRENGTH_LEVEL_MAX |
| 81 | }QL_NW_SIGNAL_STRENGTH_LEVEL_E; |
| 82 | |
| 83 | typedef enum QL_NW_ROAM_STATE_TYPE_ENUM |
| 84 | { |
| 85 | QL_NW_ROAM_STATE_OFF = 0, /**< None, or roaming indicator off. */ |
| 86 | QL_NW_ROAM_STATE_ON = 1 /**< Roaming indicator on. */ |
| 87 | }QL_NW_ROAM_STATE_TYPE_E; |
| 88 | |
| 89 | typedef enum QL_NW_NETWORK_STATUS_TYPE_ENUM |
| 90 | { |
| 91 | QL_NW_NETWORK_STATUS_NONE = 0, /**< Network status not available. */ |
| 92 | QL_NW_NETWORK_STATUS_CURRENT_SERVING = 1, /**< Current serving network. */ |
| 93 | QL_NW_NETWORK_STATUS_PREFERRED = 2, /**< Preferred network. */ |
| 94 | QL_NW_NETWORK_STATUS_NOT_PREFERRED = 3, /**< Not the preferred network. */ |
| 95 | QL_NW_NETWORK_STATUS_AVAILABLE = 4, /**< Service available. */ |
| 96 | QL_NW_NETWORK_STATUS_FORBIDDEN = 5 /**< Forbidden service. */ |
| 97 | }QL_NW_NETWORK_STATUS_TYPE_E; |
| 98 | |
| 99 | typedef enum QL_NW_RADIO_TECH_TYPE_ENUM |
| 100 | { |
| 101 | QL_NW_RADIO_TECH_TD_SCDMA = 1, |
| 102 | QL_NW_RADIO_TECH_GSM = 2, /**< GSM; only supports voice. */ |
| 103 | QL_NW_RADIO_TECH_HSPAP = 3, /**< HSPA+. */ |
| 104 | QL_NW_RADIO_TECH_LTE = 4, /**< LTE. */ |
| 105 | QL_NW_RADIO_TECH_EHRPD = 5, /**< EHRPD. */ |
| 106 | QL_NW_RADIO_TECH_EVDO_B = 6, /**< EVDO B. */ |
| 107 | QL_NW_RADIO_TECH_HSPA = 7, /**< HSPA. */ |
| 108 | QL_NW_RADIO_TECH_HSUPA = 8, /**< HSUPA. */ |
| 109 | QL_NW_RADIO_TECH_HSDPA = 9, /**< HSDPA. */ |
| 110 | QL_NW_RADIO_TECH_EVDO_A = 10, /**< EVDO A. */ |
| 111 | QL_NW_RADIO_TECH_EVDO_0 = 11, /**< EVDO 0. */ |
| 112 | QL_NW_RADIO_TECH_1xRTT = 12, /**< 1xRTT. */ |
| 113 | QL_NW_RADIO_TECH_IS95B = 13, /**< IS95B. */ |
| 114 | QL_NW_RADIO_TECH_IS95A = 14, /**< IS95A. */ |
| 115 | QL_NW_RADIO_TECH_UMTS = 15, /**< UMTS. */ |
| 116 | QL_NW_RADIO_TECH_EDGE = 16, /**< EDGE. */ |
| 117 | QL_NW_RADIO_TECH_GPRS = 17, /**< GPRS. */ |
| 118 | QL_NW_RADIO_TECH_NR5G = 18, /**< NR5G. */ |
| 119 | QL_NW_RADIO_TECH_NONE = 19 /**< No technology selected. */ |
| 120 | }QL_NW_RADIO_TECH_TYPE_E; |
| 121 | |
| 122 | typedef enum QL_NW_TECH_DOMAIN_TYPE_ENUM |
| 123 | { |
| 124 | QL_NW_TECH_DOMAIN_NONE = 0, /**< None. */ |
| 125 | QL_NW_TECH_DOMAIN_3GPP = 1, /**< 3GPP. */ |
| 126 | QL_NW_TECH_DOMAIN_3GPP2 = 2, /**< 3GPP2. */ |
| 127 | }QL_NW_TECH_DOMAIN_TYPE_E; |
| 128 | |
| 129 | typedef enum QL_NW_DENY_REASON_TYPE_ENUM |
| 130 | { |
| 131 | QL_NW_IMSI_UNKNOWN_IN_HSS_DENY_REASON = 2, /**< IMSI unknown in HSS */ |
| 132 | QL_NW_ILLEGAL_UE_DENY_REASON = 3, /**< Illegal UE */ |
| 133 | QL_NW_IMEI_NOT_ACCEPTED_DENY_REASON = 5, /**< IMEI not accepted */ |
| 134 | QL_NW_ILLEGAL_ME_DENY_REASON = 6, /**< Illegal ME */ |
| 135 | QL_NW_EPS_SERVICES_NOT_ALLOWED_DENY_REASON = 7, /**< EPS services not allowed */ |
| 136 | QL_NW_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED_DENY_REASON = 8, /**< EPS services and non-EPS services not allowed */ |
| 137 | QL_NW_UE_ID_CANNOT_BE_DERIVED_BY_THE_NETWORK_DENY_REASON = 9, /**< UE identifity cannot be derived by the network */ |
| 138 | QL_NW_IMPLICITY_DETACHED_DENY_REASON = 10, /**< Implicitly detached */ |
| 139 | QL_NW_PLMN_NOT_ALLOWED_DENY_REASON = 11, /**< PLMN not allowed */ |
| 140 | QL_NW_TRACKING_AREA_NOT_ALLOWED_DENY_REASON = 12, /**< Tracking area not allowed */ |
| 141 | QL_NW_ROAMING_NOT_ALLOWED_IN_THIS_TRACNING_AREA_DENY_REASON = 13, /**< Roaming not allowed in this tracking area */ |
| 142 | QL_NW_EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN_DENY_REASON = 14, /**< EPS services not allowed in this PLMN */ |
| 143 | QL_NW_NO_SUITALBE_CELLS_IN_TRACKING_AREA_DENY_REASON = 15, /**< No suitable cells in tracking area */ |
| 144 | QL_NW_MSC_TEMPORARILY_NOT_REACHABLE_DENY_REASON = 16, /**< MSC temporarily not reachable */ |
| 145 | QL_NW_NETWORK_FAILURE_DENY_REASON = 17, /**< Network failure */ |
| 146 | QL_NW_CS_DOMAIN_NOT_AVAILABLE_DENY_REASON = 18, /**< CS domain not available */ |
| 147 | QL_NW_EMS_FAILURE_DENY_REASON = 19, /**< ESM failure */ |
| 148 | QL_NW_MAC_FAILURE_DENY_REASON = 20, /**< MAC failure */ |
| 149 | QL_NW_SYNC_FAILURE_DENY_REASON = 21, /**< Synch failure */ |
| 150 | QL_NW_CONGESTION_DENY_REASON = 22, /**< Congestion */ |
| 151 | QL_NW_UE_SECURITY_CAPABILITIES_MISMATCH_DENY_REASON = 23, /**< UE security capabilities mismatch */ |
| 152 | QL_NW_SECURITY_MODE_REJECTED_DENY_REASON = 24, /**< Security mode rejected, unspecified */ |
| 153 | QL_NW_NOT_AUTHORIZED_FOR_THIS_CSG_DENY_REASON = 25, /**< Not authorized for this CSG */ |
| 154 | QL_NW_NON_EPS_AUTHENTICATION_UNCACCEPTABLE_DENY_REASON = 26, /**< Non-EPS authentication unacceptable */ |
| 155 | QL_NW_REQUESTED_SERVICE_OPTION_NOT_AUTHORIZED_IN_THIS_PLMN_DENY_REASON = 35, /**< Requested service option not authorized in this PLMN */ |
| 156 | QL_NW_CS_SERVICE_TEMPORARILY_NOT_AVAILABLE_DENY_REASON = 39, /**< CS service temporarily not available */ |
| 157 | QL_NW_NO_ESP_BEARER_CONTEXT_ACTIVATED_DENY_REASON = 40, /**< No EPS bearer context activated */ |
| 158 | QL_NW_SEMAMTICALLY_INCORRECT_MESSAGE_DENY_REASON = 95, /**< Semantically incorrect message. */ |
| 159 | QL_NW_INVALID_MANDATORY_INFORMATION_DENY_REASON = 96, /**< Invalid mandatory information. */ |
| 160 | QL_NW_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED_DENY_REASON = 97, /**< Message type non-existent or not implemented. */ |
| 161 | QL_NW_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCAL_STATE_DENY_REASON = 98, /**< Message type not compatible with protocol state. */ |
| 162 | QL_NW_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED_DENY_REASON = 99, /**< Information element non-existent or not implemented. */ |
| 163 | QL_NW_CONDITIONAL_IE_ERROR_DENY_REASON = 100, /**< Conditional IE error. */ |
| 164 | QL_NW_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCAL_STATE_DENY_REASON = 101, /**< Message not compatible with protocol state. */ |
| 165 | }QL_NW_DENY_REASON_TYPE_E; |
| 166 | |
| 167 | typedef enum QL_NW_SERVICE_TYPE_ENUM |
| 168 | { |
| 169 | QL_NW_SERVICE_NONE = 0, /**< Not registered or no data. */ |
| 170 | QL_NW_SERVICE_LIMITED = 1, /**< Registered; emergency service only. */ |
| 171 | QL_NW_SERVICE_FULL = 2, /**< Registered, full service. */ |
| 172 | }QL_NW_SERVICE_TYPE_E; |
| 173 | |
| 174 | typedef enum QL_NW_SELECTION_TYPE_ENUM |
| 175 | { |
| 176 | QL_NW_SELECTION_AUTOMATIC = 0, /**< Automatic network selection. */ |
| 177 | QL_NW_SELECTION_MANUAL = 1, /**< Manual network selection. */ |
| 178 | }QL_NW_SELECTION_TYPE_E; |
| 179 | |
| 180 | typedef enum QL_NW_CELL_ACCESS_STATE_TYPE_ENUM |
| 181 | { |
| 182 | QL_NW_CELL_ACCESS_NONE = 0, /**< Unknown cell access state. */ |
| 183 | QL_NW_CELL_ACCESS_NORMAL_ONLY = 1, /**< Cell access is allowed for normal calls only. */ |
| 184 | QL_NW_CELL_ACCESS_EMERGENCY_ONLY = 2, /**< Cell access is allowed for emergency calls only. */ |
| 185 | QL_NW_CELL_ACCESS_NO_CALLS = 3, /**< Cell access is not allowed for any call type. */ |
| 186 | QL_NW_CELL_ACCESS_ALL_CALLS = 4, /**< Cell access is allowed for all call types. */ |
| 187 | }QL_NW_CELL_ACCESS_STATE_TYPE_E; |
| 188 | |
| 189 | /** wea config items */ |
| 190 | typedef enum |
| 191 | { |
| 192 | QL_NW_WEA_CONFIG_PRESIDENTIAL_ALERT = (1 << 0), |
| 193 | QL_NW_WEA_CONFIG_EXTREME_ALERT = (1 << 1), |
| 194 | QL_NW_WEA_CONFIG_SEVERE_ALERT = (1 << 2), |
| 195 | QL_NW_WEA_CONFIG_AMBER_ALERT = (1 << 3), |
| 196 | QL_NW_WEA_CONFIG_PUBLIC_SAFETY_ALERT = (1 << 4), |
| 197 | QL_NW_WEA_CONFIG_STATE_LOCAL_TEST_ALERT = (1 << 5), |
| 198 | QL_NW_WEA_CONFIG_RMT_ALERT = (1 << 6), |
| 199 | QL_NW_WEA_CONFIG_EXERCISE_ALERT = (1 << 7), |
| 200 | QL_NW_WEA_CONFIG_CMSP_DEFINED_ALERT = (1 << 8), |
| 201 | QL_NW_WEA_CONFIG_SPANISH_ALERT = (1 << 9), |
| 202 | } QL_NW_WEA_CONFIG_E; |
| 203 | |
| 204 | /** bind subscription */ |
| 205 | typedef enum QL_NW_BIND_SUB_TYPE_ENUM |
| 206 | { |
| 207 | QL_NW_BIND_SUB_PRIMARY = 0, |
| 208 | QL_NW_BIND_SUB_SECONDARY = 1, |
| 209 | }QL_NW_BIND_SUB_TYPE_E; |
| 210 | |
| 211 | typedef struct |
| 212 | { |
| 213 | uint64_t preferred_nw_mode; /**< Preferred network mode for connections; a bitmask of QL_NW_MODE_xxxx.*/ |
| 214 | QL_NW_ROAM_STATE_TYPE_E preferred_roaming; /**< Roaming preference. 0 -- None, or roaming indicator off, 1 -- roaming indicator on*/ |
| 215 | }ql_nw_pref_nwmode_roaming_info_t; |
| 216 | |
| 217 | typedef struct |
| 218 | { |
| 219 | char nitz_time[QL_NW_NITZ_BUF_LEN + 1]; /**< format: YY/MM/DD,HH:MM:SS'+/-'TZ,daylight, Here TZ multiplied by 4*/ |
| 220 | uint64_t abs_time; /**< 0 means invalid */ |
| 221 | int8_t leap_sec; /**< 0 means invalid */ |
| 222 | }ql_nw_nitz_time_info_t; |
| 223 | |
| 224 | typedef struct |
| 225 | { |
| 226 | char long_eons[512 + 1]; /**< Long EONS.*/ |
| 227 | char short_eons[512 + 1]; /**< Short EONS.*/ |
| 228 | char mcc[3 + 1]; /**< Mobile country code.*/ |
| 229 | char mnc[3 + 1]; /**< Mobile network code.*/ |
| 230 | }ql_nw_mobile_operator_name_info_t; |
| 231 | |
| 232 | typedef struct |
| 233 | { |
| 234 | ql_nw_mobile_operator_name_info_t operator_name; /**< Operator name.*/ |
| 235 | QL_NW_NETWORK_STATUS_TYPE_E network_status; /**< Network status.*/ |
| 236 | QL_NW_RADIO_TECH_TYPE_E rat; /**< Radio technology.*/ |
| 237 | }ql_nw_scan_entry_info_t; |
| 238 | |
| 239 | typedef struct |
| 240 | { |
| 241 | uint32_t entry_len; /**< Must be set to the number of elements in entry. */ |
| 242 | ql_nw_scan_entry_info_t entry[QL_NW_SCAN_MAX_LIST_NUM]; /**< Scan entry.*/ |
| 243 | }ql_nw_scan_result_list_info_t; |
| 244 | |
| 245 | typedef struct |
| 246 | { |
| 247 | QL_NW_TECH_DOMAIN_TYPE_E tech_domain; /**< Technology domain: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/ |
| 248 | QL_NW_RADIO_TECH_TYPE_E radio_tech; /**< Radio technology; see #QL_NW_RADIO_TECH_TYPE_E.*/ |
| 249 | QL_NW_ROAM_STATE_TYPE_E roaming; /**< 0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/ |
| 250 | QL_NW_DENY_REASON_TYPE_E deny_reason; /**< Set when registration state is #QL_NW_DENY_REASON_TYPE_E, please refer to 3GPP 24301 SPEC ANNEX A chapter*/ |
| 251 | QL_NW_SERVICE_TYPE_E reg_state; /**< Registration state.*/ |
| 252 | char mcc[3+1]; /**< Mobile country code.*/ |
| 253 | char mnc[3+1]; /**< Mobile network code.*/ |
| 254 | uint8_t forbidden; /**< Forbidden: 0 -- No, 1 -- Yes.*/ |
| 255 | uint32_t cid; /**< Cell ID for the registered 3GPP system.*/ |
| 256 | uint16_t lac; /**< Locatin area code for the registered 3GPP system.*/ |
| 257 | uint16_t psc; /**< Primary scrambling code (WCDMA only); 0 -- None.*/ |
| 258 | uint16_t tac; /**< Tracking area code information for LTE.*/ |
| 259 | uint8_t inPRL; /**< 0 -- Not in PRL, 1 -- In PRL.*/ |
| 260 | uint8_t css; /**< Concurrent services supported: 0 -- No, 1 -- Yes.*/ |
| 261 | uint16_t sid; /**< CDMA system ID.*/ |
| 262 | uint16_t nid; /**< CDMA network ID.*/ |
| 263 | uint16_t bsid; /**< Base station ID. @newpagetable */ |
| 264 | |
| 265 | uint16_t nr5g_svc_opt; /**< NR5G service option or type, defined by QL_NW_NR5G_SO_XXX */ |
| 266 | uint16_t nr5g_pci; /**< NR5G physical Cell ID */ |
| 267 | uint64_t nr5g_cid; /**< NR5G SA Cell ID */ |
| 268 | uint32_t nr5g_tac; /**< NR5G tac info */ |
| 269 | |
| 270 | uint8_t endc_available; /**< EUTRA-NR Dual Connectivity */ |
| 271 | |
| 272 | }ql_nw_reg_status_info_t; |
| 273 | |
| 274 | typedef struct |
| 275 | { |
| 276 | QL_NW_SELECTION_TYPE_E nw_selection_type; /**< Network selection type. */ |
| 277 | char mcc[3 + 1]; /**< Mobile country code for a manual network selection.*/ |
| 278 | char mnc[3 + 1]; /**< Mobile network code for a manual network selection.*/ |
| 279 | QL_NW_RADIO_TECH_TYPE_E rat; /**< Radio technology.*/ |
| 280 | }ql_nw_pref_net_t; |
| 281 | |
| 282 | typedef struct |
| 283 | { |
| 284 | int8_t rssi; /**< RSSI in dBm. Indicates received signal strength. A signed value; -125 or lower indicates no signal.*/ |
| 285 | }ql_nw_gsm_signal_info_t; |
| 286 | |
| 287 | typedef struct |
| 288 | { |
| 289 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/ |
| 290 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 291 | }ql_nw_wcdma_signal_info_t; |
| 292 | |
| 293 | typedef struct |
| 294 | { |
| 295 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Ec. a signed value; -125 or lower indicates no signal.*/ |
| 296 | int8_t rscp; /**< RSCP in dBm.*/ |
| 297 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 298 | int8_t sinr; /**< Measured SINR in dB. @newpagetable */ |
| 299 | }ql_nw_tdscdma_signal_info_t; |
| 300 | |
| 301 | typedef struct |
| 302 | { |
| 303 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/ |
| 304 | int8_t rsrq; /**< RSRQ value in dB (signed integer value), as measured by L1. Range: -3 to -20 (-3 equals -3 dB, -20 equals -20 dB).*/ |
| 305 | int16_t rsrp; /**< Current RSRP in dBm, as measured by L1. Range: -44 to -140 (-44 equals -44 dBm, -140 equals -140 dBm).*/ |
| 306 | int16_t snr; /**< SNR level as a scaled integer in units of 0.1 dB; e.g., -16 dB has a value of -160 and 24.6 dB has a value of 246.*/ |
| 307 | }ql_nw_lte_signal_info_t; |
| 308 | |
| 309 | typedef struct |
| 310 | { |
| 311 | int16_t rsrq; /**< Current RSRQ in dBm, as measured by L1.*/ |
| 312 | int16_t rsrp; /**< Current RSRP in dBm, as measured by L1. Range: -44 to -140 (-44 equals -44 dBm, -140 equals -140 dBm).*/ |
| 313 | int16_t snr; /**< SNR level as a scaled integer in units of 0.1 dB; e.g., -16 dB has a value of -160 and 24.6 dB has a value of 246.*/ |
| 314 | }ql_nw_nr5g_signal_info_t; |
| 315 | |
| 316 | typedef struct |
| 317 | { |
| 318 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/ |
| 319 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 320 | }ql_nw_cdma_signal_info_t; |
| 321 | |
| 322 | typedef struct |
| 323 | { |
| 324 | int8_t rssi; /**< rssi in dbm. indicates forward link pilot power (agc) + ec/io. a signed value; -125 or lower indicates no signal.*/ |
| 325 | int16_t ecio; /**< ec/io value representing negative 0.5 db increments, e.g., 2 equals -1 dbm.*/ |
| 326 | int8_t sinr; /**< sinr level.*/ |
| 327 | int32_t io; /**< received io in dbm. */ |
| 328 | }ql_nw_hdr_signal_info_t; |
| 329 | |
| 330 | typedef struct |
| 331 | { |
| 332 | uint8_t has_gsm; /**< Must be set to TRUE if gsm_sig_info is being passed. */ |
| 333 | ql_nw_gsm_signal_info_t gsm; /**< GSM signal information. */ |
| 334 | uint8_t has_wcdma; /**< Must be set to TRUE if wcdma_sig_info is being passed. */ |
| 335 | ql_nw_wcdma_signal_info_t wcdma; /**< WCDMA signal information. */ |
| 336 | uint8_t has_tdscdma; /**< Must be set to TRUE if tdscdma_sig_info is being passed. */ |
| 337 | ql_nw_tdscdma_signal_info_t tdscdma; /**< TDSCDMA signal information. */ |
| 338 | uint8_t has_lte; /**< Must be set to TRUE if lte_sig_info is being passed. */ |
| 339 | ql_nw_lte_signal_info_t lte; /**< LTE signal information. */ |
| 340 | uint8_t has_nr5g; /**< Must be set to TRUE if nr5g_sig_info is being passed. */ |
| 341 | ql_nw_nr5g_signal_info_t nr5g; /**< NR5G signal information. */ |
| 342 | uint8_t has_cdma; /**< Must be set to TRUE if cdma_sig_info is being passed. */ |
| 343 | ql_nw_cdma_signal_info_t cdma; /**< CDMA signal information. */ |
| 344 | uint8_t has_hdr; /**< Must be set to TRUE if hdr_sig_info is being passed. */ |
| 345 | ql_nw_hdr_signal_info_t hdr; /**< HDR signal information. */ |
| 346 | }ql_nw_signal_strength_info_t; |
| 347 | |
| 348 | typedef struct |
| 349 | { |
| 350 | uint32_t cid; /**< Cell ID, (0 indicates information is not represent).*/ |
| 351 | char plmn[3]; /**< MCC/MNC inforamtion code.(This field should be ignored when cid is not present). */ |
| 352 | uint16_t lac; /**< Location area code.(This field should be ignord when cid is not present). */ |
| 353 | uint16_t arfcn; /**< Absolute RF channel number. */ |
| 354 | uint8_t bsic; /**< Base station identity code. (0 indicates information is not present). */ |
| 355 | int16_t rssi; /**< Received signal strength indicator in dBm.*/ |
| 356 | }ql_nw_gsm_info_t;; |
| 357 | |
| 358 | typedef struct |
| 359 | { |
| 360 | uint32_t cid; /**< Cell ID (0 indicates information is not present). */ |
| 361 | uint32_t lcid; /**< UTRAN Cell ID (0 indicates information is not present). */ |
| 362 | char plmn[3]; /**< MCC/MNC information code.(This field should be ignored when cid is not present). */ |
| 363 | uint16_t lac; /**< Location area code. (This field should be ignored when cid is not present). */ |
| 364 | uint16_t uarfcn; /**< UTRA absolute RF channel number. */ |
| 365 | uint16_t psc; /**< Primary scrambling code. */ |
| 366 | int16_t rssi; /**< Received signal strength indicator in dBm.*/ |
| 367 | }ql_nw_umts_info_t; |
| 368 | |
| 369 | typedef struct |
| 370 | { |
| 371 | uint32_t cid; /**< Global cell ID in the system information block (0 indicates information is not present). */ |
| 372 | char plmn[3]; /**< MCC/MNC information code.(This filed should be ignored when cid is not present). */ |
| 373 | uint16_t tac; /**< Tracing area code (This field should be ignored when cid is not present). */ |
| 374 | uint16_t pci; /**< Physical cell ID. Range: 0 to 503. */ |
| 375 | uint32_t earfcn; /**< E-UTRA absolute radio frequency channel number of the cell. RANGE: 0 TO 65535. */ |
| 376 | int16_t rssi; /**< Received signal strength indicator in dBm.*/ |
| 377 | }ql_nw_lte_info_t; |
| 378 | |
| 379 | typedef struct { |
| 380 | |
| 381 | uint64_t cid; /**< Global cell ID in the system information block (0 indicates information is not present). */ |
| 382 | char plmn[3]; /**< MCC/MNC information coded(This field should be ignored when cid is not present.) */ |
| 383 | uint32_t tac; /**< Tracking area code (This field should be ignored when cid is not present). */ |
| 384 | uint16_t pci; /**< Physical cell ID. Range: 0 to 503.*/ |
| 385 | uint32_t arfcn; /**< UTRA absolute radio frequency channel number of the cell. Range: 0 to 65535.*/ |
| 386 | int16_t rsrq; /**< Current RSRQ in units of 0.1 dB, as measured by L1.*/ |
| 387 | int16_t rsrp; /**< Current RSRP in units of 0.1 dB, as measured by L1.*/ |
| 388 | int16_t snr; /**< Current SNR in dBm, as measured by L1.*/ |
| 389 | }ql_nw_nr5g_info_t; |
| 390 | |
| 391 | typedef struct |
| 392 | { |
| 393 | uint16_t sid; /**< System ID. */ |
| 394 | uint16_t nid; /**< Network ID. */ |
| 395 | uint16_t bid; /**< Base station ID. */ |
| 396 | uint16_t refpn; /**< Reference PN. */ |
| 397 | uint32_t base_lat; /**< Latitude of the current base station in units of 0.25 sec. */ |
| 398 | uint32_t base_long; /**< Longitude of the current base station in units of 0.25 sec. */ |
| 399 | int16_t rssi; /**< Received signal strength indicator in dBm. */ |
| 400 | }ql_nw_cdma_info_t; |
| 401 | |
| 402 | typedef struct |
| 403 | { |
| 404 | QL_NW_RADIO_TECH_TYPE_E serving_rat; |
| 405 | uint8_t gsm_info_valid; /**< Must be set to true if gsm_info is being passed */ |
| 406 | uint8_t gsm_info_len; /**< Must be set to the number of elements in entry*/ |
| 407 | ql_nw_gsm_info_t gsm_info[QL_NW_MAX_GSM_CELL_INFO_NUM]; /**< GSM cell information (Serving and neighbor. */ |
| 408 | uint8_t umts_info_valid; /**< Must be set to true if umts_info is being passed */ |
| 409 | uint8_t umts_info_len; /**< Must be set to the number of elements in entry*/ |
| 410 | ql_nw_umts_info_t umts_info[QL_NW_MAX_UMTS_CELL_INFO_NUM];/**< UMTS cell information (Serving and neighbor). */ |
| 411 | uint8_t lte_info_valid; /**< Must be set to true if lte_info is being passed */ |
| 412 | uint8_t lte_info_len; /**< Must be set to the number of elements in entry*/ |
| 413 | ql_nw_lte_info_t lte_info[QL_NW_MAX_LTE_CELL_INFO_NUM]; /**< LTE cell information (Serving and neighbor). */ |
| 414 | uint8_t nr5g_info_valid; /**< Must be set to true if nr5g_info is being passed */ |
| 415 | ql_nw_nr5g_info_t nr5g_info; /**< NR5G cell information (Serving). */ |
| 416 | uint8_t cdma_info_valid; /**< Must be set to true if cdma_info is being passed */ |
| 417 | ql_nw_cdma_info_t cdma_info; /**< CDMA cell information (Serving). */ |
| 418 | }ql_nw_cell_info_t; |
| 419 | |
| 420 | typedef struct |
| 421 | { |
| 422 | uint8_t Presidential_alert; /**< Enable Presidential_alert: 0 -- Disable(can't Disable); 1 -- Enable */ |
| 423 | uint8_t Extreme_alert; /**< Enable or disable Extreme_alert: 0 -- Disable; 1 -- Enable */ |
| 424 | uint8_t Severe_alert; /**< Enable or disable Severe_alert: 0 -- Disable; 1 -- Enable */ |
| 425 | uint8_t Amber_alert; /**< Enable or disable Amber_alert: 0 -- Disable; 1 -- Enable */ |
| 426 | uint8_t PublicSafety_alert; /**< Enable or disable PublicSafety_alert: 0 -- Disable; 1 -- Enable */ |
| 427 | uint8_t StateLocalTest_alert; /**< Enable or disable StateLocalTest_alert: 0 -- Disable; 1 -- Enable */ |
| 428 | uint8_t RMT_alert; /**< Enable or disable RMT_alert: 0 -- Disable; 1 -- Enable */ |
| 429 | uint8_t Exercise_alert; /**< Enable or disable Exercise_alert: 0 -- Disable; 1 -- Enable */ |
| 430 | uint8_t CMSPDefined_alert; /**< Enable or disable CMSPDefined_alert: 0 -- Disable; 1 -- Enable */ |
| 431 | uint8_t Spanish_alert; /**< Enable or disable Spanish_alert: 0 -- Disable; 1 -- Enable */ |
| 432 | }ql_nw_wea_config_t; |
| 433 | |
| 434 | typedef struct |
| 435 | { |
| 436 | uint8_t wea_alert_info_valid; |
| 437 | char wea_alert_info[QL_NW_MAX_WEA_ALERT_LENGTH_V01]; |
| 438 | }ql_nw_wea_alert_info_t; |
| 439 | |
| 440 | typedef struct |
| 441 | { |
| 442 | uint8_t etws_primary_info_valid; |
| 443 | char etws_primary_info[QL_NW_MAX_ETWS_ALERT_LENGTH_V01]; |
| 444 | uint8_t etws_secondary_info_valid; |
| 445 | char etws_secondary_info[QL_NW_MAX_ETWS_ALERT_LENGTH_V01]; |
| 446 | }ql_nw_etws_alert_info_t; |
| 447 | |
| 448 | typedef void (*ql_nw_voice_reg_ind_cb)(ql_nw_reg_status_info_t *p_info); |
| 449 | |
| 450 | typedef void (*ql_nw_data_reg_ind_cb)(ql_nw_reg_status_info_t *p_info); |
| 451 | |
| 452 | typedef void (*ql_nw_signal_strength_ind_cb)(ql_nw_signal_strength_info_t *p_info, QL_NW_SIGNAL_STRENGTH_LEVEL_E level); |
| 453 | |
| 454 | typedef void (*ql_nw_cell_access_status_ind_cb)(QL_NW_CELL_ACCESS_STATE_TYPE_E status); |
| 455 | |
| 456 | typedef void (*ql_nw_nitz_time_update_ind_cb)(ql_nw_nitz_time_info_t *p_info); |
| 457 | |
| 458 | typedef void (*ql_nw_network_scan_async_cb)(int async_index, ql_nw_scan_result_list_info_t *p_info); |
| 459 | |
| 460 | typedef void (*ql_nw_wea_reg_ind_cb)(ql_nw_wea_alert_info_t *p_info); |
| 461 | |
| 462 | typedef void (*ql_nw_etws_reg_ind_cb)(ql_nw_etws_alert_info_t *p_info); |
| 463 | |
| 464 | typedef void (*ql_nw_service_error_cb_f)(int error); |
| 465 | |
| 466 | |
| 467 | /*-----------------------------------------------------------------------------------------------*/ |
| 468 | /** |
| 469 | @brief Initialize NW service. |
| 470 | @note You must call this function before other functions can be used in this module. |
| 471 | @return Whether the NW service was successfully intialized. |
| 472 | @retval QL_ERR_OK successful |
| 473 | @retval QL_ERR_SERVICE_NOT_READY service is not ready, need to retry |
| 474 | @retval Other error code defined by ql_type.h |
| 475 | */ |
| 476 | /*-----------------------------------------------------------------------------------------------*/ |
| 477 | int ql_nw_init(void); |
| 478 | |
| 479 | /*-----------------------------------------------------------------------------------------------*/ |
| 480 | /** |
| 481 | @brief Deinitializes NW service. |
| 482 | @return Whether the NW service was deinitialized successfully. |
| 483 | @retval QL_ERR_OK successful. |
| 484 | @retval Other error code defined by ql_type.h. |
| 485 | */ |
| 486 | /*-----------------------------------------------------------------------------------------------*/ |
| 487 | int ql_nw_deinit(void); |
| 488 | |
| 489 | /*-----------------------------------------------------------------------------------------------*/ |
| 490 | /** |
| 491 | @brief scan network status. |
| 492 | @param[out] async_index The index of request msg |
| 493 | @param[in] async_cb The callback function of request msg |
| 494 | @return Whether to successfully trigger the network scan operation |
| 495 | @retval QL_ERR_OK successful |
| 496 | @retval QL_ERR_NOT_INIT uninitialized |
| 497 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 498 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 499 | @retval Other error code defined by ql_type.h |
| 500 | */ |
| 501 | /*-----------------------------------------------------------------------------------------------*/ |
| 502 | int ql_nw_network_scan(int *async_index, ql_nw_network_scan_async_cb async_cb); |
| 503 | |
| 504 | |
| 505 | /*-----------------------------------------------------------------------------------------------*/ |
| 506 | /** |
| 507 | @brief set power mode. |
| 508 | @param[in] lower_mode, defined by QL_NW_LOWER_POWER_MASK_XXX |
| 509 | @return Whether to successfully set the power mode |
| 510 | @retval QL_ERR_OK successful |
| 511 | @retval QL_ERR_NOT_INIT uninitialized |
| 512 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 513 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 514 | @retval Other error code defined by ql_type.h |
| 515 | */ |
| 516 | /*-----------------------------------------------------------------------------------------------*/ |
| 517 | int ql_nw_set_power_mode(uint8_t lower_mode); |
| 518 | |
| 519 | |
| 520 | /*-----------------------------------------------------------------------------------------------*/ |
| 521 | /** |
| 522 | @brief set perferred NW mode and roaming indicator. |
| 523 | @param[in] p_info Pointer that point to ql_nw_pref_nwmode_roaming_info_t |
| 524 | @return Whether to successfully set nwmode and roaming |
| 525 | @retval QL_ERR_OK successful |
| 526 | @retval QL_ERR_NOT_INIT uninitialized |
| 527 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 528 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 529 | @retval Other error code defined by ql_type.h |
| 530 | */ |
| 531 | /*-----------------------------------------------------------------------------------------------*/ |
| 532 | int ql_nw_set_pref_nwmode_roaming(ql_nw_pref_nwmode_roaming_info_t *p_info); |
| 533 | |
| 534 | |
| 535 | /*-----------------------------------------------------------------------------------------------*/ |
| 536 | /** |
| 537 | @brief get perferred NW mode and roaming indicator. |
| 538 | @param[out] p_info Pointer that point to ql_nw_pref_nwmode_roaming_info_t |
| 539 | @return Whether to successfully get nwmode and roaming |
| 540 | @retval QL_ERR_OK successful |
| 541 | @retval QL_ERR_NOT_INIT uninitialized |
| 542 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 543 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 544 | @retval Other error code defined by ql_type.h |
| 545 | */ |
| 546 | /*-----------------------------------------------------------------------------------------------*/ |
| 547 | int ql_nw_get_pref_nwmode_roaming(ql_nw_pref_nwmode_roaming_info_t *p_info); |
| 548 | |
| 549 | |
| 550 | /*-----------------------------------------------------------------------------------------------*/ |
| 551 | /** |
| 552 | @brief get mobile operator name. |
| 553 | @param[out] p_info Pointer that point to ql_nw_mobile_operator_name_info_t |
| 554 | @return Whether to successfully get the mobile operator name |
| 555 | @retval QL_ERR_OK successful |
| 556 | @retval QL_ERR_NOT_INIT uninitialized |
| 557 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 558 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 559 | @retval Other error code defined by ql_type.h |
| 560 | */ |
| 561 | /*-----------------------------------------------------------------------------------------------*/ |
| 562 | int ql_nw_get_mobile_operator_name(ql_nw_mobile_operator_name_info_t *p_info); |
| 563 | |
| 564 | |
| 565 | /*-----------------------------------------------------------------------------------------------*/ |
| 566 | /** |
| 567 | @brief get cell information. |
| 568 | @param[out] p_info Pointer that point to ql_nw_cell_info_t |
| 569 | @return Whether to successfully get the cell information |
| 570 | @retval QL_ERR_OK successful |
| 571 | @retval QL_ERR_NOT_INIT uninitialized |
| 572 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 573 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 574 | @retval Other error code defined by ql_type.h |
| 575 | */ |
| 576 | /*-----------------------------------------------------------------------------------------------*/ |
| 577 | int ql_nw_get_cell_info(ql_nw_cell_info_t *p_info); |
| 578 | |
| 579 | /*-----------------------------------------------------------------------------------------------*/ |
| 580 | /** |
| 581 | @brief get voice registration status. |
| 582 | @param[out] p_info Pointer that point to ql_nw_reg_status_info_t |
| 583 | @return Whether to successfully get the voice registration status |
| 584 | @retval QL_ERR_OK successful |
| 585 | @retval QL_ERR_NOT_INIT uninitialized |
| 586 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 587 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 588 | @retval Other error code defined by ql_type.h |
| 589 | */ |
| 590 | /*-----------------------------------------------------------------------------------------------*/ |
| 591 | int ql_nw_get_voice_reg_status(ql_nw_reg_status_info_t *p_info); |
| 592 | |
| 593 | |
| 594 | /*-----------------------------------------------------------------------------------------------*/ |
| 595 | /** |
| 596 | @brief get data registration status. |
| 597 | @param[out] p_info Pointer that point to ql_nw_reg_status_info_t |
| 598 | @return Whether to successfully get the data registration status |
| 599 | @retval QL_ERR_OK successful |
| 600 | @retval QL_ERR_NOT_INIT uninitialized |
| 601 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 602 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 603 | @retval Other error code defined by ql_type.h |
| 604 | */ |
| 605 | /*-----------------------------------------------------------------------------------------------*/ |
| 606 | int ql_nw_get_data_reg_status(ql_nw_reg_status_info_t *p_info); |
| 607 | |
| 608 | |
| 609 | /*-----------------------------------------------------------------------------------------------*/ |
| 610 | /** |
| 611 | @brief get current signal strength. |
| 612 | @param[out] p_info Pointer that point to ql_nw_signal_strength_info_t |
| 613 | @param[out] p_level: signal strength level |
| 614 | @return Whether to successfully get the signal strength |
| 615 | @retval QL_ERR_OK successful |
| 616 | @retval QL_ERR_NOT_INIT uninitialized |
| 617 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 618 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 619 | @retval Other error code defined by ql_type.h |
| 620 | */ |
| 621 | /*-----------------------------------------------------------------------------------------------*/ |
| 622 | int ql_nw_get_signal_strength(ql_nw_signal_strength_info_t *p_info, QL_NW_SIGNAL_STRENGTH_LEVEL_E* p_level); |
| 623 | |
| 624 | |
| 625 | /*-----------------------------------------------------------------------------------------------*/ |
| 626 | /** |
| 627 | @brief get current cell acccess status. |
| 628 | @param[out] p_info Pointer that point to QL_NW_CELL_ACCESS_STATE_TYPE_E |
| 629 | @return Whether to successfully get the cell access status |
| 630 | @retval QL_ERR_OK successful |
| 631 | @retval QL_ERR_NOT_INIT uninitialized |
| 632 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 633 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 634 | @retval Other error code defined by ql_type.h |
| 635 | */ |
| 636 | /*-----------------------------------------------------------------------------------------------*/ |
| 637 | int ql_nw_get_cell_access_status(QL_NW_CELL_ACCESS_STATE_TYPE_E *p_info); |
| 638 | |
| 639 | |
| 640 | /*-----------------------------------------------------------------------------------------------*/ |
| 641 | /** |
| 642 | @brief get network time. |
| 643 | @param[out] p_info Pointer that point to ql_nw_nitz_time_info_t |
| 644 | @return Whether to successfully get the network time |
| 645 | @retval QL_ERR_OK successful |
| 646 | @retval QL_ERR_NOT_INIT uninitialized |
| 647 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 648 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 649 | @retval Other error code defined by ql_type.h |
| 650 | */ |
| 651 | /*-----------------------------------------------------------------------------------------------*/ |
| 652 | int ql_nw_get_nitz_time_info(ql_nw_nitz_time_info_t *p_info); |
| 653 | |
| 654 | |
| 655 | /*-----------------------------------------------------------------------------------------------*/ |
| 656 | /** |
| 657 | @brief register voice registration event. |
| 658 | @param[in] cb_func Voice registration indication callback function |
| 659 | @return Whether the voice registration event was successfully registered. |
| 660 | @retval QL_ERR_OK successful |
| 661 | @retval QL_ERR_NOT_INIT uninitialized |
| 662 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 663 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 664 | @retval Other error code defined by ql_type.h |
| 665 | */ |
| 666 | /*-----------------------------------------------------------------------------------------------*/ |
| 667 | int ql_nw_set_voice_reg_ind_cb(ql_nw_voice_reg_ind_cb cb_func); |
| 668 | |
| 669 | |
| 670 | /*-----------------------------------------------------------------------------------------------*/ |
| 671 | /** |
| 672 | @brief register data registration event. |
| 673 | @param[in] cb_func Data registration indication callback function |
| 674 | @return Whether the data registration event was successfully registered. |
| 675 | @retval QL_ERR_OK successful |
| 676 | @retval QL_ERR_NOT_INIT uninitialized |
| 677 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 678 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 679 | @retval Other error code defined by ql_type.h |
| 680 | */ |
| 681 | /*-----------------------------------------------------------------------------------------------*/ |
| 682 | int ql_nw_set_data_reg_ind_cb(ql_nw_data_reg_ind_cb cb_func); |
| 683 | |
| 684 | |
| 685 | /*-----------------------------------------------------------------------------------------------*/ |
| 686 | /** |
| 687 | @brief register signal strength event. |
| 688 | @param[in] cb_func Signal strength indication callback function |
| 689 | @return Whether the signal strength event was successfully registered |
| 690 | @retval QL_ERR_OK successful |
| 691 | @retval QL_ERR_NOT_INIT uninitialized |
| 692 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 693 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 694 | @retval Other error code defined by ql_type.h |
| 695 | */ |
| 696 | /*-----------------------------------------------------------------------------------------------*/ |
| 697 | int ql_nw_set_signal_strength_ind_cb(ql_nw_signal_strength_ind_cb cb_func); |
| 698 | |
| 699 | |
| 700 | /*-----------------------------------------------------------------------------------------------*/ |
| 701 | /** |
| 702 | @brief register cell access status event. |
| 703 | @param[in] cb_func Cell access status indication callback function |
| 704 | @return Whether the cell access status event was successfully registered |
| 705 | @retval QL_ERR_OK successful |
| 706 | @retval QL_ERR_NOT_INIT uninitialized |
| 707 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 708 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 709 | @retval Other error code defined by ql_type.h |
| 710 | */ |
| 711 | /*-----------------------------------------------------------------------------------------------*/ |
| 712 | int ql_nw_set_cell_access_status_ind_cb(ql_nw_cell_access_status_ind_cb cb_func); |
| 713 | |
| 714 | |
| 715 | /*-----------------------------------------------------------------------------------------------*/ |
| 716 | /** |
| 717 | @brief register network time event. |
| 718 | @param[in] cb_func nitz time update indication callback function |
| 719 | @return Whether the network time event was successfully registered |
| 720 | @retval QL_ERR_OK successful |
| 721 | @retval QL_ERR_NOT_INIT uninitialized |
| 722 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 723 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 724 | @retval Other error code defined by ql_type.h |
| 725 | */ |
| 726 | /*-----------------------------------------------------------------------------------------------*/ |
| 727 | int ql_nw_set_nitz_time_update_ind_cb(ql_nw_nitz_time_update_ind_cb cb_func); |
| 728 | |
| 729 | /*-----------------------------------------------------------------------------------------------*/ |
| 730 | /** |
| 731 | @brief register wea alert event. |
| 732 | @param[in] cb_func wea alert indication callback function |
| 733 | @return Whether the network time event was successfully registered |
| 734 | @retval QL_ERR_OK successful |
| 735 | @retval QL_ERR_NOT_INIT uninitialized |
| 736 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 737 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 738 | @retval Other error code defined by ql_type.h |
| 739 | */ |
| 740 | /*-----------------------------------------------------------------------------------------------*/ |
| 741 | int ql_nw_set_wea_alert_ind_cb(ql_nw_wea_reg_ind_cb cb_func); |
| 742 | |
| 743 | /*-----------------------------------------------------------------------------------------------*/ |
| 744 | /** |
| 745 | @brief register etws alert event. |
| 746 | @param[in] cb_func etws alert indication callback function |
| 747 | @return Whether the network time event was successfully registered |
| 748 | @retval QL_ERR_OK successful |
| 749 | @retval QL_ERR_NOT_INIT uninitialized |
| 750 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 751 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 752 | @retval Other error code defined by ql_type.h |
| 753 | */ |
| 754 | /*-----------------------------------------------------------------------------------------------*/ |
| 755 | int ql_nw_set_etws_alert_ind_cb(ql_nw_etws_reg_ind_cb cb_func); |
| 756 | |
| 757 | /*-----------------------------------------------------------------------------------------------*/ |
| 758 | /** |
| 759 | @brief set wea alert config. |
| 760 | @param[in] item Items to set. |
| 761 | @param[in] p_info Pointer that point to ql_nw_wea_config_t. |
| 762 | @return Whether to successfully set the wea config. |
| 763 | @retval QL_ERR_OK successful |
| 764 | @retval QL_ERR_NOT_INIT uninitialized |
| 765 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 766 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 767 | @retval Other error code defined by ql_type.h |
| 768 | */ |
| 769 | /*-----------------------------------------------------------------------------------------------*/ |
| 770 | int ql_nw_set_wea_config(int item, ql_nw_wea_config_t *p_info); |
| 771 | |
| 772 | /*-----------------------------------------------------------------------------------------------*/ |
| 773 | /** |
| 774 | @brief Gets wea config. |
| 775 | @param[out] p_config wea config. |
| 776 | @return Whether the wea config was successfully obtained. |
| 777 | @retval QL_ERR_OK successful. |
| 778 | @retval QL_ERR_INVALID_ARG invalid argument. |
| 779 | @retval QL_ERR_UNKNOWN unknown error, failed to connect to service. |
| 780 | @retval QL_ERR_SERVICE_NOT_READY service is not ready, need to retry. |
| 781 | @retval Other error code defined by ql_type.h. |
| 782 | */ |
| 783 | /*-----------------------------------------------------------------------------------------------*/ |
| 784 | int ql_nw_get_wea_config(ql_nw_wea_config_t *p_config); |
| 785 | |
| 786 | /*-----------------------------------------------------------------------------------------------*/ |
| 787 | /** |
| 788 | @brief set etws alert config. |
| 789 | @param[in] etws config. |
| 790 | @return Whether to successfully set the etws config. |
| 791 | @retval QL_ERR_OK successful |
| 792 | @retval QL_ERR_NOT_INIT uninitialized |
| 793 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 794 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 795 | @retval Other error code defined by ql_type.h |
| 796 | */ |
| 797 | /*-----------------------------------------------------------------------------------------------*/ |
| 798 | int ql_nw_set_etws_config(uint8_t enable_etws); |
| 799 | |
| 800 | /*-----------------------------------------------------------------------------------------------*/ |
| 801 | /** |
| 802 | @brief get etws alert config. |
| 803 | @param[out] p_enable_etws Pointer. |
| 804 | @return Whether to successfully set the etws config. |
| 805 | @retval QL_ERR_OK successful |
| 806 | @retval QL_ERR_NOT_INIT uninitialized |
| 807 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 808 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 809 | @retval Other error code defined by ql_type.h |
| 810 | */ |
| 811 | /*-----------------------------------------------------------------------------------------------*/ |
| 812 | int ql_nw_get_etws_config(uint8_t* p_enable_etws); |
| 813 | |
| 814 | /*-----------------------------------------------------------------------------------------------*/ |
| 815 | /** |
| 816 | @brief bind subscription |
| 817 | @param[in] sub_type subscription type |
| 818 | @return Whether to successfully bind subscription. |
| 819 | @retval QL_ERR_OK successful |
| 820 | @retval QL_ERR_NOT_INIT uninitialized |
| 821 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 822 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 823 | @retval Other error code defined by ql_type.h |
| 824 | */ |
| 825 | /*-----------------------------------------------------------------------------------------------*/ |
| 826 | int ql_nw_bind_subscription(QL_NW_BIND_SUB_TYPE_E sub_type); |
| 827 | |
| 828 | /*-----------------------------------------------------------------------------------------------*/ |
| 829 | /** |
| 830 | @brief get high capability subscription. |
| 831 | @param[out] p_high_cap pointer that point to QL_NW_BIND_SUB_TYPE_E |
| 832 | @return Whether the high capability subscription was successfully obtained. |
| 833 | @retval QL_ERR_OK successful |
| 834 | @retval QL_ERR_NOT_INIT uninitialized |
| 835 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 836 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 837 | @retval Other error code defined by ql_type.h |
| 838 | */ |
| 839 | /*-----------------------------------------------------------------------------------------------*/ |
| 840 | int ql_nw_get_high_cap_sub(QL_NW_BIND_SUB_TYPE_E *p_high_cap); |
| 841 | |
| 842 | /*-----------------------------------------------------------------------------------------------*/ |
| 843 | /** |
| 844 | @brief set the SIM card index that can uniquely register to the 5G network. |
| 845 | the main difference between high and non-high capability subscription is that high capability |
| 846 | subscription can register to 5G network while non-high capability subscription can only |
| 847 | register to LTE or GSM. |
| 848 | @param[in] high_cap high capability subscription |
| 849 | @return Whether to successfully set the high capability subscription. |
| 850 | @retval QL_ERR_OK successful |
| 851 | @retval QL_ERR_NOT_INIT uninitialized |
| 852 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 853 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 854 | @retval Other error code defined by ql_type.h |
| 855 | */ |
| 856 | /*-----------------------------------------------------------------------------------------------*/ |
| 857 | int ql_nw_set_high_cap_sub(QL_NW_BIND_SUB_TYPE_E high_cap); |
| 858 | |
| 859 | /*-----------------------------------------------------------------------------------------------*/ |
| 860 | /** |
| 861 | @brief Disable NR5G, NR5G_SA and NR5G_NSA can be disabled individually or together. |
| 862 | @param[in] opt_mask Option mask value. Value: |
| 863 | 0 - Do not disable NR5G |
| 864 | QL_NW_NR5G_SO_SA - Disable NR5G SA |
| 865 | QL_NW_NR5G_SO_NSA - Disable NR5G NSA |
| 866 | @return Whether to successfully disable NR5G mode. |
| 867 | @retval QL_ERR_OK successful |
| 868 | @retval QL_ERR_NOT_INIT uninitialized |
| 869 | @retval QL_ERR_SERVICE_NOT_READY service is not ready |
| 870 | @retval QL_ERR_INVALID_ARG Invalid arguments |
| 871 | @retval Other error code defined by ql_type.h |
| 872 | */ |
| 873 | /*-----------------------------------------------------------------------------------------------*/ |
| 874 | int ql_nw_disable_nr5g(uint16_t opt_mask); |
| 875 | |
| 876 | /*-----------------------------------------------------------------------------------------------*/ |
| 877 | /** |
| 878 | @brief Registration server error callback. Currently, only if the server exits abnormally, |
| 879 | the callback function will be executed, and the error code is QL_ERR_ABORTED; |
| 880 | @param[in] cb Callback function |
| 881 | @return |
| 882 | QL_ERR_OK - successful |
| 883 | Other - error code defined by ql_type.h |
| 884 | */ |
| 885 | /*-----------------------------------------------------------------------------------------------*/ |
| 886 | int ql_nw_set_service_error_cb(ql_nw_service_error_cb_f cb); |
| 887 | |
l.yang | e4f94f4 | 2025-04-29 18:08:39 -0700 | [diff] [blame] | 888 | /*-----------------------------------------------------------------------------------------------*/ |
| 889 | /** |
| 890 | @brief chose sim card to nw |
| 891 | @param[in] sub Subscription type. |
| 892 | @return Whether the subscription was successfully bound. |
| 893 | @retval QL_ERR_OK successful. |
| 894 | @retval QL_ERR_INVALID_ARG invalid argument. |
| 895 | @retval QL_ERR_UNKNOWN unknown error, failed to connect to service. |
| 896 | @retval QL_ERR_SERVICE_NOT_READY service is not ready, need to retry. |
| 897 | @retval Other error code defined by ql_type.h. |
| 898 | */ |
| 899 | /*-----------------------------------------------------------------------------------------------*/ |
| 900 | int ql_set_nw_slot(QL_SIM_SLOT_E log_slot); |
| 901 | |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 902 | #ifdef __cplusplus |
| 903 | } |
| 904 | #endif |
| 905 | |
| 906 | #endif |