b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 1 | /** |
| 2 | *@file QSER_nw.h |
| 3 | *@date 2018-02-22 |
| 4 | *@author |
| 5 | *@brief |
| 6 | */ |
| 7 | #ifndef __LYNQ_QSER_NETWORK_H__ |
| 8 | #define __LYNQ_QSER_NETWORK_H__ |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | #include "mbtk_type.h" |
| 13 | |
| 14 | typedef uint32_t nw_client_handle_type; |
| 15 | |
| 16 | |
| 17 | #define QSER_NW_MODE_NONE 0x00 /**< No network. */ |
| 18 | #define QSER_NW_MODE_GSM 0x01 /**< Include GSM networks. */ |
| 19 | #define QSER_NW_MODE_WCDMA 0x02 /**< Include WCDMA networks. */ |
| 20 | #define QSER_NW_MODE_CDMA 0x04 /**< Include CDMA networks. */ |
| 21 | #define QSER_NW_MODE_EVDO 0x08 /**< Include EVDO networks. */ |
| 22 | #define QSER_NW_MODE_LTE 0x10 /**< Include LTE networks. */ |
| 23 | #define QSER_NW_MODE_TDSCDMA 0x20 /**< Include TDSCDMA networks. */ |
| 24 | |
| 25 | typedef enum |
| 26 | { |
| 27 | E_QSER_NW_ROAM_STATE_OFF = 0, /**< None, or roaming indicator off. */ |
| 28 | E_QSER_NW_ROAM_STATE_ON = 1 /**< Roaming indicator on. */ |
| 29 | }E_QSER_NW_ROAM_STATE_TYPE_T; |
| 30 | |
| 31 | /** Configures the settings that define the MCM network interface. */ |
| 32 | typedef struct |
| 33 | { |
| 34 | /* Configuration parameters for MCM network registration Network registration details Technology dependent network registration details */ |
| 35 | uint64_t preferred_nw_mode; /**< Preferred network mode for connections; a bitmask of QSER_NW_MODE_xxxx.*/ |
| 36 | E_QSER_NW_ROAM_STATE_TYPE_T roaming_pref; /**< Roaming preference.*/ |
| 37 | }QSER_NW_CONFIG_INFO_T; |
| 38 | |
| 39 | /** Configures the OOS (out of service) settings that define the MCM network interface. */ |
| 40 | #define QSER_NW_OOS_CFG_TYPE_FAST_SCAN 0x00 /**< fast net scan */ |
| 41 | #define QSER_NW_OOS_CFG_TYPE_FULL_BAND_SCAN 0x01 /**< full band scan */ |
| 42 | |
| 43 | typedef struct |
| 44 | { |
| 45 | /* Configuration parameters for MCM network fast network scan when OOS (out of service)*/ |
| 46 | char enable; |
| 47 | uint16_t time_interval; |
| 48 | }QSER_NW_OOS_CONFIG_FAST_SCAN_INFO_T; |
| 49 | |
| 50 | typedef struct |
| 51 | { |
| 52 | /* Configuration parameters for MCM network full band network scan when OOS (out of service)*/ |
| 53 | int t_min; |
| 54 | int t_step; |
| 55 | int t_num; |
| 56 | int t_max; |
| 57 | }QSER_NW_OOS_CONFIG_FULL_BAND_SCAN_INFO_T; |
| 58 | |
| 59 | |
| 60 | typedef struct |
| 61 | { |
| 62 | char type; /**< QSER_NW_OOS_CFG_TYPE_xxxx.*/ |
| 63 | union { |
| 64 | QSER_NW_OOS_CONFIG_FAST_SCAN_INFO_T fast_can_info; // 00 |
| 65 | QSER_NW_OOS_CONFIG_FULL_BAND_SCAN_INFO_T full_band_scan_info; // 01 |
| 66 | } u; |
| 67 | }QSER_NW_OOS_CONFIG_INFO_T; |
| 68 | |
| 69 | //defined for QSER_NW_EventRegister |
| 70 | #define NW_IND_VOICE_REG_EVENT_IND_FLAG (1 << 0) /**< msg format : QSER_NW_VOICE_REG_EVENT_IND_T */ |
| 71 | #define NW_IND_DATA_REG_EVENT_IND_FLAG (1 << 1) /**< msg format : QSER_NW_DATA_REG_EVENT_IND_T */ |
| 72 | #define NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG (1 << 2) /**< msg format : QSER_NW_SINGNAL_EVENT_IND_T */ |
| 73 | |
| 74 | typedef struct |
| 75 | { |
| 76 | char long_eons[512 + 1]; /**< Long EONS.*/ |
| 77 | char short_eons[512 + 1]; /**< Short EONS.*/ |
| 78 | char mcc[3 + 1]; /**< Mobile country code.*/ |
| 79 | char mnc[3 + 1]; /**< Mobile network code.*/ |
| 80 | }QSER_NW_OPERATOR_NAME_INFO_T; |
| 81 | |
| 82 | typedef enum |
| 83 | { |
| 84 | E_QSER_NW_RADIO_TECH_TD_SCDMA = 1, |
| 85 | E_QSER_NW_RADIO_TECH_GSM = 2, /**< GSM; only supports voice. */ |
| 86 | E_QSER_NW_RADIO_TECH_HSPAP = 3, /**< HSPA+. */ |
| 87 | E_QSER_NW_RADIO_TECH_LTE = 4, /**< LTE. */ |
| 88 | E_QSER_NW_RADIO_TECH_EHRPD = 5, /**< EHRPD. */ |
| 89 | E_QSER_NW_RADIO_TECH_EVDO_B = 6, /**< EVDO B. */ |
| 90 | E_QSER_NW_RADIO_TECH_HSPA = 7, /**< HSPA. */ |
| 91 | E_QSER_NW_RADIO_TECH_HSUPA = 8, /**< HSUPA. */ |
| 92 | E_QSER_NW_RADIO_TECH_HSDPA = 9, /**< HSDPA. */ |
| 93 | E_QSER_NW_RADIO_TECH_EVDO_A = 10, /**< EVDO A. */ |
| 94 | E_QSER_NW_RADIO_TECH_EVDO_0 = 11, /**< EVDO 0. */ |
| 95 | E_QSER_NW_RADIO_TECH_1xRTT = 12, /**< 1xRTT. */ |
| 96 | E_QSER_NW_RADIO_TECH_IS95B = 13, /**< IS95B. */ |
| 97 | E_QSER_NW_RADIO_TECH_IS95A = 14, /**< IS95A. */ |
| 98 | E_QSER_NW_RADIO_TECH_UMTS = 15, /**< UMTS. */ |
| 99 | E_QSER_NW_RADIO_TECH_EDGE = 16, /**< EDGE. */ |
| 100 | E_QSER_NW_RADIO_TECH_GPRS = 17, /**< GPRS. */ |
| 101 | E_QSER_NW_RADIO_TECH_NONE = 18 /**< No technology selected. */ |
| 102 | }E_QSER_NW_RADIO_TECH_TYPE_T; |
| 103 | |
| 104 | |
| 105 | typedef enum |
| 106 | { |
| 107 | E_QSER_NW_TECH_DOMAIN_NONE = 0, /**< None. */ |
| 108 | E_QSER_NW_TECH_DOMAIN_3GPP = 1, /**< 3GPP. */ |
| 109 | E_QSER_NW_TECH_DOMAIN_3GPP2 = 2, /**< 3GPP2. */ |
| 110 | }E_QSER_NW_TECH_DOMAIN_TYPE_T; |
| 111 | |
| 112 | typedef enum |
| 113 | { |
| 114 | E_QSER_NW_IMSI_UNKNOWN_HLR_DENY_REASON = 1, /**< IMSI unknown in HLR. */ |
| 115 | E_QSER_NW_ILLEGAL_MS_DENY_REASON = 2, /**< Illegal MS. */ |
| 116 | E_QSER_NW_IMSI_UNKNOWN_VLR_DENY_REASON = 3, /**< IMSI unknown in VLR. */ |
| 117 | E_QSER_NW_IMEI_NOT_ACCEPTED_DENY_REASON = 4, /**< IMEI not accepted. */ |
| 118 | E_QSER_NW_ILLEGAL_ME_DENY_REASON = 5, /**< Illegal ME. */ |
| 119 | E_QSER_NW_PLMN_NOT_ALLOWED_DENY_REASON = 6, /**< PLMN not allowed. */ |
| 120 | E_QSER_NW_LA_NOT_ALLOWED_DENY_REASON = 7, /**< Location area not allowed. */ |
| 121 | E_QSER_NW_ROAMING_NOT_ALLOWED_LA_DENY_REASON = 8, /**< Roaming not allowed in this location area. */ |
| 122 | E_QSER_NW_NO_SUITABLE_CELLS_LA_DENY_REASON = 9, /**< No suitable cells in location area. */ |
| 123 | E_QSER_NW_NETWORK_FAILURE_DENY_REASON = 10, /**< Network failure. */ |
| 124 | E_QSER_NW_MAC_FAILURE_DENY_REASON = 11, /**< MAC failure. */ |
| 125 | E_QSER_NW_SYNCH_FAILURE_DENY_REASON = 12, /**< Sync failure. */ |
| 126 | E_QSER_NW_CONGESTION_DENY_REASON = 13, /**< Congestion. */ |
| 127 | E_QSER_NW_GSM_AUTHENTICATION_UNACCEPTABLE_DENY_REASON = 14, /**< GSM authentication unacceptable. */ |
| 128 | E_QSER_NW_NOT_AUTHORIZED_CSG_DENY_REASON = 15, /**< Not authorized in this CSG. */ |
| 129 | E_QSER_NW_SERVICE_OPTION_NOT_SUPPORTED_DENY_REASON = 16, /**< Service option not supported. */ |
| 130 | E_QSER_NW_REQ_SERVICE_OPTION_NOT_SUBSCRIBED_DENY_REASON = 17, /**< Requested service option not subscribed. */ |
| 131 | E_QSER_NW_CALL_CANNOT_BE_IDENTIFIED_DENY_REASON = 18, /**< Call cannot be identified. */ |
| 132 | E_QSER_NW_SEMANTICALLY_INCORRECT_MSG_DENY_REASON = 19, /**< Semantically incorrect message. */ |
| 133 | E_QSER_NW_INVALID_MANDATORY_INFO_DENY_REASON = 20, /**< Invalid mandatory information. */ |
| 134 | E_QSER_NW_MSG_TYPE_NON_EXISTENT_DENY_REASON = 21, /**< Message type non-existent or not implemented. */ |
| 135 | E_QSER_NW_INFO_ELEMENT_NON_EXISTENT_DENY_REASON = 22, /**< Message type not compatible with the protocol state. */ |
| 136 | E_QSER_NW_CONDITIONAL_IE_ERR_DENY_REASON = 23, /**< Conditional IE error. */ |
| 137 | E_QSER_NW_MSG_INCOMPATIBLE_PROTOCOL_STATE_DENY_REASON = 24, /**< Message not compatible with the protocol state. */ |
| 138 | E_QSER_NW_PROTOCOL_ERROR_DENY_REASON = 25, /**< Unspecified protocol error. */ |
| 139 | }E_QSER_NW_DENY_REASON_TYPE_T; |
| 140 | |
| 141 | |
| 142 | typedef enum |
| 143 | { |
| 144 | E_QSER_NW_SERVICE_NONE = 0x0000, /**< Not registered or no data. */ |
| 145 | E_QSER_NW_SERVICE_LIMITED = 0x0001, /**< Registered; emergency service only. */ |
| 146 | E_QSER_NW_SERVICE_FULL = 0x0002, /**< Registered, full service. */ |
| 147 | }E_QSER_NW_SERVICE_TYPE_T; |
| 148 | |
| 149 | typedef struct |
| 150 | { |
| 151 | E_QSER_NW_TECH_DOMAIN_TYPE_T tech_domain; /**< Technology, used to determine the structure type tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/ |
| 152 | E_QSER_NW_RADIO_TECH_TYPE_T radio_tech; /**< Radio technology; see #nw_radio_tech_t_v01.*/ |
| 153 | E_QSER_NW_ROAM_STATE_TYPE_T roaming; /**< 0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/ |
| 154 | E_QSER_NW_DENY_REASON_TYPE_T deny_reason; /**< Set when registration state is #nw_deny_reason_t_v01.*/ |
| 155 | E_QSER_NW_SERVICE_TYPE_T registration_state; /**< Registration state.*/ |
| 156 | }QSER_NW_COMMON_REG_INFO_T; |
| 157 | |
| 158 | |
| 159 | typedef struct |
| 160 | { |
| 161 | E_QSER_NW_TECH_DOMAIN_TYPE_T tech_domain; /**< Technology, used to determine the structure type tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/ |
| 162 | E_QSER_NW_RADIO_TECH_TYPE_T radio_tech; /**< Radio technology; see #nw_radio_tech_t_v01.*/ |
| 163 | char mcc[3+1]; /**< Mobile country code.*/ |
| 164 | char mnc[3+1]; /**< Mobile network code.*/ |
| 165 | E_QSER_NW_ROAM_STATE_TYPE_T roaming; /**< 0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/ |
| 166 | uint8_t forbidden; /**< Forbidden: 0 -- No, 1 -- Yes.*/ |
| 167 | uint32_t cid; /**< Cell ID for the registered 3GPP system.*/ |
| 168 | uint16_t lac; /**< Locatin area code for the registered 3GPP system.*/ |
| 169 | uint16_t psc; /**< Primary scrambling code (WCDMA only); 0 -- None.*/ |
| 170 | uint16_t tac; /**< Tracking area code information for LTE.*/ |
| 171 | }QSER_NW_3GPP_REG_INFO_T; |
| 172 | |
| 173 | |
| 174 | typedef struct |
| 175 | { |
| 176 | E_QSER_NW_TECH_DOMAIN_TYPE_T tech_domain; /**< Technology, used to determine structure type tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/ |
| 177 | E_QSER_NW_RADIO_TECH_TYPE_T radio_tech; /**< Radio technology; see #nw_radio_tech_t_v01.*/ |
| 178 | char mcc[3+1]; /**< Mobile country code.*/ |
| 179 | char mnc[3+1]; /**< Mobile network code.*/ |
| 180 | E_QSER_NW_ROAM_STATE_TYPE_T roaming; /**< Roaming status; see #nw_roam_state_t_v01.*/ |
| 181 | uint8_t forbidden; /**< Forbidden: 0 -- No, 1 -- Yes.*/ |
| 182 | uint8_t inPRL; /**< 0 -- Not in PRL, 1 -- In PRL.*/ |
| 183 | uint8_t css; /**< Concurrent services supported: 0 -- No, 1 -- Yes.*/ |
| 184 | uint16_t sid; /**< CDMA system ID.*/ |
| 185 | uint16_t nid; /**< CDMA network ID.*/ |
| 186 | uint16_t bsid; /**< Base station ID. @newpagetable */ |
| 187 | }QSER_NW_3GPP2_REG_INFO_T; |
| 188 | |
| 189 | /** Gets the status associated with the connection of \<id\>. */ |
| 190 | typedef struct |
| 191 | { |
| 192 | uint8_t voice_registration_valid; /**< Must be set to TRUE if voice_registration is being passed. */ |
| 193 | QSER_NW_COMMON_REG_INFO_T voice_registration; /**< Voice registration. */ |
| 194 | |
| 195 | uint8_t data_registration_valid; /**< Must be set to TRUE if data_registration is being passed. */ |
| 196 | QSER_NW_COMMON_REG_INFO_T data_registration; /**< Data registration. */ |
| 197 | |
| 198 | uint8_t voice_registration_details_3gpp_valid; /**< Must be set to TRUE if voice_registration_details_3gpp is being passed. */ |
| 199 | QSER_NW_3GPP_REG_INFO_T voice_registration_details_3gpp; /**< Voice registration details for 3GPP. */ |
| 200 | |
| 201 | uint8_t data_registration_details_3gpp_valid; /**< Must be set to TRUE if data_registration_details_3gpp is being passed. */ |
| 202 | QSER_NW_3GPP_REG_INFO_T data_registration_details_3gpp; /**< Data registration details for 3GPP. */ |
| 203 | |
| 204 | uint8_t voice_registration_details_3gpp2_valid; /**< Must be set to TRUE if voice_registration_details_3gpp2 is being passed. */ |
| 205 | QSER_NW_3GPP2_REG_INFO_T voice_registration_details_3gpp2; /**< Voice registration details for 3GPP2. */ |
| 206 | |
| 207 | uint8_t data_registration_details_3gpp2_valid; /**< Must be set to TRUE if data_registration_details_3gpp2 is being passed. */ |
| 208 | QSER_NW_3GPP2_REG_INFO_T data_registration_details_3gpp2; /**< Data registration details for 3GPP2. */ |
| 209 | }QSER_NW_REG_STATUS_INFO_T; |
| 210 | |
| 211 | |
| 212 | typedef struct |
| 213 | { |
| 214 | int8_t rssi; /**< RSSI in dBm. Indicates received signal strength. A signed value; -125 or lower indicates no signal.*/ |
| 215 | }QSER_NW_GSM_SIGNAL_INFO_T; |
| 216 | |
| 217 | |
| 218 | typedef struct |
| 219 | { |
| 220 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/ |
| 221 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 222 | }QSER_NW_WCDMA_SIGNAL_INFO_T; |
| 223 | |
| 224 | typedef struct |
| 225 | { |
| 226 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Ec. a signed value; -125 or lower indicates no signal.*/ |
| 227 | int8_t rscp; /**< RSCP in dBm.*/ |
| 228 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 229 | int8_t sinr; /**< Measured SINR in dB. @newpagetable */ |
| 230 | }QSER_NW_TDSCDMA_SIGNAL_INFO_T; |
| 231 | |
| 232 | typedef struct |
| 233 | { |
| 234 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/ |
| 235 | 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).*/ |
| 236 | int16_t rsrp; /**< Current RSRP in dBm, as measured by L1. Range: -44 to -140 (-44 equals -44 dBm, -140 equals -140 dBm).*/ |
| 237 | 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.*/ |
| 238 | }QSER_NW_LTE_SIGNAL_INFO_T; |
| 239 | |
| 240 | typedef struct |
| 241 | { |
| 242 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/ |
| 243 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 244 | }QSER_NW_CDMA_SIGNAL_INFO_T; |
| 245 | |
| 246 | typedef struct |
| 247 | { |
| 248 | int8_t rssi; /**< RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/ |
| 249 | int16_t ecio; /**< Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/ |
| 250 | int8_t sinr; /**< SINR level.*/ |
| 251 | int32_t io; /**< Received IO in dBm. */ |
| 252 | }QSER_NW_HDR_SIGNAL_INFO_T; |
| 253 | |
| 254 | typedef struct |
| 255 | { |
| 256 | int16_t ssRsrp; /* SS(Synchronization Signal) reference signal received power, multipled by -1. |
| 257 | * Reference: 3GPP TS 38.215. |
| 258 | * Range [44, 140], INT_MAX means invalid/unreported.*/ |
| 259 | int16_t ssRsrq; /* SS reference signal received quality, multipled by -1. |
| 260 | * Reference: 3GPP TS 38.215. |
| 261 | * Range [3, 20], INT_MAX means invalid/unreported.*/ |
| 262 | int16_t ssSinr; /* SS signal-to-noise and interference ratio. |
| 263 | * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. |
| 264 | * Range [-23, 40], INT_MAX means invalid/unreported.*/ |
| 265 | int16_t csiRsrp; /* CSI reference signal received power, multipled by -1. |
| 266 | * Reference: 3GPP TS 38.215. |
| 267 | * Range [44, 140], INT_MAX means invalid/unreported.*/ |
| 268 | int16_t csiRsrq; /* CSI reference signal received quality, multipled by -1. |
| 269 | * Reference: 3GPP TS 38.215. |
| 270 | * Range [3, 20], INT_MAX means invalid/unreported.*/ |
| 271 | int16_t csiSinr; /* CSI signal-to-noise and interference ratio. |
| 272 | * Reference: 3GPP TS 138.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. |
| 273 | * Range [-23, 40], INT_MAX means invalid/unreported.*/ |
| 274 | }QSER_NW_NR_SIGNAL_INFO_T; |
| 275 | |
| 276 | |
| 277 | /** Gets signal strength information. */ |
| 278 | typedef struct |
| 279 | { |
| 280 | uint8_t gsm_sig_info_valid; /**< Must be set to TRUE if gsm_sig_info is being passed. */ |
| 281 | QSER_NW_GSM_SIGNAL_INFO_T gsm_sig_info; /**< GSM signal information. */ |
| 282 | uint8_t wcdma_sig_info_valid; /**< Must be set to TRUE if wcdma_sig_info is being passed. */ |
| 283 | QSER_NW_WCDMA_SIGNAL_INFO_T wcdma_sig_info; /**< WCDMA signal information. */ |
| 284 | uint8_t tdscdma_sig_info_valid; /**< Must be set to TRUE if tdscdma_sig_info is being passed. */ |
| 285 | QSER_NW_TDSCDMA_SIGNAL_INFO_T tdscdma_sig_info; /**< TDSCDMA signal information. */ |
| 286 | uint8_t lte_sig_info_valid; /**< Must be set to TRUE if lte_sig_info is being passed. */ |
| 287 | QSER_NW_LTE_SIGNAL_INFO_T lte_sig_info; /**< LTE signal information. */ |
| 288 | uint8_t cdma_sig_info_valid; /**< Must be set to TRUE if cdma_sig_info is being passed. */ |
| 289 | QSER_NW_CDMA_SIGNAL_INFO_T cdma_sig_info; /**< CDMA signal information. */ |
| 290 | uint8_t hdr_sig_info_valid; /**< Must be set to TRUE if hdr_sig_info is being passed. */ |
| 291 | QSER_NW_HDR_SIGNAL_INFO_T hdr_sig_info; /**< HDR signal information. */ |
| 292 | uint8_t nr_sig_info_valid; |
| 293 | QSER_NW_NR_SIGNAL_INFO_T nr_sig_info; |
| 294 | }QSER_NW_SIGNAL_STRENGTH_INFO_T; |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | /* @bridef Callback function registered to QSER_NW_AddRxMsgHandler |
| 301 | * map of ind_flag and ind_msg_buf as bellow : |
| 302 | * NW_IND_VOICE_REG_EVENT_IND_FLAG : QSER_NW_VOICE_REG_EVENT_IND_T |
| 303 | * NW_IND_DATA_REG_EVENT_IND_FLAG : QSER_NW_DATA_REG_EVENT_IND_T |
| 304 | * NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG : QSER_NW_SINGNAL_EVENT_IND_T |
| 305 | * NW_IND_CELL_ACCESS_STATE_CHG_EVENT_IND_FLAG : QSER_NW_CELL_ACCESS_STATE_EVENT_IND_T |
| 306 | * NW_IND_NITZ_TIME_UPDATE_EVENT_IND_FLAG : QSER_NW_NITZ_TIME_EVENT_IND_T |
| 307 | * */ |
| 308 | typedef void (*QSER_NW_RxMsgHandlerFunc_t)( |
| 309 | nw_client_handle_type h_nw, |
| 310 | uint32_t ind_flag, |
| 311 | void *ind_msg_buf, |
| 312 | uint32_t ind_msg_len, |
| 313 | void *contextPtr |
| 314 | ); |
| 315 | |
| 316 | |
| 317 | /** Indication message; Indication for the corresponding registered event flag NW_IND_VOICE_REG_EVENT_IND_FLAG */ |
| 318 | typedef struct { |
| 319 | |
| 320 | uint8_t registration_valid; /**< Must be set to TRUE if voice_registration is being passed. */ |
| 321 | QSER_NW_COMMON_REG_INFO_T registration; /**< Voice registration. */ |
| 322 | |
| 323 | uint8_t registration_details_3gpp_valid; /**< Must be set to TRUE if voice_registration_details_3gpp is being passed. */ |
| 324 | QSER_NW_3GPP_REG_INFO_T registration_details_3gpp; /**< Voice registration details for 3GPP. */ |
| 325 | |
| 326 | uint8_t registration_details_3gpp2_valid; /**< Must be set to TRUE if voice_registration_details_3gpp2 is being passed. */ |
| 327 | QSER_NW_3GPP2_REG_INFO_T registration_details_3gpp2; /**< Voice registration details for 3GPP2. */ |
| 328 | }QSER_NW_VOICE_REG_EVENT_IND_T; |
| 329 | |
| 330 | /** Indication message; Indication for the corresponding registered event flag NW_IND_DATA_REG_EVENT_IND_FLAG */ |
| 331 | typedef struct { |
| 332 | |
| 333 | uint8_t registration_valid; /**< Must be set to TRUE if data_registration is being passed. */ |
| 334 | QSER_NW_COMMON_REG_INFO_T registration; /**< Data registration. */ |
| 335 | |
| 336 | uint8_t registration_details_3gpp_valid; /**< Must be set to TRUE if data_registration_details_3gpp is being passed. */ |
| 337 | QSER_NW_3GPP_REG_INFO_T registration_details_3gpp; /**< Data registration details for 3GPP. */ |
| 338 | |
| 339 | uint8_t registration_details_3gpp2_valid; /**< Must be set to TRUE if data_registration_details_3gpp2 is being passed. */ |
| 340 | QSER_NW_3GPP2_REG_INFO_T registration_details_3gpp2; /**< Data registration details for 3GPP2. */ |
| 341 | }QSER_NW_DATA_REG_EVENT_IND_T; |
| 342 | |
| 343 | |
| 344 | /** Indication message; Indication for the corresponding registered event flag NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG */ |
| 345 | typedef struct { |
| 346 | uint8_t gsm_sig_info_valid; /**< Must be set to TRUE if gsm_sig_info is being passed. */ |
| 347 | QSER_NW_GSM_SIGNAL_INFO_T gsm_sig_info; /**< GSM singal information. */ |
| 348 | |
| 349 | uint8_t wcdma_sig_info_valid; /**< Must be set to TRUE if wcdma_sig_info is being passed. */ |
| 350 | QSER_NW_WCDMA_SIGNAL_INFO_T wcdma_sig_info; /**< WCDMA singal information. */ |
| 351 | |
| 352 | uint8_t tdscdma_sig_info_valid; /**< Must be set to TRUE if tdscdma_sig_info is being passed. */ |
| 353 | QSER_NW_TDSCDMA_SIGNAL_INFO_T tdscdma_sig_info; /**< TDSCDMA singal information. */ |
| 354 | |
| 355 | uint8_t lte_sig_info_valid; /**< Must be set to TRUE if lte_sig_info is being passed. */ |
| 356 | QSER_NW_LTE_SIGNAL_INFO_T lte_sig_info; /**< LTE singal information. */ |
| 357 | |
| 358 | uint8_t cdma_sig_info_valid; /**< Must be set to TRUE if cdma_sig_info is being passed. */ |
| 359 | QSER_NW_CDMA_SIGNAL_INFO_T cdma_sig_info; /**< CDMA singal information. */ |
| 360 | |
| 361 | uint8_t hdr_sig_info_valid; /**< Must be set to TRUE if hdr_sig_info is being passed. */ |
| 362 | QSER_NW_HDR_SIGNAL_INFO_T hdr_sig_info; /**< HDR singal information. */ |
| 363 | |
| 364 | uint8_t nr_sig_info_valid; |
| 365 | QSER_NW_NR_SIGNAL_INFO_T nr_sig_info; |
| 366 | }QSER_NW_SINGNAL_EVENT_IND_T; |
| 367 | |
r.xiao | e73f870 | 2024-01-06 01:40:03 -0800 | [diff] [blame] | 368 | typedef enum |
| 369 | { |
| 370 | E_QSER_NW_RF_MODE_CFUN_0 = 0, /**< CFUN 0. */ |
| 371 | E_QSER_NW_RF_MODE_CFUN_1 = 1, /**< CFUN 1. */ |
| 372 | E_QSER_NW_RF_MODE_FLIGHT = 4, /**< Flight Mode, CFUN 4. */ |
| 373 | }E_QSER_NW_RF_MODE_TYPE_T; |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 374 | |
| 375 | int qser_nw_client_init(nw_client_handle_type *ph_nw); |
| 376 | |
| 377 | int qser_nw_client_deinit(nw_client_handle_type h_nw); |
| 378 | |
| 379 | int qser_nw_set_config |
| 380 | ( |
| 381 | nw_client_handle_type h_nw, |
| 382 | QSER_NW_CONFIG_INFO_T *pt_info |
| 383 | ); |
| 384 | |
| 385 | int qser_nw_set_oos_config |
| 386 | ( |
| 387 | nw_client_handle_type h_nw, |
| 388 | QSER_NW_OOS_CONFIG_INFO_T *pt_info |
| 389 | ); |
| 390 | |
| 391 | int qser_nw_get_oos_config |
| 392 | ( |
| 393 | nw_client_handle_type h_nw, |
| 394 | QSER_NW_OOS_CONFIG_INFO_T *pt_info |
| 395 | ); |
r.xiao | d3256ae | 2024-02-28 23:20:55 -0800 | [diff] [blame] | 396 | /* |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 397 | int qser_nw_event_register |
| 398 | ( |
| 399 | nw_client_handle_type h_nw, |
| 400 | uint32_t bitmask // bit OR of NW_IND_xxxx_EVENT_ON |
| 401 | ); |
r.xiao | d3256ae | 2024-02-28 23:20:55 -0800 | [diff] [blame] | 402 | */ |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 403 | int qser_nw_get_operator_name |
| 404 | ( |
| 405 | nw_client_handle_type h_nw, |
| 406 | QSER_NW_OPERATOR_NAME_INFO_T *pt_info //You should malloc this or may cause stack overflow |
| 407 | ); |
| 408 | |
| 409 | int qser_nw_get_reg_status |
| 410 | ( |
| 411 | nw_client_handle_type h_nw, |
| 412 | QSER_NW_REG_STATUS_INFO_T *pt_info |
| 413 | ); |
| 414 | |
| 415 | int qser_nw_get_signal_strength |
| 416 | ( |
| 417 | nw_client_handle_type h_nw, |
| 418 | QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info |
| 419 | ); |
| 420 | |
| 421 | int qser_nw_add_rx_msg_handler |
| 422 | ( |
| 423 | nw_client_handle_type h_nw, |
| 424 | QSER_NW_RxMsgHandlerFunc_t handlerPtr, |
| 425 | void* contextPtr |
| 426 | ); |
| 427 | |
r.xiao | e73f870 | 2024-01-06 01:40:03 -0800 | [diff] [blame] | 428 | int qser_nw_set_rf_mode |
| 429 | ( |
| 430 | nw_client_handle_type h_nw, |
| 431 | E_QSER_NW_RF_MODE_TYPE_T rf_mode |
| 432 | ); |
| 433 | |
| 434 | int qser_nw_get_rf_mode |
| 435 | ( |
| 436 | nw_client_handle_type h_nw, |
| 437 | E_QSER_NW_RF_MODE_TYPE_T *rf_mode |
| 438 | ); |
| 439 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 440 | #ifdef __cplusplus |
| 441 | } |
| 442 | #endif |
| 443 | #endif//__QSER_NW_H__ |