ql_api_nw.h 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. /**
  2. @file
  3. ql_api_nw.h
  4. @brief
  5. This file provides the definitions for nw, and declares the
  6. API functions.
  7. */
  8. /*============================================================================
  9. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  10. Quectel Wireless Solution Proprietary and Confidential.
  11. =============================================================================*/
  12. /*===========================================================================
  13. EDIT HISTORY FOR MODULE
  14. This section contains comments describing changes made to the module.
  15. Notice that changes are listed in reverse chronological order.
  16. WHEN WHO WHAT, WHERE, WHY
  17. ---------- ------------ ----------------------------------------------------
  18. =============================================================================*/
  19. #ifndef QL_API_NW_H
  20. #define QL_API_NW_H
  21. #include <stdint.h>
  22. #include <stdbool.h>
  23. #include "ql_api_common.h"
  24. #include "ql_api_datacall.h"
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /*========================================================================
  29. * Marco Definition
  30. *========================================================================*/
  31. #define QL_NW_MCC_MAX_LEN 3 //maximum length of MCC
  32. #define QL_NW_MNC_MAX_LEN 3 //maximum length of MNC
  33. #define QL_NW_LONG_OPER_MAX_LEN 32 //maximum length of long operator name
  34. #define QL_NW_SHORT_OPER_MAX_LEN 32 //maximum length of short operator name
  35. #define QL_NW_RRCRel_MIN 0 //minimum lOCRRCRel TIME
  36. #define QL_NW_RRCRel_MAX 20 //maximum lOCRRCRel TIME
  37. #define QL_NW_CELL_MAX_NUM 7 //maxinum number of cell infomation (include serving cell and neighbour cell)
  38. #define QL_NW_EDRX_VALUE_MAX 15
  39. #define QL_NW_EDRX_PTW_MAX 15
  40. #define QL_NW_EDRX_ACTTYPE 4 //E-UTRAN (WB-S1 mode)
  41. /*========================================================================
  42. * Enumeration Definition
  43. *========================================================================*/
  44. typedef enum
  45. {
  46. QL_NW_UE_STAT_NORMAL, /* UE state is normal */
  47. QL_NW_UE_STAT_DISNET, /* UE cannot register due to restricted areas */
  48. QL_NW_UE_STAT_CFUN, /* UE is under cfun0 or cfun4 */
  49. } ql_nw_ue_stat_e;
  50. /*network mode type*/
  51. typedef enum
  52. {
  53. QL_NW_MODE_AUTO = 0, // AUTO mode and LTE preferred
  54. QL_NW_MODE_GSM, // GSM only mode
  55. QL_NW_MODE_LTE, // LTE only mode
  56. }ql_nw_mode_type_e;
  57. /*network cemode type, defined same with 3GPP 27.007*/
  58. typedef enum
  59. {
  60. QL_NW_PS_DATA = 0, // EPS Only, "data centric"
  61. QL_NW_CS_PS_VOICE = 1, // Combined EPS, "voice centric"
  62. QL_NW_PS_CS_DATA = 2, // Combined EPS, "data centric"
  63. QL_NW_PS_VOICE = 3, // EPS Only, "voice centric"
  64. }ql_nw_cemode_type_e;
  65. /*network access technology type, only support 0 and 7*/
  66. typedef enum
  67. {
  68. QL_NW_ACCESS_TECH_GSM = 0,
  69. QL_NW_ACCESS_TECH_GSM_COMPACT = 1,
  70. QL_NW_ACCESS_TECH_UTRAN = 2,
  71. QL_NW_ACCESS_TECH_GSM_wEGPRS = 3,
  72. QL_NW_ACCESS_TECH_UTRAN_wHSDPA = 4,
  73. QL_NW_ACCESS_TECH_UTRAN_wHSUPA = 5,
  74. QL_NW_ACCESS_TECH_UTRAN_wHSDPA_HSUPA = 6,
  75. QL_NW_ACCESS_TECH_E_UTRAN = 7,
  76. }ql_nw_act_type_e;
  77. /*network register status, equal to creg*/
  78. typedef enum
  79. {
  80. QL_NW_REG_STATE_NOT_REGISTERED=0, //not registered, MT is not currently searching an operator to register to
  81. QL_NW_REG_STATE_HOME_NETWORK=1, //registered, home network
  82. QL_NW_REG_STATE_TRYING_ATTACH_OR_SEARCHING=2, //not registered, but MT is currently trying to attach or searching an operator to register to
  83. QL_NW_REG_STATE_DENIED=3, //registration denied
  84. QL_NW_REG_STATE_UNKNOWN=4, //unknown
  85. QL_NW_REG_STATE_ROAMING=5, //registered, roaming
  86. }ql_nw_reg_state_e;
  87. typedef enum {
  88. QL_NO_JAMMING = 0,
  89. QL_JAMMED,
  90. } ql_nw_jamdet_state_e;
  91. typedef enum
  92. {
  93. QL_NW_SUCCESS = 0,
  94. QL_NW_EXECUTE_ERR = 1 | (QL_COMPONENT_NETWORK << 16),
  95. QL_NW_MEM_ADDR_NULL_ERR,
  96. QL_NW_INVALID_PARAM_ERR,
  97. QL_NW_CFW_CFUN_GET_ERR,
  98. QL_NW_CFUN_DISABLE_ERR = 5 | (QL_COMPONENT_NETWORK << 16),
  99. QL_NW_CFW_NW_STATUS_GET_ERR,
  100. QL_NW_NOT_SEARCHING_ERR,
  101. QL_NW_NOT_REGISTERED_ERR,
  102. QL_NW_CFW_GPRS_STATUS_GET_ERR,
  103. QL_GPRS_NOT_SEARCHING_ERR = 10 | (QL_COMPONENT_NETWORK << 16),
  104. QL_GPRS_NOT_REGISTERED_ERR,
  105. QL_NW_CFW_NW_QUAL_GET_ERR,
  106. QL_NW_CFW_OPER_ID_GET_ERR,
  107. QL_NW_CFW_OPER_NAME_GET_ERR,
  108. QL_NW_CFW_OPER_SET_ERR = 15 | (QL_COMPONENT_NETWORK << 16),
  109. QL_NW_SIM_ERR,
  110. QL_NW_NO_MEM_ERR,
  111. QL_NW_SEMAPHORE_CREATE_ERR,
  112. QL_NW_SEMAPHORE_TIMEOUT_ERR,
  113. QL_NW_NITZ_NOT_UPDATE_ERR = 20 | (QL_COMPONENT_NETWORK << 16),
  114. QL_NW_CFW_EMOD_START_ERR,
  115. QL_NW_OPERATOR_NOT_ALLOWED,
  116. QL_NW_CFW_RRCRel_SET_ERR,
  117. QL_NW_BLACK_CELL_FULL_ERR,
  118. QL_NW_PLMNFORMAT_CONVERT_UNFOUND,
  119. }ql_nw_errcode_e;
  120. typedef enum
  121. {
  122. QL_NW_TAU_TYPE_COMBINED_TA_LA_UPDATING = 1,
  123. QL_NW_TAU_TYPE_PERIODIC_UPDATING = 3,
  124. QL_NW_TAU_TYPE_DEFAULT = QL_NW_TAU_TYPE_PERIODIC_UPDATING,
  125. } ql_nw_tau_type_e;
  126. typedef enum
  127. {
  128. QUEC_NW_CS_INTERNAL_CAUSE = 0,
  129. QUEC_NW_CS_NETWORK_CAUSE = 1,
  130. QUEC_NW_CS_NETWORK_REJECT = 2, //defined in 3GPP TS 24.008 Table 10.5.147/3GPP TS 24.008: GMM cause information element
  131. QUEC_NW_PS_INTERNAL_CAUSE = 3,
  132. QUEC_NW_PS_NETWORK_CAUSE = 4,
  133. QUEC_NW_PS_LTE_CAUSE = 5, //defined in 3GPP TS 24.301 Table 9.9.4.4.1: ESM cause information element
  134. QUEC_NW_PS_LTE_LOCAL_CAUSE = 6, //defined in 3GPP TS 24.301 Table 9.9.3.9.1: EMM cause information element
  135. QUEC_NW_PS_GPRS_CAUSE = 7, //defined in 3GPP TS 24.008 Table 10.5.157/3GPP TS 24.008: SM cause information element
  136. QUEC_NW_CAUSE_MAX,
  137. }ql_nw_cause_type_e;
  138. //defined in 3GPP TS 24.301 Table 9.9.3.9.1: EMM cause information element
  139. typedef enum
  140. {
  141. QUEC_EMM_CAUSE_IMSI_UNKOWN_IN_HSS = 0x02,//0 0 0 0 0 0 1 0
  142. QUEC_EMM_CAUSE_ILLEGAL_UE = 0x03,//0 0 0 0 0 0 1 1
  143. QUEC_EMM_CAUSE_IMEI_NOT_ACCEPTED = 0x05,//0 0 0 0 0 1 0 1
  144. QUEC_EMM_CAUSE_ILLEGAL_ME = 0x06,//0 0 0 0 0 1 1 0
  145. QUEC_EMM_CAUSE_EPS_SERVICES_NOT_ALLOWED = 0x07,//0 0 0 0 0 1 1 1
  146. QUEC_EMM_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x08,//0 0 0 0 1 0 0 0
  147. QUEC_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x09,//0 0 0 0 1 0 0 1
  148. QUEC_EMM_CAUSE_IMPLICITLY_DETACHED = 0x0a,//0 0 0 0 1 0 1 0
  149. QUEC_EMM_CAUSE_PLMN_NOT_ALLOWED = 0x0b,//0 0 0 0 1 0 1 0
  150. QUEC_EMM_CAUSE_TRACKING_AREA_NOT_ALLOWED = 0x0c,//0 0 0 0 1 1 0 0
  151. QUEC_EMM_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_PLMN = 0x0d,//0 0 0 0 1 1 0 1
  152. QUEC_EMM_CAUSE_EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x0e,//0 0 0 0 1 1 1 0
  153. QUEC_EMM_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA = 0x0f,//0 0 0 0 1 1 1 1
  154. QUEC_EMM_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE = 0x10,//0 0 0 1 0 0 0 0
  155. QUEC_EMM_CAUSE_NETWORK_FAILURE = 0x11,//0 0 0 1 0 0 0 1
  156. QUEC_EMM_CAUSE_CS_DOMAIN_NOT_AVAILABLE = 0x12,//0 0 0 1 0 0 1 0
  157. QUEC_EMM_CAUSE_ESM_FAILURE = 0x13,//0 0 0 1 0 0 1 1
  158. QUEC_EMM_CAUSE_MAC_FAILURE = 0x14,//0 0 0 1 0 1 0 0
  159. QUEC_EMM_CAUSE_SYNCH_FAILURE = 0x15,//0 0 0 1 0 1 0 1
  160. QUEC_EMM_CAUSE_CONGESTION = 0x16,//0 0 0 1 0 1 1 0
  161. QUEC_EMM_CAUSE_UE_SECURITY_CAPABILITIES_MISMATCH = 0x17,//0 0 0 1 0 1 1 1
  162. QUEC_EMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED = 0x18,//0 0 0 1 1 0 0 0
  163. QUEC_EMM_CAUSE_NOT_AUTHORIZED_FOR_THIS_CSG = 0x19,//0 0 0 1 1 0 0 1
  164. QUEC_EMM_CAUSE_NON_EPS_AUTHENTICATION_UNACCEPTABLE = 0x1a,//0 0 0 1 1 0 1 0
  165. QUEC_EMM_CAUSE_REDIRECTION_TO_5GCN_REQUIRED = 0x1f,//0 0 0 1 1 1 1 1
  166. QUEC_EMM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_AUTHORIZED_IN_THIS_PLMN = 0x23,//0 0 1 0 0 0 1 1
  167. QUEC_EMM_CAUSE_CS_SERVICE_TEMPORARILY_NOT_AVAILABLE = 0x27,//0 0 1 0 0 1 1 1
  168. QUEC_EMM_CAUSE_NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x28,//0 0 1 0 1 0 0 0
  169. QUEC_EMM_CAUSE_SEVERE_NETWORD_FAILURE = 0x2a,//0 0 1 0 1 0 1 0
  170. QUEC_EMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE = 0x5f,//0 1 0 1 1 1 1 1
  171. QUEC_EMM_CAUSE_INVALID_MANDATORY_INFORMATION = 0x60,//0 1 1 0 0 0 0 0
  172. QUEC_EMM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 0x61,//0 1 1 0 0 0 0 1
  173. QUEC_EMM_CAUSE_MESSAGE_TYPE_NON_COMPATIBLE_WITH_THE_PROTOCOL_STATE = 0x62,//0 1 1 0 0 0 1 1
  174. QUEC_EMM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 0x63,//0 1 1 0 0 0 1 1
  175. QUEC_EMM_CAUSE_CONDITIONAL_IE_ERROR = 0x64,//0 1 1 0 0 1 0 0
  176. QUEC_EMM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE = 0x65,//0 1 1 0 0 1 0 1
  177. QUEC_EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED = 0x6f,//0 1 1 0 1 1 1 1
  178. }quec_ps_lte_local_cause_e;
  179. //defined in 3GPP TS 24.008 Table 10.5.147/3GPP TS 24.008: GMM cause information element
  180. typedef enum
  181. {
  182. QUEC_GMM_CAUSE_IMSI_UNKOWN_IN_HLR = 0x02,//0 0 0 0 0 0 1 0
  183. QUEC_GMM_CAUSE_ILLEGAL_MS = 0x03,//0 0 0 0 0 0 1 1
  184. QUEC_GMM_CAUSE_IMEI_NOT_ACCEPTED = 0x05,//0 0 0 0 0 1 0 1
  185. QUEC_GMM_CAUSE_ILLEGAL_ME = 0x06,//0 0 0 0 0 1 1 0
  186. QUEC_GMM_CAUSE_GPRS_SERVICES_NOT_ALLOWED = 0x07,//0 0 0 0 0 1 1 1
  187. QUEC_GMM_CAUSE_GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x08,//0 0 0 0 1 0 0 0
  188. QUEC_GMM_CAUSE_MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x09,//0 0 0 0 1 0 0 1
  189. QUEC_GMM_CAUSE_IMPLICITLY_DETACHED = 0x0a,//0 0 0 0 1 0 1 0
  190. QUEC_GMM_CAUSE_PLMN_NOT_ALLOWED = 0x0b,//0 0 0 0 1 0 1 1
  191. QUEC_GMM_CAUSE_LOCATION_AREA_NOT_ALLOWED = 0x0c,//0 0 0 0 1 1 0 0
  192. QUEC_GMM_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_PLMN = 0x0d,//0 0 0 0 1 1 0 1
  193. QUEC_GMM_CAUSE_GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0X0e,//0 0 0 0 1 1 1 0
  194. QUEC_GMM_CAUSE_NO_SUITABLE_CELLS_IN_LOCATION_AREA = 0x0f,//0 0 0 0 1 1 1 1
  195. QUEC_GMM_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE = 0x10,//0 0 0 1 0 0 0 0
  196. QUEC_GMM_CAUSE_NETWORK_FAILURE = 0x11,//0 0 0 1 0 0 0 1
  197. QUEC_GMM_CAUSE_MAC_FAILURE = 0x14,//0 0 0 1 0 1 0 0
  198. QUEC_GMM_CAUSE_SYNCH_FAILURE = 0x15,//0 0 0 1 0 1 0 1
  199. QUEC_GMM_CAUSE_CONGESTION = 0x16,//0 0 0 1 0 1 1 0
  200. QUEC_GMM_CAUSE_GSM_AUTHENTICATION_UNACCEPTABLE = 0x17,//0 0 0 1 0 1 1 1
  201. QUEC_GMM_CAUSE_NOT_AUTHORIZED_FOR_THIS_CSG = 0x19,//0 0 0 1 1 0 0 1
  202. QUEC_GMM_CAUSE_SMS_PROVIDED_VIA_GPRS_IN_THIS_ROUTING_AREA = 0x1c,//0 0 0 1 1 1 0 0
  203. QUEC_GMM_CAUSE_NO_PDP_CONTEXT_ACTIVATED = 0x28,//0 0 1 0 1 0 0 0
  204. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_0 = 0x30,//0 0 1 1 0 0 0 0
  205. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_1 = 0x31,//
  206. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_2 = 0x32,//
  207. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_3 = 0x33,//
  208. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_4 = 0x34,//
  209. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_5 = 0x35,//
  210. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_6 = 0x36,//
  211. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_7 = 0x37,//
  212. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_8 = 0x38,//
  213. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_9 = 0x39,//
  214. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_10 = 0x3a,//
  215. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_11 = 0x3b,//
  216. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_12 = 0x3c,//
  217. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_13 = 0x3d,//
  218. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_14 = 0x3e,//
  219. QUEC_GMM_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_15 = 0x3f,//0 0 1 1 1 1 1 1
  220. QUEC_GMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE = 0x5f,//0 1 0 1 1 1 1 1
  221. QUEC_GMM_CAUSE_INVALID_MANDATORY_INFORMATION = 0x60,//0 1 1 0 0 0 0 0
  222. QUEC_GMM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 0x61,//0 1 1 0 0 0 0 1
  223. QUEC_GMM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE = 0x62,//0 1 1 0 0 0 1 0
  224. QUEC_GMM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 0x63,//0 1 1 0 0 0 1 1
  225. QUEC_GMM_CAUSE_CONDITIONAL_IE_ERROR = 0x64,//0 1 1 0 0 1 0 0
  226. QUEC_GMM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE = 0x65,//0 1 1 0 0 1 0 1
  227. QUEC_GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED = 0x6f,//0 1 1 0 1 1 1 1
  228. }quec_cs_network_reject_e;
  229. //defined in 3GPP TS 24.301 Table 9.9.4.4.1: ESM cause information element
  230. typedef enum
  231. {
  232. QUEC_ESM_CAUSE_OPERATOR_DETERMINED_BARRING =0x08,
  233. QUEC_ESM_CAUSE_INSUFFICIENT_RESOURCES =0x1A,
  234. QUEC_ESM_CAUSE_MISSING_OR_UNKNOWN_APN =0x1B,
  235. QUEC_ESM_CAUSE_UNKNOWN_PDN_TYPE =0x1C,
  236. QUEC_ESM_CAUSE_USER_AUTHENTICATION_FAILED =0x1D,
  237. QUEC_ESM_CAUSE_REQUEST_REJECTED_BY_SERVING_GW_OR_PDN_GW =0x1E,
  238. QUEC_ESM_CAUSE_REQUEST_REJECTED_UNSPECIFIED =0x1F,
  239. QUEC_ESM_CAUSE_SERVICE_OPTION_NOT_SUPPORTED =0x20,
  240. QUEC_ESM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED =0x21,
  241. QUEC_ESM_CAUSE_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER =0x22,
  242. QUEC_ESM_CAUSE_PTI_ALREADY_IN_USE =0x23,
  243. QUEC_ESM_CAUSE_REGULAR_DEACTIVATION =0x24,
  244. QUEC_ESM_CAUSE_EPS_QOS_NOT_ACCEPTED =0x25,
  245. QUEC_ESM_CAUSE_NETWORK_FAILURE =0x26,
  246. QUEC_ESM_CAUSE_REACTIVATION_REQUESTED =0x27,
  247. QUEC_ESM_CAUSE_SEMANTIC_ERROR_IN_THE_TFT_OPERATION =0x29,
  248. QUEC_ESM_CAUSE_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION =0x2A,
  249. QUEC_ESM_CAUSE_INVALID_EPS_BEARER_IDENTITY =0x2B,
  250. QUEC_ESM_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTERS =0x2C,
  251. QUEC_ESM_CAUSE_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS =0x2D,
  252. QUEC_ESM_CAUSE_UNUSED =0x2E,
  253. QUEC_ESM_CAUSE_PTI_MISMATCH =0x2F,
  254. QUEC_ESM_CAUSE_LAST_PDN_DISCONNECTION_NOT_ALLOWED =0x31,
  255. QUEC_ESM_CAUSE_PDN_TYPE_IPV4_ONLY_ALLOWED =0x32,
  256. QUEC_ESM_CAUSE_PDN_TYPE_IPV6_ONLY_ALLOWED =0x33,
  257. QUEC_ESM_CAUSE_PDN_TYPE_IPV4V6_ONLY_ALLOWED =0x39,
  258. QUEC_ESM_CAUSE_PDN_TYPE_NON_IP_ONLY_ALLOWED =0x3A,
  259. QUEC_ESM_CAUSE_SINGLE_ADDRESS_BEARERS_ONLY_ALLOWED =0x34,
  260. QUEC_ESM_CAUSE_ESM_INFORMATION_NOT_RECEIVED =0x35,
  261. QUEC_ESM_CAUSE_PDN_CONNECTION_DOES_NOT_EXIST =0x36,
  262. QUEC_ESM_CAUSE_MULTIPLE_PDN_CONNECTIONS_FOR_A_GIVEN_APN_NOT_ALLOWED =0x37,
  263. QUEC_ESM_CAUSE_COLLISION_WITH_NETWORK_INITIATED_REQUEST =0x38,
  264. QUEC_ESM_CAUSE_UNSUPPORTED_QCI_VALUE =0x3B,
  265. QUEC_ESM_CAUSE_BEARER_HANDLING_NOT_SUPPORTED =0x3C,
  266. QUEC_ESM_CAUSE_PDN_TYPE_ETHERNET_ONLY_ALLOWED =0x3D,
  267. QUEC_ESM_CAUSE_MAXIMUM_NUMBER_OF_EPS_BEARERS_REACHED =0x41,
  268. QUEC_ESM_CAUSE_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN_COMBINATION =0x42,
  269. QUEC_ESM_CAUSE_INVALID_PTI_VALUE =0x51,
  270. QUEC_ESM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE =0x5F,
  271. QUEC_ESM_CAUSE_INVALID_MANDATORY_INFORMATION =0x60,
  272. QUEC_ESM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED =0x61,
  273. QUEC_ESM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE =0x62,
  274. QUEC_ESM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED =0x63,
  275. QUEC_ESM_CAUSE_CONDITIONAL_IE_ERROR =0x64,
  276. QUEC_ESM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE =0x65,
  277. QUEC_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED =0x6F,
  278. QUEC_ESM_CAUSE_APN_RESTRICTION_VALUE_INCOMPATIBLE_WITH_ACTIVE_EPS_BEARER_CONTEXT =0x70,
  279. QUEC_ESM_CAUSE_MULTIPLE_ACCESSES_TO_A_PDN_CONNECTION_NOT_ALLOWED =0x71,
  280. }quec_ps_lte_cause_e;
  281. //defined in 3GPP TS 24.008 Table 10.5.157/3GPP TS 24.008: SM cause information element
  282. typedef enum
  283. {
  284. QUEC_SM_OPERATOR_DETERMINED_BARRING =0x08,
  285. QUEC_SM_MBMS_BEARER_CAPABILITIES_INSUFFICIENT_FOR_THE_SERVICE =0x18,
  286. QUEC_SM_LLC_OR_SNDCP_FAILURE_A_GB_MODE_ONLY =0x19,
  287. QUEC_SM_INSUFFICIENT_RESOURCES =0x1A,
  288. QUEC_SM_MISSING_OR_UNKNOWN_APN =0x1B,
  289. QUEC_SM_UNKNOWN_PDP_ADDRESS_OR_PDP_TYPE =0x1C,
  290. QUEC_SM_USER_AUTHENTICATION_FAILED =0x1D,
  291. QUEC_SM_ACTIVATION_REJECTED_BY_GGSN_SERVING_GW_OR_PDN_GW =0x1E,
  292. QUEC_SM_ACTIVATION_REJECTED_UNSPECIFIED =0x1F,
  293. QUEC_SM_SERVICE_OPTION_NOT_SUPPORTED =0x20,
  294. QUEC_SM_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED =0x21,
  295. QUEC_SM_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER =0x22,
  296. QUEC_SM_NSAPI_ALREADY_USED_NOT_SENT =0x23,
  297. QUEC_SM_REGULAR_DEACTIVATION =0x24,
  298. QUEC_SM_QOS_NOT_ACCEPTED =0x25,
  299. QUEC_SM_NETWORK_FAILURE =0x26,
  300. QUEC_SM_REACTIVATION_REQUESTED =0x27,
  301. QUEC_SM_FEATURE_NOT_SUPPORTED =0x28,
  302. QUEC_SM_SEMANTIC_ERROR_IN_THE_TFT_OPERATION =0x29,
  303. QUEC_SM_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION =0x2A,
  304. QUEC_SM_UNKNOWN_PDP_CONTEXT =0x2B,
  305. QUEC_SM_SEMANTIC_ERRORS_IN_PACKET_FILTER_S =0x2C,
  306. QUEC_SM_SYNTACTICAL_ERRORS_IN_PACKET_FILTER_S =0x2D,
  307. QUEC_SM_PDP_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED =0x2E,
  308. QUEC_SM_MULTICAST_GROUP_MEMBERSHIP_TIME_OUT =0x2F,
  309. QUEC_SM_REQUEST_REJECTED_BCM_VIOLATION =0x30,
  310. QUEC_SM_PDP_TYPE_IPV4_ONLY_ALLOWED =0x32,
  311. QUEC_SM_PDP_TYPE_IPV6_ONLY_ALLOWED =0x33,
  312. QUEC_SM_PDP_TYPE_IPV4V6_ONLY_ALLOWED =0x39,
  313. QUEC_SM_PDP_TYPE_NON_IP_ONLY_ALLOWED =0x3A,
  314. QUEC_SM_SINGLE_ADDRESS_BEARERS_ONLY_ALLOWED =0x34,
  315. QUEC_SM_COLLISION_WITH_NETWORK_INITIATED_REQUEST =0x38,
  316. QUEC_SM_BEARER_HANDLING_NOT_SUPPORTED =0x3C,
  317. QUEC_SM_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED =0x41,
  318. QUEC_SM_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN_COMBINATION =0x42,
  319. QUEC_SM_INVALID_TRANSACTION_IDENTIFIER_VALUE =0x51,
  320. QUEC_SM_SEMANTICALLY_INCORRECT_MESSAGE =0x5F,
  321. QUEC_SM_INVALID_MANDATORY_INFORMATION =0x60,
  322. QUEC_SM_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED =0x61,
  323. QUEC_SM_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE =0x62,
  324. QUEC_SM_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED =0x63,
  325. QUEC_SM_CONDITIONAL_IE_ERROR =0x64,
  326. QUEC_SM_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE =0x65,
  327. QUEC_SM_PROTOCOL_ERROR_UNSPECIFIED =0x6F,
  328. QUEC_SM_APN_RESTRICTION_VALUE_INCOMPATIBLE_WITH_ACTIVE_PDP_CONTEXT =0x70,
  329. QUEC_SM_MULTIPLE_ACCESSES_TO_A_PDN_CONNECTION_NOT_ALLOWED =0x71,
  330. }quec_ps_gprs_cause_e;
  331. typedef enum
  332. {
  333. QL_EDRX_MODE_DISABLE = 0, //Disable the use of requested PTW and eDRX feature
  334. QL_EDRX_MODE_ENABLE = 1, //Enable the use of requested PTW and eDRX feature
  335. QL_EDRX_MODE_ENABLE_URC = 2,//Enable the use of requested PTW and eDRX, and enable the URC
  336. QL_EDRX_MODE_DISABLE_RESET_PARAM = 3,//Disable the use of eDRX and discard all eDRX parameters or,reset to the default values
  337. }ql_edrx_mode_e;
  338. /*========================================================================
  339. * Type Definition
  340. *========================================================================*/
  341. /*network operator information*/
  342. typedef struct
  343. {
  344. char long_oper_name[QL_NW_LONG_OPER_MAX_LEN+1];
  345. char short_oper_name[QL_NW_SHORT_OPER_MAX_LEN+1];
  346. char mcc[QL_NW_MCC_MAX_LEN+1];
  347. char mnc[QL_NW_MNC_MAX_LEN+1];
  348. }ql_nw_operator_info_s;
  349. typedef struct
  350. {
  351. ql_nw_reg_state_e state; //network register state
  352. int lac; //location area code
  353. int cid; //cell ID
  354. ql_nw_act_type_e act; //access technology
  355. ql_nw_ue_stat_e ue_state; //ue state
  356. }ql_nw_common_reg_status_info_s;
  357. typedef struct
  358. {
  359. ql_nw_common_reg_status_info_s voice_reg; //voice register info
  360. ql_nw_common_reg_status_info_s data_reg; //data register info
  361. }ql_nw_reg_status_info_s;
  362. typedef struct
  363. {
  364. int flag; //Cell type, 0:serving, 1:neighbor
  365. int cid; //Cell ID, (0 indicates that the cellid is not received)
  366. int mcc;
  367. int mnc;
  368. int lac; //Location area code
  369. int arfcn; //Absolute RF channel number
  370. char bsic; //Base station identity code. (0 indicates information is not present)
  371. int rssi; //Receive signal strength, Value range: rxlev-111 for dbm format
  372. char mnc_len;
  373. char RX_dBm; //Received power
  374. }ql_nw_gsm_cell_info_s;
  375. typedef struct
  376. {
  377. int flag; //Cell type, 0:serving, 1:neighbor
  378. int cid; //Cell ID, (0 indicates that the cellid is not received)
  379. int mcc;
  380. int mnc;
  381. int tac; //Tracing area code
  382. int pci; //Physical cell ID
  383. int earfcn; //E-UTRA absolute radio frequency channel number of the cell. RANGE: 0 TO 65535
  384. int rssi; //Receive signal strength, Value range: rsrp-140 for dbm format
  385. char mnc_len;
  386. char RX_dBm; //Received power
  387. }ql_nw_lte_cell_info_s;
  388. typedef struct
  389. {
  390. int gsm_info_valid; //0: GSM cell information is invalid 1: GSM cell information is valid
  391. int gsm_info_num; //GSM cell number
  392. ql_nw_gsm_cell_info_s gsm_info[QL_NW_CELL_MAX_NUM]; //GSM cell information (Serving and neighbor)
  393. int lte_info_valid; //0: LTE cell information is invalid 1: LTE cell information is valid
  394. int lte_info_num; //LTE cell number
  395. ql_nw_lte_cell_info_s lte_info[QL_NW_CELL_MAX_NUM]; //LTE cell information (Serving and neighbor)
  396. }ql_nw_cell_info_s;
  397. typedef struct
  398. {
  399. unsigned char nw_selection_mode; //0 auto select operator 1 manual select operator
  400. char mcc[QL_NW_MCC_MAX_LEN+1]; //String format
  401. char mnc[QL_NW_MNC_MAX_LEN+1]; //String format eg:China Mobile -----> mcc="460" mnc="00"
  402. ql_nw_act_type_e act; //access technology
  403. }ql_nw_seclection_info_s;
  404. typedef struct
  405. {
  406. int rssi; // received signal strength level (return 99 indicates that not known or not detectable)
  407. int bitErrorRate; // channel bit error rate (return 99 indicates that not known or not detectable)
  408. int rsrq; // reference signal received quality (return 255 indicates that not known or not detectable)
  409. int rsrp; // reference signal received power (return 255 indicates that not known or not detectable)
  410. }ql_nw_signal_strength_info_s;
  411. typedef struct
  412. {
  413. char nitz_time[32]; //string format: YY/MM/DD HH:MM:SS '+/-'TZ daylight, 20/09/25 07:40:18 +32 00.
  414. long abs_time; //Numeric format of NITZ time 0 is unavailable
  415. }ql_nw_nitz_time_info_s;
  416. typedef struct
  417. {
  418. uint64_t uplink_pdp_count[PROFILE_IDX_MAX]; //uplink_pdp_count[0-6], pdp 1-7
  419. uint64_t downlink_pdp_count[PROFILE_IDX_MAX]; //downlink_pdp_count[0-6], pdp 1-7
  420. }ql_pdp_data_count_info_s;
  421. typedef struct
  422. {
  423. uint64_t uplink_data_count;
  424. uint64_t downlink_data_count;
  425. ql_pdp_data_count_info_s pdp_data_count;
  426. }ql_nw_data_count_info_s;
  427. typedef struct
  428. {
  429. uint8_t enable; //0:disable; 1:enable
  430. uint32_t time; //punishment duration. 0:permanent; range:0-255
  431. }ql_auto_black_elecfence_cfg_s;
  432. typedef struct
  433. {
  434. ql_nw_cause_type_e causeId;
  435. int causeDetail;
  436. }ql_nw_cause_s;
  437. typedef struct
  438. {
  439. ql_edrx_mode_e mode;//wr.
  440. uint8_t actType; //wr. only support value 4 - E-UTRAN (WB-S1 mode)
  441. uint8_t reqPTW; //wr. range 0-15
  442. uint8_t reqEDRX; //wr. range 0-15
  443. uint8_t nwPTW; //read only. range 0-15
  444. uint8_t nwEDRX; //read only. range 0-15
  445. }ql_edrx_cfg_s;
  446. /*========================================================================
  447. * function Definition
  448. *========================================================================*/
  449. typedef void (*ql_nw_callback)(uint8_t nSim, unsigned int ind_type, void *ctx);
  450. /*****************************************************************
  451. * Function: ql_nw_get_csq
  452. *
  453. * Description: 获取csq信号强度
  454. *
  455. * Parameters:
  456. * nSim [in] SIM卡索引,取值:0-1.
  457. * csq [out] 返回csq信号强度信息,范围(0-31),返回 99 为无效值。
  458. *
  459. * Return:
  460. * 0 成功。
  461. * other 错误码。
  462. *
  463. *****************************************************************/
  464. ql_nw_errcode_e ql_nw_get_csq(uint8_t nSim, unsigned char *csq);
  465. /*****************************************************************
  466. * Function: ql_nw_set_mode
  467. *
  468. * Description: 配置网络制式
  469. *
  470. * Parameters:
  471. * nSim [in] SIM卡索引,取值:0-1.
  472. * nw_mode [in] 需要设置的网络制式,见ql_nw_mode_type_e
  473. *
  474. * Return:
  475. * 0 成功。
  476. * other 错误码。
  477. *
  478. *****************************************************************/
  479. ql_nw_errcode_e ql_nw_set_mode(uint8_t nSim, ql_nw_mode_type_e nw_mode);
  480. /*****************************************************************
  481. * Function: ql_nw_get_mode
  482. *
  483. * Description: 获取当前设置的网络制式
  484. *
  485. * Parameters:
  486. * nSim [in] SIM卡索引,取值:0-1.
  487. * nw_mode [out] 返回设置的网络制式
  488. *
  489. * Return:
  490. * 0 成功。
  491. * other 错误码。
  492. *
  493. *****************************************************************/
  494. ql_nw_errcode_e ql_nw_get_mode(uint8_t nSim, ql_nw_mode_type_e *nw_mode);
  495. /*****************************************************************
  496. * Function: ql_nw_set_cemode
  497. *
  498. * Description: 配置EPS操作模式
  499. *
  500. * Parameters:
  501. * nSim [in] SIM卡索引,取值:0-1.
  502. * cemode [in] 需要设置的EPS操作模式,见ql_nw_cemode_type_e
  503. *
  504. * Return:
  505. * 0 成功。
  506. * other 错误码。
  507. *
  508. *****************************************************************/
  509. ql_nw_errcode_e ql_nw_set_cemode(uint8_t nSim, ql_nw_cemode_type_e cemode);
  510. /*****************************************************************
  511. * Function: ql_nw_get_cemode
  512. *
  513. * Description: 获取当前设置的EPS操作制式
  514. *
  515. * Parameters:
  516. * nSim [in] SIM卡索引,取值:0-1.
  517. * cemode [out] 返回设置的EPS操作模式
  518. *
  519. * Return:
  520. * 0 成功。
  521. * other 错误码。
  522. *
  523. *****************************************************************/
  524. ql_nw_errcode_e ql_nw_get_cemode(uint8_t nSim, ql_nw_cemode_type_e *cemode);
  525. /*****************************************************************
  526. * Function: ql_nw_get_rrc_duration
  527. *
  528. * Description: 获取当前LTE网络RRC释放时间
  529. *
  530. * Parameters:
  531. * nSim [in] SIM卡索引,取值:0-1.
  532. * rrc_duration_value_get [out] 返回LTE网络RRC释放时间,单位ms
  533. *
  534. * Return:
  535. * 0 成功。
  536. * other 错误码。
  537. *
  538. *****************************************************************/
  539. ql_nw_errcode_e ql_nw_get_rrc_duration(uint8_t nSim, uint32_t *rrc_duration_value_get);
  540. /*****************************************************************
  541. * Function: ql_nw_get_drxtm
  542. *
  543. * Description: 获取当前网络DRX时间
  544. *
  545. * Parameters:
  546. * nSim [in] SIM卡索引,取值:0-1.
  547. * drx_timer_value_get [out] 返回网络DRX时间,单位ms
  548. *
  549. * Return:
  550. * 0 成功。
  551. * other 错误码。
  552. *
  553. *****************************************************************/
  554. ql_nw_errcode_e ql_nw_get_drxtm(uint8_t nSim, uint16_t *drx_timer_value_get);
  555. /*****************************************************************
  556. * Function: ql_nw_set_drxtm
  557. *
  558. * Description: 设置当前网络DRX时间
  559. *
  560. * Parameters:
  561. * nSim [in] SIM卡索引,取值:0-1.
  562. * drx_timer_value_set [in] 设置网络DRX时间,只支持0,320,640,1280,2560,其中0表示关闭,单位ms
  563. *
  564. * Return:
  565. * 0 成功。
  566. * other 错误码。
  567. *
  568. *****************************************************************/
  569. ql_nw_errcode_e ql_nw_set_drxtm(uint8_t nSim, uint16_t drx_timer_value_set);
  570. /*****************************************************************
  571. * Function: ql_nw_get_operator_name
  572. *
  573. * Description: 获取当前注网的运营商信息,需要等待注网成功后才可获取到
  574. *
  575. * Parameters:
  576. * nSim [in] SIM卡索引,取值:0-1
  577. * oper_info [out] 获取运营商信息
  578. *
  579. * Return:
  580. * 0 成功。
  581. * other 错误码。
  582. *
  583. *****************************************************************/
  584. ql_nw_errcode_e ql_nw_get_operator_name(uint8_t nSim, ql_nw_operator_info_s *oper_info);
  585. /*****************************************************************
  586. * Function: ql_nw_get_reg_status
  587. *
  588. * Description: 获取当前网络注册信息。
  589. *
  590. * Parameters:
  591. * nSim [in] SIM卡索引,取值:0-1
  592. * reg_info [out] 获取当前网络注册信息
  593. *
  594. * Return:
  595. * 0 成功。
  596. * other 错误码。
  597. *
  598. *****************************************************************/
  599. ql_nw_errcode_e ql_nw_get_reg_status(uint8_t nSim, ql_nw_reg_status_info_s *reg_info);
  600. /*****************************************************************
  601. * Function: ql_nw_set_selection
  602. *
  603. * Description: 设置运营商的选择,同步API,最长等待120秒,取决于网络
  604. *
  605. * Parameters:
  606. * nSim [in] SIM卡索引,取值:0-1
  607. * select_info [in] 选择的运营商信息
  608. *
  609. * Return:
  610. * 0 成功。
  611. * other 错误码。
  612. *
  613. *****************************************************************/
  614. ql_nw_errcode_e ql_nw_set_selection(uint8_t nSim, ql_nw_seclection_info_s *select_info);
  615. /*****************************************************************
  616. * Function: ql_nw_set_selection
  617. *
  618. * Description: 获取选择的运营商信息,需要等待注网成功
  619. *
  620. * Parameters:
  621. * nSim [in] SIM卡索引,取值:0-1
  622. * select_info [out] 获取选择的运营商信息
  623. *
  624. * Return:
  625. * 0 成功。
  626. * other 错误码。
  627. *
  628. *****************************************************************/
  629. ql_nw_errcode_e ql_nw_get_selection(uint8_t nSim, ql_nw_seclection_info_s *select_info);
  630. /*****************************************************************
  631. * Function: ql_nw_get_signal_strength
  632. *
  633. * Description: 获取详细信号强度信息
  634. *
  635. * Parameters:
  636. * nSim [in] SIM卡索引,取值:0-1
  637. * pt_info [out] 获取的详细信号强度信息
  638. *
  639. * Return:
  640. * 0 成功。
  641. * other 错误码。
  642. *
  643. *****************************************************************/
  644. ql_nw_errcode_e ql_nw_get_signal_strength(uint8_t nSim, ql_nw_signal_strength_info_s *pt_info);
  645. /*****************************************************************
  646. * Function: ql_nw_get_nitz_time_info
  647. *
  648. * Description: 获取当前基站时间,此时间只在注网成功的那一刻更新,需要当地网络支持
  649. *
  650. * Parameters:
  651. * nitz_info [out] 返回 modem 从基站获取的时间信息
  652. *
  653. * Return:
  654. * 0 成功。
  655. * other 错误码。
  656. *
  657. *****************************************************************/
  658. ql_nw_errcode_e ql_nw_get_nitz_time_info(ql_nw_nitz_time_info_s *nitz_info);
  659. /*****************************************************************
  660. * Function: ql_nw_get_cell_info
  661. *
  662. * Description: 获取当前服务及邻近小区信息。同步API,最长等待20秒
  663. *
  664. * Parameters:
  665. * nSim [in] SIM卡索引,取值:0-1
  666. * cell_info [out] 返回当前服务及邻近小区信息。
  667. *
  668. * Return:
  669. * 0 成功。
  670. * other 错误码。
  671. *
  672. *****************************************************************/
  673. ql_nw_errcode_e ql_nw_get_cell_info(uint8_t nSim, ql_nw_cell_info_s *cell_info);
  674. /*****************************************************************
  675. * Function: ql_nw_get_cell_info_async
  676. *
  677. * Description: 获取当前服务及邻近小区信息。异步API,查询的信息通过
  678. QUEC_NW_CELL_INFO_IND事件返回。
  679. *
  680. * Parameters:
  681. * nSim [in] SIM卡索引,取值:0-1
  682. *
  683. * Return:
  684. * 0 成功。
  685. * other 错误码。
  686. *
  687. *****************************************************************/
  688. ql_nw_errcode_e ql_nw_get_cell_info_async(uint8_t nSim);
  689. /*****************************************************************
  690. * Function: ql_nw_register_cb
  691. *
  692. * Description: 注册事件回调函数
  693. *
  694. * Parameters:
  695. * nw_cb [in] 事件回调函数。
  696. *
  697. * Return:
  698. * 0 成功。
  699. * other 错误码。
  700. *
  701. *****************************************************************/
  702. ql_nw_errcode_e ql_nw_register_cb(ql_nw_callback nw_cb);
  703. /*****************************************************************
  704. * Function: ql_nw_set_jamdet_mode
  705. *
  706. * Description: enable or disable jamming detection function
  707. *
  708. * Parameters:
  709. * nSim [in] sim index,range: 0-1
  710. * enable [in] 0: disable 1:enable
  711. *
  712. * Return:
  713. * 0 success
  714. * other error code
  715. *
  716. *****************************************************************/
  717. ql_nw_errcode_e ql_nw_set_jamdet_mode(uint8_t nSim, uint8_t enable);
  718. /*****************************************************************
  719. * Function: ql_nw_get_jamdet_mode
  720. *
  721. * Description: whether the jamming detection function is enabled or not
  722. *
  723. * Parameters:
  724. * nSim [in] sim index,range: 0-1
  725. * enable [out] 0: disabled 1:enabled
  726. *
  727. * Return:
  728. * 0 success
  729. * other error code
  730. *
  731. *****************************************************************/
  732. ql_nw_errcode_e ql_nw_get_jamdet_mode(uint8_t nSim, uint8_t *enable);
  733. /*****************************************************************
  734. * Function: ql_nw_get_jamdet_status
  735. *
  736. * Description: get jamming detection status
  737. *
  738. * Parameters:
  739. * nSim [in] sim index,range: 0-1
  740. * enable [out] 0: no jamming 1:jammed
  741. *
  742. * Return:
  743. * 0 success
  744. * other error code
  745. *
  746. *****************************************************************/
  747. ql_nw_errcode_e ql_nw_get_jamdet_status(uint8_t nSim, ql_nw_jamdet_state_e *status);
  748. /*****************************************************************
  749. * Function: ql_nw_get_data_count
  750. *
  751. * Description: get uplink and downlink data count
  752. *
  753. * Parameters:
  754. * nSim [in] sim index,range: 0-1
  755. * data_info [out] data count
  756. *
  757. * Return:
  758. * 0 success
  759. * other error code
  760. *
  761. *****************************************************************/
  762. ql_nw_errcode_e ql_nw_get_data_count(uint8_t nSim, ql_nw_data_count_info_s * data_info);
  763. /*****************************************************************
  764. * Function: ql_nw_reset_data_count
  765. *
  766. * Description: reset uplink and downlink data count
  767. *
  768. * Parameters:
  769. * nSim [in] sim index,range: 0-1
  770. *
  771. * Return:
  772. * 0 success
  773. * other error code
  774. *
  775. *****************************************************************/
  776. ql_nw_errcode_e ql_nw_reset_data_count(uint8_t nSim);
  777. /*****************************************************************
  778. * Function: ql_nw_set_auto_black_elec_fence
  779. *
  780. * Description: Enable/Disable automatic black electronic fence
  781. *
  782. * Parameters:
  783. * nSim [in] sim index,range: 0-1
  784. * cfg [in] config of automatic black electronic fence
  785. *
  786. * Return:
  787. * 0 success
  788. * other error code
  789. *
  790. *****************************************************************/
  791. ql_nw_errcode_e ql_nw_set_auto_black_elec_fence(uint8_t nSim, ql_auto_black_elecfence_cfg_s *cfg);
  792. /*****************************************************************
  793. * Function: ql_nw_get_auto_black_elec_fence
  794. *
  795. * Description: Get the parameters of automatic black electronic fence
  796. *
  797. * Parameters:
  798. * nSim [in] sim index,range: 0-1
  799. * cfg [out] config of automatic black electronic fence
  800. *
  801. * Return:
  802. * 0 success
  803. * other error code
  804. *
  805. *****************************************************************/
  806. ql_nw_errcode_e ql_nw_get_auto_black_elec_fence(uint8_t nSim, ql_auto_black_elecfence_cfg_s *cfg);
  807. /*****************************************************************
  808. * Function: ql_nw_get_cell_sinr
  809. *
  810. * Description: get cell sinr
  811. *
  812. * Parameters:
  813. * nSim [in] sim index,range: 0-1
  814. * sinr_ptr [out] sinr
  815. *
  816. * Return:
  817. * 0 success
  818. * other error code
  819. *
  820. *****************************************************************/
  821. ql_nw_errcode_e ql_nw_get_cell_sinr(uint8_t nSim, int *sinr_ptr);
  822. /*****************************************************************
  823. * Function: ql_nw_set_tau_type_aft_local_rel
  824. *
  825. * Description: set TAU type after local RRC release
  826. *
  827. * Parameters:
  828. * nSim [in] sim index,range: 0-1
  829. * type [in] TAU type
  830. *
  831. * Return:
  832. * 0 success
  833. * other error code
  834. *
  835. *****************************************************************/
  836. ql_nw_errcode_e ql_nw_set_tau_type_aft_local_rel(uint8_t nSim,ql_nw_tau_type_e type);
  837. /*****************************************************************
  838. * Function: ql_nw_get_tau_type_aft_local_rel
  839. *
  840. * Description: get TAU type after local RRC release
  841. *
  842. * Parameters:
  843. * nSim [in] sim index,range: 0-1
  844. * type [out] TAU type
  845. *
  846. * Return:
  847. * 0 success
  848. * other error code
  849. *
  850. *****************************************************************/
  851. ql_nw_errcode_e ql_nw_get_tau_type_aft_local_rel(uint8_t nSim,ql_nw_tau_type_e *type);
  852. /*****************************************************************
  853. * Function: ql_nw_get_emm_gmm_cause
  854. *
  855. * Description: get the latest EMM/GMM reject cause by network after attach procedure
  856. *
  857. * Parameters:
  858. * ctx [out] context of EMM/GMM cause
  859. *
  860. * Return:
  861. * 0 success
  862. * other error code
  863. *
  864. *****************************************************************/
  865. ql_nw_errcode_e ql_nw_get_emm_gmm_cause(ql_nw_cause_s *ctx);
  866. /*****************************************************************
  867. * Function: ql_nw_get_esm_sm_cause
  868. *
  869. * Description: get the latest ESM/SM reject cause by network after PDN connectivity procedure
  870. *
  871. * Parameters:
  872. * ctx [out] context of ESM/SM cause
  873. *
  874. * Return:
  875. * 0 success
  876. * other error code
  877. *
  878. *****************************************************************/
  879. ql_nw_errcode_e ql_nw_get_esm_sm_cause(ql_nw_cause_s *ctx);
  880. /*****************************************************************
  881. * Function: ql_nw_set_esmfail_times
  882. *
  883. * Description: Set the times on LTE when reject by network with ESM FAILURE cause.
  884. * For the module that supports 2G/3G, when the maximum number of times reaches,
  885. the module will seek the 2G/3G network for registration.
  886. When the number of times is 0, the module will not go to 2G/3G to find the network.
  887. * Parameters:
  888. * nSim [in] sim index,range: 0-1
  889. * times [in] times, range:0-5
  890. *
  891. * Return:
  892. * 0 success
  893. * other error code
  894. *
  895. *****************************************************************/
  896. ql_nw_errcode_e ql_nw_set_esmfail_times(uint8_t nSim, uint8_t times);
  897. /*****************************************************************
  898. * Function: ql_nw_get_esmfail_times
  899. *
  900. * Description: Get the times on LTE when reject by network with ESM FAILURE cause
  901. *
  902. * Parameters:
  903. * nSim [in] sim index,range: 0-1
  904. * times [out] times
  905. *
  906. * Return:
  907. * 0 success
  908. * other error code
  909. *
  910. *****************************************************************/
  911. ql_nw_errcode_e ql_nw_get_esmfail_times(uint8_t nSim, uint8_t *times);
  912. /*****************************************************************
  913. * Function: ql_nw_set_edrx
  914. *
  915. * Description: Set the eDRX configuration.
  916. *
  917. * Parameters:
  918. * nSim [in] sim index,range: 0-1
  919. * edrx_cfg [in] eDRC configuration
  920. *
  921. * Return:
  922. * 0 success
  923. * other error code
  924. *
  925. *****************************************************************/
  926. ql_nw_errcode_e ql_nw_set_edrx(uint8_t nSim, ql_edrx_cfg_s *edrx_cfg);
  927. /*****************************************************************
  928. * Function: ql_nw_get_edrx
  929. *
  930. * Description: Get the eDRX configuration.
  931. *
  932. * Parameters:
  933. * nSim [in] sim index,range: 0-1
  934. * edrx_cfg [in] eDRC configuration
  935. *
  936. * Return:
  937. * 0 success
  938. * other error code
  939. *
  940. *****************************************************************/
  941. ql_nw_errcode_e ql_nw_get_edrx(uint8_t nSim, ql_edrx_cfg_s *edrx_cfg);
  942. #ifdef __cplusplus
  943. }/*"C" */
  944. #endif
  945. #endif /*QL_API_NW_H*/