blob: 462e2b9d62539865e0e7a29471c7e640772fd8bb [file] [log] [blame]
liubin281ac462023-07-19 14:22:54 +08001#ifndef MBTK_INFO_INCLUDE
2#define MBTK_INFO_INCLUDE
3#include <netinet/in.h>
4
5#include "mbtk_type.h"
6#include "mbtk_list.h"
7#include "mbtk_log.h"
8#include "mbtk_utils.h"
9#include "mbtk_info_api.h"
10
11#define MBTK_INFO_PACKET_FLAG 0x5F6F7F8F
12#define SOCK_INFO_PATH "/tmp/info_sock"
13#define SOCK_MSG_LEN_MAX 2048
14
15// Tag(4) + Packet_Length(2)
16#define SOCK_PACK_EXTRA_LEN 6
17// SOCK_PACK_EXTRA_LEN + Id(2) + Error(2) + Number(2)
18#define SOCK_PACK_LEN_MIN (SOCK_PACK_EXTRA_LEN + 6)
19
20typedef enum
21{
22 MBTK_INFO_TYPE_REQ,
23 MBTK_INFO_TYPE_RSP,
24 MBTK_INFO_TYPE_IND,
25 MBTK_INFO_TYPE_UNKNOWN
26} mbtk_info_type_enum;
27
28typedef enum
29{
30 // Device Information
31 MBTK_INFO_ID_DEV_BEGIN = 0,
32 // <string> IMEI
33 MBTK_INFO_ID_DEV_IMEI_REQ,
34 MBTK_INFO_ID_DEV_IMEI_RSP,
35 // <string> SN
36 MBTK_INFO_ID_DEV_SN_REQ,
37 MBTK_INFO_ID_DEV_SN_RSP,
38 // <string> MEID
39 MBTK_INFO_ID_DEV_MEID_REQ,
40 MBTK_INFO_ID_DEV_MEID_RSP,
41 // <string> VERSION
42 MBTK_INFO_ID_DEV_VERSION_REQ,
43 MBTK_INFO_ID_DEV_VERSION_RSP,
44 // <string> MODEL
45 MBTK_INFO_ID_DEV_MODEL_REQ,
46 MBTK_INFO_ID_DEV_MODEL_RSP,
47 // <uint8> 0:Close 1:Open
48 MBTK_INFO_ID_DEV_VOLTE_REQ,
49 MBTK_INFO_ID_DEV_VOLTE_RSP,
50 // <string> Temperature
51 MBTK_INFO_ID_DEV_TEMP_REQ, // Temperature
52 MBTK_INFO_ID_DEV_TEMP_RSP,
53 // <uint8><string> YYYY-MM-DD-HH:MM:SS
54 MBTK_INFO_ID_DEV_TIME_REQ, // Time
55 MBTK_INFO_ID_DEV_TIME_RSP,
56 //<string> "23/03/20,01:58:00+32"
b.liubaa41e12024-07-19 15:07:24 +080057 MBTK_INFO_ID_DEV_CELL_TIME_REQ, // Time
58 MBTK_INFO_ID_DEV_CELL_TIME_RSP,
liubin281ac462023-07-19 14:22:54 +080059
60 MBTK_INFO_ID_DEV_MODEM_REQ,
61 MBTK_INFO_ID_DEV_MODEM_RSP,
b.liu76e353a2024-11-01 14:49:31 +080062
l.yang5b0ff422024-10-29 19:33:35 -070063 MBTK_INFO_ID_DEV_MD_VERSION_REQ,
64 MBTK_INFO_ID_DEV_MD_VERSION_RSP,
b.liu76e353a2024-11-01 14:49:31 +080065
liubin281ac462023-07-19 14:22:54 +080066 MBTK_INFO_ID_DEV_END,
67
68 // Sim Information
69 MBTK_INFO_ID_SIM_BEGIN = 1000,
70 // <uint8> 0:NOT_EXIST 1:READY ...
71 MBTK_INFO_ID_SIM_STATE_REQ,
72 MBTK_INFO_ID_SIM_STATE_RSP,
73 // <uint8> 0: SIM 1: USIM 2: TEST SIM 3: TEST USIM 4: UNKNOWN
74 MBTK_INFO_ID_SIM_STYPE_REQ,
75 MBTK_INFO_ID_SIM_STYPE_RSP,
76 // <string> PIN
77 MBTK_INFO_ID_SIM_PIN_REQ,
78 MBTK_INFO_ID_SIM_PIN_RSP,
79 // <string> PIN
80 MBTK_INFO_ID_SIM_ENABLE_PIN_REQ,
81 MBTK_INFO_ID_SIM_ENABLE_PIN_RSP,
82 // <string> PUK
83 MBTK_INFO_ID_SIM_PUK_REQ,
84 MBTK_INFO_ID_SIM_PUK_RSP,
85 // <string> PLMN
86 MBTK_INFO_ID_SIM_PLMN_REQ,
87 MBTK_INFO_ID_SIM_PLMN_RSP,
88 // <uint8> <uint8> <uint8> <uint8> PIN PUK LAST TIMES
89 MBTK_INFO_ID_SIM_PINPUK_TIMES_REQ,
90 MBTK_INFO_ID_SIM_PINPUK_TIMES_RSP,
91 // <string> IMSI
92 MBTK_INFO_ID_SIM_IMSI_REQ,
93 MBTK_INFO_ID_SIM_IMSI_RSP,
94 // <string> ICCID
95 MBTK_INFO_ID_SIM_ICCID_REQ,
96 MBTK_INFO_ID_SIM_ICCID_RSP,
97 // <string> Phone Number
98 MBTK_INFO_ID_SIM_PN_REQ,
99 MBTK_INFO_ID_SIM_PN_RSP,
100 // <string> <string> old_PIN new_PIN
101 MBTK_INFO_ID_SIM_CHANGE_PIN_REQ,
102 MBTK_INFO_ID_SIM_CHANGE_PIN_RSP,
103
104 MBTK_INFO_ID_SIM_END,
105
106 // Network Information
107 MBTK_INFO_ID_NET_BEGIN = 2000,
108 // <uint8> 0:OFF 1:ON
109 MBTK_INFO_ID_NET_RADIO_REQ,
110 MBTK_INFO_ID_NET_RADIO_RSP,
111 // sel_mode(uint8)type(uint8)plmn(uint32)...sel_mode(uint8)type(uint8)plmn(uint32)
112 MBTK_INFO_ID_NET_AVAILABLE_REQ,
113 MBTK_INFO_ID_NET_AVAILABLE_RSP,
114 // <uint8> 0: automatic 1: manual
115 // or
116 // sel_mode(uint8)type(uint8)plmn(uint32)
117 MBTK_INFO_ID_NET_SEL_MODE_REQ,
118 MBTK_INFO_ID_NET_SEL_MODE_RSP,
119 // mbtk_band_info_t
120 MBTK_INFO_ID_NET_BAND_REQ,
121 MBTK_INFO_ID_NET_BAND_RSP,
122 // mbtk_signal_info_t
123 MBTK_INFO_ID_NET_SIGNAL_REQ,
124 MBTK_INFO_ID_NET_SIGNAL_RSP,
125 // mbtk_net_reg_info_t
126 MBTK_INFO_ID_NET_REG_REQ,
127 MBTK_INFO_ID_NET_REG_RSP,
128 // mbtk_apn_info_t
129 MBTK_INFO_ID_NET_APN_REQ,
130 MBTK_INFO_ID_NET_APN_RSP,
wangyouqiang80487e42024-05-24 15:06:20 +0800131 // mbtk_qser_apn_info_t
132 MBTK_INFO_ID_NET_QSER_APN_REQ,
133 MBTK_INFO_ID_NET_QSER_APN_RSP,
liuyang0e49d9a2024-04-23 21:04:54 +0800134 // mbtk_apn_del
135 MBTK_INFO_ID_NET_APN_DEL_REQ,
136 MBTK_INFO_ID_NET_APN_DEL_RSP,
liubin281ac462023-07-19 14:22:54 +0800137 // mbtk_cell_info_t[]
138 MBTK_INFO_ID_NET_CELL_REQ,
139 MBTK_INFO_ID_NET_CELL_RSP,
140 // REQ:
141 // <call_type[1]><cid[1]><timeout[1]>
142 // call_type : mbtk_data_call_type_enum
143 // cid : 1 - 15
144 // timeout : second
145 // RSP:
146 // <type[1]><ipv4><ipv6>
147 // type : 0-IPV4 1-IPV6 2-IPV4V6
148 // ipv4 : mbtk_ipv4_info_t
149 // ipv6 : mbtk_ipv6_info_t
150 MBTK_INFO_ID_NET_DATA_CALL_REQ,
151 MBTK_INFO_ID_NET_DATA_CALL_RSP,
152
r.xiao06db9a12024-04-14 18:51:15 -0700153 // mbtk_net_ims
154 MBTK_INFO_ID_NET_IMS_REQ,
155 MBTK_INFO_ID_NET_IMS_RSP,
b.liu288093c2024-05-09 17:02:57 +0800156
b.liufdf03172024-06-07 15:01:29 +0800157 MBTK_INFO_ID_NET_IMS_REG_STATE_REQ,
158 MBTK_INFO_ID_NET_IMS_REG_STATE_RSP,
159
r.xiao06db9a12024-04-14 18:51:15 -0700160
liubin281ac462023-07-19 14:22:54 +0800161 MBTK_INFO_ID_NET_END,
162
r.xiao06db9a12024-04-14 18:51:15 -0700163
liubin281ac462023-07-19 14:22:54 +0800164 // Call Information
165 MBTK_INFO_ID_CALL_BEGIN = 3000,
166 MBTK_INFO_ID_CALL_STATE_REQ,
167 MBTK_INFO_ID_CALL_STATE_RSP,
168
169 // Start call.
170 MBTK_INFO_ID_CALL_START_REQ,
171 MBTK_INFO_ID_CALL_START_RSP,
172 //answer call
173 MBTK_INFO_ID_CALL_ANSWER_REQ,
174 MBTK_INFO_ID_CALL_ANSWER_RSP,
175 //hang up all call
176 MBTK_INFO_ID_CALL_HANGUP_REQ,
177 MBTK_INFO_ID_CALL_HANGUP_RSP,
178 //hang up a call
179 MBTK_INFO_ID_CALL_HANGUP_A_REQ,
180 MBTK_INFO_ID_CALL_HANGUP_A_RSP,
181 //hang up waiting or background call
182 MBTK_INFO_ID_CALL_HANGUP_B_REQ,
183 MBTK_INFO_ID_CALL_HANGUP_B_RSP,
184 //hang up foreground resume background
185 MBTK_INFO_ID_CALL_HANGUP_C_REQ,
186 MBTK_INFO_ID_CALL_HANGUP_C_RSP,
187 //wait in call
188 MBTK_INFO_ID_CALL_WAITIN_REQ,
189 MBTK_INFO_ID_CALL_WAITIN_RSP,
190 //mute call
191 MBTK_INFO_ID_CALL_MUTE_REQ,
192 MBTK_INFO_ID_CALL_MUTE_RSP,
193 //dtmf call
194 MBTK_INFO_ID_CALL_DTMF_REQ,
195 MBTK_INFO_ID_CALL_DTMF_RSP,
196
197 MBTK_INFO_ID_CALL_END,
198
199 // SMS Information
200 MBTK_INFO_ID_SMS_BEGIN = 4000,
201 MBTK_INFO_ID_SMS_STATE_REQ,
202 MBTK_INFO_ID_SMS_STATE_RSP,
203 MBTK_INFO_ID_SMS_CMGF_REQ,
204 MBTK_INFO_ID_SMS_CMGF_RSP,
205 MBTK_INFO_ID_SMS_CPMS_REQ,
206 MBTK_INFO_ID_SMS_CPMS_RSP,
207 MBTK_INFO_ID_SMS_CMGS_REQ,
208 MBTK_INFO_ID_SMS_CMGS_RSP,
209 MBTK_INFO_ID_SMS_CMSS_REQ,
210 MBTK_INFO_ID_SMS_CMSS_RSP,
211 MBTK_INFO_ID_SMS_CMGR_REQ,
212 MBTK_INFO_ID_SMS_CMGR_RSP,
213 MBTK_INFO_ID_SMS_CMGW_REQ,
214 MBTK_INFO_ID_SMS_CMGW_RSP,
215 MBTK_INFO_ID_SMS_CMGD_REQ,
216 MBTK_INFO_ID_SMS_CMGD_RSP,
217 MBTK_INFO_ID_SMS_CMGL_REQ,
218 MBTK_INFO_ID_SMS_CMGL_RSP,
219 MBTK_INFO_ID_SMS_CSCA_REQ,
220 MBTK_INFO_ID_SMS_CSCA_RSP,
221 MBTK_INFO_ID_SMS_CSMP_REQ,
222 MBTK_INFO_ID_SMS_CSMP_RSP,
223 MBTK_INFO_ID_SMS_CSCB_REQ,
224 MBTK_INFO_ID_SMS_CSCB_RSP,
225 MBTK_INFO_ID_SMS_CNMI_REQ,
226 MBTK_INFO_ID_SMS_CNMI_RSP,
227
228 MBTK_INFO_ID_SMS_END,
229
230 // PhoneBook Information
231 MBTK_INFO_ID_PB_BEGIN = 5000,
232 MBTK_INFO_ID_PB_STATE_REQ,
233 MBTK_INFO_ID_PB_STATE_RSP,
234
235 MBTK_INFO_ID_PB_END,
236
r.xiaocfd7c682024-01-22 03:59:46 -0800237 //wakeup
238 MBTK_INFO_ID_WAKEUP_STA_BEGIN = 6000,
r.xiaoec113d12024-01-12 02:13:28 -0800239 MBTK_INFO_ID_WAKEUP_STA_REQ,
240 MBTK_INFO_ID_WAKEUP_STA_RSP,
241
r.xiaocfd7c682024-01-22 03:59:46 -0800242 MBTK_INFO_ID_WAKEUP_STA_END,
243
r.xiaoec113d12024-01-12 02:13:28 -0800244 //oos(out of service))
r.xiaocfd7c682024-01-22 03:59:46 -0800245 MBTK_INFO_ID_OOS_STA_BEGIN = 7000,
r.xiaoec113d12024-01-12 02:13:28 -0800246 MBTK_INFO_ID_OOS_STA_REQ,
247 MBTK_INFO_ID_OOS_STA_RSP,
248
r.xiaocfd7c682024-01-22 03:59:46 -0800249 MBTK_INFO_ID_OOS_STA_END,
b.liu288093c2024-05-09 17:02:57 +0800250
wangyouqiang38e53362024-01-23 10:53:48 +0800251 //led
252 MBTK_INFO_ID_LED_BEGIN = 8000,
253 MBTK_INFO_ID_LED_REQ,
254 MBTK_INFO_ID_LED_RSP,
255 MBTK_INFO_ID_LED_END,
r.xiaoec113d12024-01-12 02:13:28 -0800256
b.liu06559f62024-11-01 18:48:22 +0800257 // Ecall
258 RIL_MSG_ID_ECALL_BEGIN = 9000,
259 // mbtk_ecall_msd_cfg_info_t
260 RIL_MSG_ID_ECALL_MSDCFG_REQ,
261 RIL_MSG_ID_ECALL_MSDCFG_RSP,
262 // NULL
263 RIL_MSG_ID_ECALL_MSDGEN_REQ,
264 RIL_MSG_ID_ECALL_MSDGEN_RSP,
265 // uint8[]
266 RIL_MSG_ID_ECALL_MSD_REQ,
267 RIL_MSG_ID_ECALL_MSD_RSP,
268 // NULL
269 RIL_MSG_ID_ECALL_PUSH_REQ,
270 RIL_MSG_ID_ECALL_PUSH_RSP,
271 // mbtk_ecall_only_info_t
272 RIL_MSG_ID_ECALL_ONLY_REQ,
273 RIL_MSG_ID_ECALL_ONLY_RSP,
274 // reg <uint8>
275 RIL_MSG_ID_ECALL_REG_REQ,
276 RIL_MSG_ID_ECALL_REG_RSP,
277 // mbtk_ecall_dial_type_enum
278 RIL_MSG_ID_ECALL_DIAL_REQ,
279 RIL_MSG_ID_ECALL_DIAL_RSP,
280 // mbtk_ecall_mode_type_enum
281 RIL_MSG_ID_ECALL_MODE_REQ,
282 RIL_MSG_ID_ECALL_MODE_RSP,
283 // mbtk_ecall_cfg_item_enum / mbtk_ecall_cfg_info_t
284 RIL_MSG_ID_ECALL_CFG_REQ,
285 RIL_MSG_ID_ECALL_CFG_RSP,
286 // uint8[]
287 RIL_MSG_ID_ECALL_SMS_NUM_REQ,
288 RIL_MSG_ID_ECALL_SMS_NUM_RSP,
289 // uint8
290 RIL_MSG_ID_ECALL_MUTESPK_REQ,
291 RIL_MSG_ID_ECALL_MUTESPK_RSP,
292 // mbtk_ecall_gain_info_t
293 RIL_MSG_ID_ECALL_DSP_GAIN_REQ,
294 RIL_MSG_ID_ECALL_DSP_GAIN_RSP,
295
296 RIL_MSG_ID_ECALL_END,
297
liubin281ac462023-07-19 14:22:54 +0800298 // IND Information
299 MBTK_INFO_ID_IND_BEGIN = 10000,
300 // <uint8> State
301 MBTK_INFO_ID_IND_NET_STATE_CHANGE,
302 // <uint8> State
303 MBTK_INFO_ID_IND_CALL_STATE_CHANGE,
304 // <uint8> State
305 MBTK_INFO_ID_IND_SMS_STATE_CHANGE,
306 // <uint8> State
307 MBTK_INFO_ID_IND_RADIO_STATE_CHANGE,
308 // <uint8> State
309 MBTK_INFO_ID_IND_SIM_STATE_CHANGE,
310 // <uint8> State
311 MBTK_INFO_ID_IND_PDP_STATE_CHANGE,
312 // <uint8> State
313 MBTK_INFO_ID_IND_SERVER_STATE_CHANGE,////mbtk wyq for server_ready_status add
r.xiaofca7c472024-04-24 01:00:23 -0700314 // <uint8> State
315 MBTK_INFO_ID_IND_SIGNAL_STATE_CHANGE,
b.liu76e353a2024-11-01 14:49:31 +0800316 //
317 MBTK_INFO_ID_IND_ECALL_STATE_CHANGE,
liubin281ac462023-07-19 14:22:54 +0800318
319 MBTK_INFO_ID_IND_END,
320 MBTK_INFO_ID_REQ_UNKNOWN // Unknown information.
321} mbtk_info_id_enum;
322
323typedef enum {
324 MBTK_NET_CS_STATE = 0,
325 MBTK_NET_PS_STATE
326} mbtk_net_state_type_enum;
327
328typedef enum {
329 MBTK_INFO_ERR_SUCCESS = 300,
330 MBTK_INFO_ERR_FORMAT, // Packet format error.
331 MBTK_INFO_ERR_REQ_UNKNOWN, // Unknown request.
332 MBTK_INFO_ERR_REQ_PARAMETER, // Request parameter error.
333 MBTK_INFO_ERR_UNSUPPORTED, // Unsupported operation.
334 MBTK_INFO_ERR_MEMORY, // Insufficient memory.
335 MBTK_INFO_ERR_IND_FULL, // Register IND fail(FULL).
336 MBTK_INFO_ERR_IND_UNKNOWN, // Register IND fail(Unknown IND).
337 MBTK_INFO_ERR_CID, // CID error.
338 MBTK_INFO_ERR_TIMEOUT, // Timeout.
339 MBTK_INFO_ERR_TIME_FORMAT, // Time format error.
b.liu288093c2024-05-09 17:02:57 +0800340
liubin281ac462023-07-19 14:22:54 +0800341 //mbtk wyq for data_call add start
342 MBTK_INFO_ERR_CID_EXIST,
343 MBTK_INFO_ERR_CID_NO_EXIST,
344 MBTK_INFO_ERR_NET_NO_INIT,
345 //mbtk wyq for data_call add end
346
347 MBTK_INFO_ERR_UNKNOWN = 400, // Unknown error.
348 // CME error start index.
349 MBTK_INFO_ERR_CME = 500,
350 MBTK_INFO_ERR_CME_NON = 1000
351} mbtk_info_err_enum;
352
353/*
354GSM band��
355 1 �C PGSM 900 (standard or primary)
356 2 �C DCS GSM 1800
357 4 �C PCS GSM 1900
358 8 �C EGSM 900 (extended)
359 16 �C GSM 450
360 32 �C GSM 480
361 64 �C GSM 850
362 512 - BAND_LOCK_BIT // used for GSM band setting
363*/
364typedef enum
365{
366 MBTK_GSM_BAND_PGSM_900 = 1,
367 MBTK_GSM_BAND_DCS_GSM_1800 = 2,
368 MBTK_GSM_BAND_PCS_GSM_1900 = 4,
369 MBTK_GSM_BAND_EGSM_900 = 8,
370 MBTK_GSM_BAND_GSM_450 = 16,
371 MBTK_GSM_BAND_GSM_480 = 32,
372 MBTK_GSM_BAND_GSM_850 = 64,
373 MBTK_GSM_BAND_BAND_LOCK_BIT = 512
374} mbtk_gsm_band_enum;
375
376/*
377UMTS band��
378 1 �C UMTS_BAND_1
379 2 �C UMTS_BAND_2
380 4 �C UMTS_BAND_3
381 8 �C UMTS_BAND_4
382 16 �C UMTS_BAND_5
383 32 �C UMTS_BAND_6
384 64 �C UMTS_BAND_7
385 128 �C UMTS_BAND_8
386 256 �C UMTS_BAND_9
387*/
388typedef enum
389{
390 MBTK_UMTS_BAND_1 = 1,
391 MBTK_UMTS_BAND_2 = 2,
392 MBTK_UMTS_BAND_3 = 4,
393 MBTK_UMTS_BAND_4 = 8,
394 MBTK_UMTS_BAND_5 = 16,
395 MBTK_UMTS_BAND_6 = 32,
396 MBTK_UMTS_BAND_7 = 64,
397 MBTK_UMTS_BAND_8 = 128,
398 MBTK_UMTS_BAND_9 = 256
399} mbtk_umts_band_enum;
400
401/*
402LTEbandH(TDD-LTE band)
403 32 �C TDLTE_BAND_38
404 64 �C TDLTE_BAND_39
405 128 �C TDLTE_BAND_40
406 256 �C TDLTE_BAND_41
407*/
408typedef enum
409{
410 MBTK_TDLTE_BAND_38 = 32,
411 MBTK_TDLTE_BAND_39 = 64,
412 MBTK_TDLTE_BAND_40 = 128,
413 MBTK_TDLTE_BAND_41 = 256
414} mbtk_tdlte_band_enum;
415
416/*
417LTEbandL(FDD-LTE band)
418 1 �C FDDLTE_BAND_1
419 4 �C FDDLTE _BAND_3
420 8 �C FDDLTE _BAND_4
421 64 �C FDDLTE _BAND_7
422 65536 �C FDDLTE _BAND_17
423 524288 �C FDDLTE _BAND_20
424*/
425typedef enum
426{
427 MBTK_FDDLTE_BAND_1 = 1,
428 MBTK_FDDLTE_BAND_3 = 4,
429 MBTK_FDDLTE_BAND_4 = 8,
430 MBTK_FDDLTE_BAND_7 = 64,
431 MBTK_FDDLTE_BAND_17 = 65536,
432 MBTK_FDDLTE_BAND_20 = 524288
433} mbtk_fddlte_band_enum;
434
b.liu288093c2024-05-09 17:02:57 +0800435typedef enum
436{
437 MBTK_LTE_EXT_BAND_65 = 1,
438 MBTK_LTE_EXT_BAND_66 = 2,
439 MBTK_LTE_EXT_BAND_67 = 4,
440 MBTK_LTE_EXT_BAND_68 = 8,
441 MBTK_LTE_EXT_BAND_69 = 16
442} mbtk_lte_ext_band_enum;
443
liubin281ac462023-07-19 14:22:54 +0800444/*
4450: unknown
4461: available
4472: current
4483: forbidden
449*/
450typedef enum
451{
452 MBTK_NET_AVIL_STATE_UNKNOWN = 0,
453 MBTK_NET_AVIL_STATE_AVAILABLE,
454 MBTK_NET_AVIL_STATE_CURRENT,
455 MBTK_NET_AVIL_STATE_FORBIDDEN
456} mbtk_net_avil_state_enum;
457
458typedef struct
459{
460 uint16 tac;
461 uint16 earfcn;
462} mbtk_local_info_t;
463
464typedef struct
465{
466 uint16 info_id;
467 uint16 info_err;
468 const uint8 *data;
469 uint16 data_len;
470} mbtk_info_pack_t;
471
472typedef struct
473{
474 uint8 type; // 0: GSM 1: UMTS 2: LTE
475 bool running;
476
477 int cell_num;
478 mbtk_cell_info_t cell[CELL_NUM_MAX];
479} mbtK_cell_pack_info_t;
480
481typedef enum {
482 MBTK_MOBILE_ORIGINATED_CALL,
483 MBTK_TERMINATED_CALL,
484} mbtk_call_dir_enum;
485
486typedef enum {
487 MBTK_VOICE,
488 MBTK_DATA,
489 MBTK_FAX,
490 MBTK_VOICE_FOLLOWED_BY_DATA_VOICE_MODE,
491 MBTK_ALTERNATING_VOICE_VOICE_MODE,
492 MBTK_ALTERNATING_FAX_VOICE_MODE,
493 MBTK_VOICE_FOLLOWED_BY_DATA_DATA_MODE,
494 MBTK_ALTERNATING_VOICE_DATA_MODE,
495 MBTK_ALTERNATING_FAX_FAX_MODE,
496 MBTL_UNKNOW,
497} mbtk_call_mode_enum;
498
499typedef enum {
500 MBTK_NOT_MULITYPARTY_CALL,
501 MBTK_MULITYPARTY__CALL,
502} mbtk_call_mpty_enum;
503
504typedef struct
505{
506 int cid;
507 bool act;
508 bool waitting;
509} info_cgact_wait_t;
510
511typedef struct
512{
513 uint32 count;
514 list_node_t *net_list;
515} mbtk_net_array_info_t;
516
517typedef struct
518{
519 bool inited;
520 mbtk_radio_state_enum radio_state;
521 mbtk_sim_state_enum sim_state;
522 mbtk_radio_technology_enum net_type;
523 mbtk_ip_type_enum ip_type;
524 struct sockaddr_in addr4;
525 struct sockaddr_in preferred_dns4;
526 struct sockaddr_in alternate_dns4;
527
528 struct sockaddr_in6 addr6;
529 struct sockaddr_in6 preferred_dns6;
530 struct sockaddr_in6 alternate_dns6;
531} net_info_t;
532
533#ifdef __cplusplus
534extern "C" {
535#endif
536char* type2str(mbtk_info_type_enum type);
537
538char* apn2str(mbtk_ip_type_enum type);
539
540char* id2str(int id);
541
542char* err2str(mbtk_info_err_enum err);
543
544/*
545IPv6 : 254.128.0.0.0.0.0.0.0.1.0.2.144.5.212.239 -> uint128
546*/
547int str_2_ipv6(const void *ip_str, void *ipv6);
548
549/*
550IPv6 : uint128 -> fe80::215:1dff:fe81:484c
551*/
552int ipv6_2_str(const void *ipv6, void *ipv6_str);
553
554/*
5550 GSM
5561 GSM_COMPACT
5572 UTRAN
5583 GSM_EGPRS
5594 UTRAN_HSDPA
5605 UTRAN_HSUPA
5616 UTRAN_HSDPA_HSUPA
5627 EUTRAN
5638 ECGSM
564*/
565mbtk_net_type_enum mbtk_net_type_get(mbtk_radio_technology_enum radio_tech);
566
567mbtk_info_type_enum mbtk_info_type_get(int info_id);
568
569mbtk_info_pack_t* mbtk_info_pack_creat(int info_id);
570
571#if 0
572int mbtk_info_pack_data_set(mbtk_info_pack_t *pack, const void *data, int data_len);
573void* mbtk_info_pack_data_get(mbtk_info_pack_t *pack, int *data_len);
574#endif
575
576int mbtk_info_pack_send(int fd, mbtk_info_pack_t *pack);
577
578mbtk_info_pack_t** mbtk_info_pack_recv(int fd, bool is_server, mbtk_info_err_enum *err);
579
580int mbtk_info_pack_free(mbtk_info_pack_t **pack);
581#ifdef __cplusplus
582}
583#endif
584
585
586#endif /* MBTK_INFO_INCLUDE */
587
588