blob: b381421ce0566de4a71fa81a36538f8c5bbc9592 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*********************************************************************************
2** Copyright @ Fibocom Technologies Co., Ltd. 2023-2030. All rights reserved.
3** File name: fibo_vsim_api.h
4** Author: GaoZeng
5** Version: V1.0.0
6** Date: 2023.02.14
7** Description: This file provides the declaration Vsim-related APIs and structs.
8** Others:
9***********************************************************************************/
10#ifndef __GHT_VSIM_API_H__
11#define __GHT_VSIM_API_H__
12
13#include "stdio.h"
14#include "stdint.h"
15#include "stdlib.h"
16#include "string.h"
17#include "ght_error.h"
18#include "softap_api.h"
19#include <sys/socket.h>
20
21#define SIM_IMSI_LEN_MAX 16 /** Maximum length of IMSI data. */
22#define SIM_ICCID_LEN_MAX 21 /** Maximum length of ICCID data. */
23#define DATA_MAX_APN_LEN 57 /** Maximum length of the APN. */
24#define DATA_MAX_USERNAME_LEN 127 /** Maximum length of the profile user name. */
25#define DATA_MAX_PASSWORD_LEN 127 /** Maximum length of the profile password. */
26#define DATA_INTERFACE_NAME_LEN 16 /** Interface name length. */
27#define DATA_MAX_ADDR_COUNT 2 /** Maximum number of IP addresses. */
28
29//**************GHT VSIM Struct*********************//
30
31typedef enum {
32 E_SIM_TYPE_USIM, //ʵÌ忨
33 E_SIM_TYPE_VSIM, //ÔÆ¿¨
34 E_SIM_TYPE_SSIM, //Soft SIM
35}SimTypeInSlot_t;
36
37
38typedef enum {
39 E_NW_RADIO_IF_NO_SRV = 0,
40 E_NW_RADIO_IF_GSM = 1,
41 E_NW_RADIO_IF_WCDMA = 2,
42 E_NW_RADIO_IF_LTE = 3,
43 E_NW_RADIO_IF_TDSCDMA = 4,
44 E_NW_RADIO_IF_CDMA = 5,
45 E_NW_RADIO_IF_CDMA2000 = 6,
46}e_nw_rat_type_t; //RAT value
47
48
49typedef enum {
50 E_NW_STATUS_SRV_NONE = 0,
51 E_NW_STATUS_CURRENT_SERVING = 1,
52 E_NW_STATUS_SRV_LIMITED = 2,
53 E_NW_STATUS_SRV_AVAILABLE = 3,
54 E_NW_STATUS_SRV_FORBIDDEN = 4,
55}e_nw_srv_status_t;
56
57
58typedef struct
59{
60 uint32_t tac;
61 uint32_t cell_id;
62}lte_scell_info_t;
63
64typedef struct
65{
66 uint32_t lac;
67 uint32_t cell_id;
68}gsm_w_scell_info_t;
69
70
71
72typedef struct
73{
74 e_nw_rat_type_t curr_rat;
75 e_nw_srv_status_t nStatus;
76 lte_scell_info_t lte_scell_info; //¸³Öµ¿ÉÑ¡£¬Óû§¸ù¾ÝratÖ¸Ê¾ÍøÂçÀàÐÍȡֵ
77 gsm_w_scell_info_t gsm_w_scell_info; //¸³Öµ¿ÉÑ¡£¬Óû§¸ù¾ÝratÖ¸Ê¾ÍøÂçÀàÐÍȡֵ
78}RegInfo_t;
79
80typedef struct{
81 uint16_t mcc;
82 uint16_t mnc;
83 uint32_t tac;
84 uint32_t cell_id;
85 uint16_t bandwidth;
86 int16_t rxlev;
87 uint32_t arfcn;
88 uint16_t pcid;
89}base_cell_info_t;//Hex format
90
91
92typedef struct
93{
94 uint8_t roamingFlag; ///< 1:roaming,0:non roaming
95 int16_t rsrp;
96 int16_t rsrq;
97 uint16_t SINR;
98 uint16_t netMode; //0--tdd 1--fdd
99 uint16_t band;
100 base_cell_info_t base_Scell_info;
101} lte_Scell_t;
102
103typedef struct
104{
105 int16_t rsrp;
106 int16_t rsrq;
107 uint16_t netMode; //0--tdd 1--fdd
108 base_cell_info_t base_Ncell_info;
109}lte_Ncell_t;
110
111typedef struct
112{
113 uint16_t bsic; //only in GSM
114 uint16_t band;
115 uint16_t rscp; //only in W
116 base_cell_info_t base_Ncell_info;
117}gsm_W_Scell_t;
118
119
120typedef struct
121{
122 uint16_t bsic; //only GSM
123 uint16_t band;
124 uint16_t rscp; //only in W
125 base_cell_info_t base_Ncell_info;
126}gsm_W_Ncell_t;
127
128typedef struct
129{
130 lte_Scell_t lteScell;
131 uint16_t lteNcellNum;
132 lte_Ncell_t lteNcell[6];
133}lte_cellinfo_t;
134
135typedef struct{
136 gsm_W_Scell_t scell_info;
137 uint16_t gsm_W_NcellNum;
138 gsm_W_Ncell_t gsm_W_ncell[6];
139}gsm_W_cellifo_t;
140
141typedef struct{
142 e_nw_rat_type_t curr_rat;
143 e_nw_srv_status_t service_status; //0x00: in service; 0x01: not in
144 lte_cellinfo_t lte_cellinfo;
145 gsm_W_cellifo_t gsm_cellinfo;
146}CellInfo_t;
147
148
149typedef struct{
150 uint32_t lwip_ul;
151 uint32_t lwip_dl;
152 uint32_t ppp_ul;
153 uint32_t ppp_dl;
154 uint32_t rndis_ul;
155 uint32_t rndis_dl;
156}NetInfo_t; /**< µ¥Î»: bit*/
157
158typedef enum
159{
160 E_DATA_IP_FAMILY_UNKNOWN = 0x00, /**< unknown */
161 E_DATA_IP_FAMILY_IPV4 = 0x04, /**< IPv4 */
162 E_DATA_IP_FAMILY_IPV6 = 0x06, /**< IPv6 */
163 E_DATA_IP_FAMILY_IPV4V6 = 0x0A /**< IPv4|IPv6 */
164}e_data_ip_family_t;
165
166typedef enum
167{
168 E_DATA_TECH_PREF_UNKNOWN = 0x00, /**< unknown */
169 E_DATA_TECH_PREF_UMTS = 0x01, /**< UMTS */
170 E_DATA_TECH_PREF_CDMA = 0x02, /**< CDMA */
171 E_DATA_TECH_PREF_LTE = 0x03, /**< LTE */
172 E_DATA_TECH_PREF_AUTO = 0x04 /**< AUTO */
173}e_data_tech_pref_t;
174
175typedef enum
176{
177 E_AUTH_PREF_PAP_CHAP_NOT_ALLOWED = 0x00,
178 E_AUTH_PREF_PAP_ONLY_ALLOWED = 0x01,
179 E_AUTH_PREF_CHAP_ONLY_ALLOWED = 0x02,
180 E_AUTH_PREF_PAP_CHAP_BOTH_ALLOWED = 0x03
181}e_data_auth_pref_t;
182
183
184typedef struct
185{
186 uint8_t profile_valid; /**< Must be set to TRUE if umts_profile is being passed. */
187 uint8_t profile_id; /**< profile ID. as well as called cid*/
188 uint8_t ip_family_valid; /**< Must be set to TRUE if ip_family is being passed. */
189 e_data_ip_family_t ip_family; /**< Data IP Family */
190 uint8_t apn_name_valid; /**< Must be set to TRUE if apn_name is being passed. */
191 char apn_name[DATA_MAX_APN_LEN+1]; /**< Data APN Name. A character string that identifies a PDN*/
192 uint8_t user_name_valid; /**< Must be set to TRUE if user_name is being passed. */
193 char user_name[DATA_MAX_USERNAME_LEN+1]; /**< Username for the APN. */
194 uint8_t password_valid; /**< Must be set to TRUE if password is being passed. */
195 char password[DATA_MAX_PASSWORD_LEN+1]; /**< Password for the APN. */
196 uint8_t auth_pref_valid; /**< Must be set to TRUE if tech_pref is being passed. */
197 e_data_auth_pref_t auth_pref; /**< Data auth Preference */
198 uint8_t tech_pref_valid; /**< Must be set to TRUE if tech_pref is being passed. */
199 e_data_tech_pref_t tech_pref; /**< Data Tech Preference */
200}Data_call_config_info_t;
201
202
203typedef struct
204{
205 char addr_valid; /**< Indicates whether a valid address is available. */
206 struct sockaddr_storage addr; /**< Stores the IP address. defined in kernel socket.h*/
207}data_call_addr_t;
208
209typedef struct
210{
211 data_call_addr_t iface_addr_s; /**< Network interface address. */
212 uint32_t iface_mask; /**< Subnet mask. */
213 data_call_addr_t gtwy_addr_s; /**< Gateway server address. */
214 uint32_t gtwy_mask; /**< Gateway mask. */
215 data_call_addr_t dnsp_addr_s; /**< Primary DNS server address. */
216 data_call_addr_t dnss_addr_s; /**< Secondary DNS server address. */
217}data_call_addr_info_t;
218
219typedef struct
220{
221 char iface_name[DATA_INTERFACE_NAME_LEN + 1]; /**< Network interface name. */
222 uint8_t addr_info_len; /**< Must be set to the number of elements in addr_info. */
223 data_call_addr_info_t addr_info[DATA_MAX_ADDR_COUNT]; /**< Data device address list. */
224}Data_call_addr_info_list_t;
225
226typedef enum{
227 E_RF_RESOURCE_CALLBACK_EVENT = 0x00, /**< É䯵×ÊÔ´Çл». */
228 E_NW_ATTACH_COMMPLETE_EVENT = 0x32, /**< ×¢ÍøÍê³É. */
229 E_DATA_PDN_ACT_SUCC_EVENT = 0x64, /**< PDN¼¤»îÍê³É ,ind_dataÖÐЯ´øZGIPDNS:µØÖ·ÐÅÏ¢ */
230}E_MODEM_EVENT_ID;
231
232typedef enum
233{
234 E_SIM_STAT_NOT_INSERTED = 0x00,
235 E_SIM_STAT_READY = 0x01,
236 E_SIM_STAT_PIN = 0x02,
237 E_SIM_STAT_PUK = 0x03,
238 E_SIM_STAT_BUSY = 0x04,
239 E_SIM_STAT_UNKNOWN = 0x05,
240}E_SIM_STATUS;
241
242
243/*********************************************************************
244** Ãû³Æ£º VSIM_COMMAND
245** ÃèÊö£º VSIMÓ¦ÓúÍModemͨÐŵĻص÷º¯Êý½á¹¹Ìå
246**
247*********************************************************************/
248
249typedef int (*VSIM_COMMAND)(uint8_t *apdu_req, uint16_t apdu_req_len,uint8_t *apdu_rsp, uint16_t *apdu_rsp_len, uint8_t slot);
xf.libdd93d52023-05-12 07:10:14 -0700250typedef int (*SoftSim_COMMAND)(uint8_t *apdu_req, uint16_t apdu_req_len,uint8_t *apdu_rsp, uint16_t *apdu_rsp_len, uint8_t slot);
lh9ed821d2023-04-07 01:36:19 -0700251
252/*********************************************************************
253** Ãû³Æ£º FIBO_MODEM_EVENT
254** ÃèÊö£º ÏûϢʼþ֪ͨº¯ÊýµÄ½á¹¹¶¨Òå
255** ind_dataÖÐÆ½Ì¨×Ô¶¨ÒåÌí¼ÓÃèÊö
256** ±ÈÈçRF×ÊÔ´»ØÊÕÔ­Òò£º1. For SIM1 TAU; 2. For SIM1 Regist Network;3. NULL;
257**
258*********************************************************************/
259
260typedef int32_t (*FIBO_MODEM_EVENT)(E_MODEM_EVENT_ID event_id, void *ind_data, uint32_t ind_data_len);
261
262/*********************************************************************
263** Ãû³Æ£º fibo_mdm_event_regist
264** ÃèÊö£º
265** ÏûϢʼþ֪ͨº¯Êý×¢²áÈë¿Ú£¬Ìṩ¸ø¿Í»§×¢²áÏûÏ¢º¯Êý;
266** modem²à²úÉúʼþ£¬»áµ÷ÓÃind_cb֪ͨ¿Í»§£»
267** IN:
268** ind_cb: func pointer;
269*********************************************************************/
270
271extern int32_t fibo_mdm_event_regist(FIBO_MODEM_EVENT ind_cb);
272
273/************************************************************************
274** Function Name: fibo_vsim_init
275** Description:
276** VSIM³õʼ»¯£¬ÐèÒª½«APDU»Øµ÷º¯Êý×÷ΪÈë²Î´«Èë¸ø modem;
277** VSIM¿ªÊ¼¹¤×÷ʱµ÷Óã¬ModemÊÕµ½ºó·¢Æð×¢²á£¬¿Í»§µÈ´ýʼþÉϱ¨½Ó¿Ú
278** Éϱ¨E_NW_ATTACH_COMMPLETE_EVENT
279** IN:
280** vsim_apdu_process: func pointer;
281** nSimID: value in range of [0,1];
282**************************************************************************/
283
284extern void fibo_vsim_init(VSIM_COMMAND vsim_apdu_process, uint8_t nSimID);
xf.libdd93d52023-05-12 07:10:14 -0700285extern void fibo_SoftSim_init(SoftSim_COMMAND softsim_apdu_process, uint8_t nSimID);
lh9ed821d2023-04-07 01:36:19 -0700286
287/**********************************************************
288** Function Name: fibo_vsim_close
289** Description:
290** ¹Ø±ÕVSIM, modem²àÍê³ÉdetachºÍ¹Ø¿¨µÈ²Ù×÷;
291** IN:
292** vsim_apdu_process: function pointer;
293** nSimID: value in range of [0,1];
294***********************************************************/
295
296extern void fibo_vsim_close(VSIM_COMMAND vsim_apdu_process, uint8_t nSimID);
xf.libdd93d52023-05-12 07:10:14 -0700297extern void fibo_SoftSim_close(SoftSim_COMMAND softsim_apdu_process, uint8_t nSimID);
lh9ed821d2023-04-07 01:36:19 -0700298
299/**************************************************************
300** Function Name: fibo_set_dualsim
301** Description:
302** Ë«¿¨Çл»ÅäÖýӿڣ¬¸ù¾ÝÈë²ÎSimIDÇл»µ½¶ÔÓ¦µÄ¹¤×÷¿¨£¬
303** SIMÏà¹ØATÒ²ÓëÖ®Çл»;
304** IN:
305** nSimID: value in range of [0,1];
306***************************************************************/
307
308extern int32_t fibo_set_dualsim(uint8_t nSimID);
309
310/**************************************************************
311** Function Name: fibo_set_dualsim
312** Description:
313** Ë«¿¨Çл»»ñÈ¡½Ó¿Ú£¬»ñÈ¡µ±Ç°ÓëATÏà¹ØµÄSIM ID;
314** OUT:
315** nSimID: pointer to memery restored current SIM ID;
316***************************************************************/
317
318extern int32_t fibo_get_dualsim(uint8_t *nSimID);
319
320/**************************************************************
321** Function Name: fibo_set_dualsim
322** Description:
323** ÅäÖÃÊý¾Ý¿¨ÎªnSimIDÖ¸ÏòµÄ¿¨;
324** ¸Ã½Ó¿Ú½öÇл»Óû§²àÊý¾ÝËùʹÓõÄSIM£¬
325** ²»Ó°ÏìSIM0ºÍSIM1µÄÍøÂç²àPDNÁ¬½Óͬʱ±£»î£¬
326** Çл»Ê±²»»áÒýÆðǰһÕÅ¿¨ÉϵÄPDNÁ¬½Ó¶Ï¿ª£¬ÈôÓеϰ;
327** IN:
328** nSimID: value in range of [0,1];
329***************************************************************/
330
331extern int32_t fibo_set_datasim(uint8_t nSimID);
332
333/**************************************************************
334** Function Name: fibo_get_datasim
335** Description:
336** »ñÈ¡µ±Ç°ÅäÖõÄÊý¾Ý¿¨ID;
337** OUT:
338** nSimID: pointer to memery restored current SIM ID;
339***************************************************************/
340
341extern int32_t fibo_get_datasim(uint8_t *nSimID);
342
343/**********************************************************
344** Function Name: fibo_set_IMEI_by_simid
345** Description:
346** ÉèÖÃVSIM¶ÔÓ¦µÄIMEI;
347** Note: ÉèÖÃIMEI£¬µôµç²»±£´æ£¬ËæÏµÍ³¿ª»úÓ¦ÓóÌÐòÀ­Æðʱµ÷ÓÃ;
348** IMEIºÍSIM0×¢Íøºó´ÓvSIM·þÎñ¶ËÏÂÔØµÄ¿¨°üÓйأ¬Ë濨°ü±ä»¯£»
349** IN:
350** imei: pointer to memery restored the IMEI to set;
351** imei_len: size of the memery pointed by "imei";
352** nSimID: value in range of [0,1];
353***********************************************************/
354
355extern int32_t fibo_set_IMEI_by_simid(uint8_t *imei, uint8_t imei_len, uint8_t nSimID);
356
357/**********************************************************
358** Function Name: fibo_set_IMEI_by_simid
359** Description:
360** »ñÈ¡VSIM¶ÔÓ¦µÄIMEI;
361** Note: É豸IMEI£¬µôµç²»±£´æ£¬ÔÚvsim_initÖ®ºó;
362** IN:
363** nSimID: value in range of [0,1];
364** imei_len: size of the memery pointed by "imei";
365** OUT:
366** imei: pointer to memery to restore the IMEI to get;
367***********************************************************/
368
369extern int32_t fibo_get_IMEI_by_simid(uint8_t *imei, uint8_t imei_len, uint8_t nSimID);
370
371/**********************************************************
372** Function Name: fibo_get_CCID_by_simid
373** Description:
374** »ñȡָ¶¨SIMµÄICCID;
375** IN:
376** nSimID: value in range of [0,1];
377** ccid_len: size of the memery pointed by "ccid";
378** OUT:
379** ccid: pointer to memery to restore the ICCID to get;
380***********************************************************/
381
382extern int32_t fibo_get_CCID_by_simid(uint8_t *ccid, uint8_t ccid_len, uint8_t nSimID);
383
384/**********************************************************
385** Function Name: fibo_get_MCC_MNC_by_simid
386** Description:
387** ¿Í»§¶¨ÖÆÐèÇó½Ó¿Ú£¬»ñÈ¡·þÎñÍøÂçMCCºÍMNC;
388** IN:
389** nSimID: value in range of [0,1];
390** OUT:
391** mcc: pointer to memery to restore the mcc to get;
392** mnc: pointer to memery to restore the mnc to get;
393** Note:
394* please deliver a buffer of which size is range in [2,3];
395***********************************************************/
396
397extern int32_t fibo_get_MCC_MNC_by_simid(char *mcc, char *mnc, uint8_t nSimID);
398
399/**********************************************************
400** Function Name: fibo_set_cfun_mode
401** Description:
402** ÉèÖÃCFUN²ÎÊý;
403** IN:
404** mode: value in [0,1,4];
405** 0: close modem stack(MS);
406** 1: open MS or out of Airplane;
407** 4: into Airplane and close RF TRX channel;
408***********************************************************/
409
410extern int32_t fibo_set_cfun_mode(uint8_t mode);
411
412/**********************************************************
413** Function Name: fibo_get_cfun_mode
414** Description:
415** »ñÈ¡CFUN²ÎÊý;
416** OUT:
417** mode: value in [0,1,4];
418** 0: close modem stack(MS);
419** 1: open MS or out of Airplane;
420** 4: into Airplane and close RF TRX channel;
421***********************************************************/
422
423extern int32_t fibo_get_cfun_mode(uint8_t *mode);
424
425/**********************************************************
426** Function Name: fibo_set_SysReset
427** Description:
428** ÖØÆôÉ豸;
429**
430***********************************************************/
431
432extern int32_t fibo_set_SysReset();
433
434/**********************************************************
435** Function Name: fibo_get_CSQ_by_simid
436** Description:
437** »ñÈ¡ÓëSIM IDÏà¹ØµÄCSQ;
438** OUT:
439** rssi: -110dbm~-51dbm in GSM;
440** ´ú±írscp: -115dbm~-25dbm;´ú±írsrp: -140dbm~-44dbm in LTE;
441** ber: Only in GSM
442** 0 BER < 0.2 %
443** 1 0.2 % < BER < 0.4 %
444** 2 0.4 % < BER < 0.8 %
445** 3 0.8 % < BER < 1.6 %
446** 4 1.6 % < BER < 3.2 %
447** 5 3.2 % < BER < 6.4 %
448** 6 6.4 % < BER < 12.8 %
449** 7 12.8 % < BER
450** 99 δ֪»ò²»¿É²â
451** IN:
452** nSimID: value in range of [0,1];
453***********************************************************/
454
455extern int32_t fibo_get_CSQ_by_simid(int32_t *rssi, int32_t *ber, uint8_t nSimID);
456
457/**********************************************************
458** Function Name: fibo_getRegInfo
459** Description:
460** »ñÈ¡ÓëSIM IDÏà¹ØµÄRegInfo;
461**
462***********************************************************/
463
464extern int32_t fibo_get_RegInfo_by_simid(RegInfo_t *reg_info, uint8_t nSimID);
465
466/**********************************************************
467** Function Name: fibo_get_CellInfo_by_simid
468** Description:
469** »ñÈ¡ÓëSIM IDÏà¹ØµÄCellInfo;
470**
471***********************************************************/
472
473extern int32_t fibo_get_CellInfo_by_simid(CellInfo_t *pcellinfo, uint8_t nSimID);
474
475/**********************************************************
476** Function Name: fibo_get_NetInfo_by_simid
477** Description:
478** »ñÈ¡ÓëSIM IDÏà¹ØµÄÁ÷Á¿ÐÅÏ¢;
479** OUT:
480** pNetInfo: ´æ´¢»ñÈ¡µÄÁ÷Á¿ÐÅÏ¢;µ¥Î»: /bit
481***********************************************************/
482
483extern int32_t fibo_get_NetInfo_by_simid(NetInfo_t *pNetInfo, uint8_t nSimID);
484
485/**********************************************************
486** Function Name: fibo_set_APN_by_simid
487** Description:
488** ÅäÖÃÓÃÓÚPDP¼¤»îµÄprofileÐÅÏ¢;
489** IN:
490** profile_id: ָʾȥ¼¤»îµÄcid;
491** rndis_flag: 0x00: ÄÚÖò¦ºÅ; 0x01:ÍâÖò¦ºÅ;
492***********************************************************/
493
494extern int32_t fibo_set_APN_by_simid(Data_call_config_info_t *data_call, uint8_t nSimID);
495
496/******************************************************************************
497** Function Name: fibo_start_Data_Call_by_simid
498** Description:
499** ¼¤»îÖ¸¶¨profile PDPÁ¬½Ó£¬ZGACTºÍCGACT¾ùÏ·¢µÄÍâÖò¦ºÅ;
500** IN:
501** nSimID: value in range of [0,1];
502** data_call: pointer to memery restore apn profile;
503** rndis_flag: 0x00: ÄÚÖò¦ºÅ; 0x01:ÍâÖò¦ºÅ;
504******************************************************************************/
505
506extern int32_t fibo_start_Data_Call_by_simid(Data_call_config_info_t *data_call, uint8_t rndis_flag, uint8_t nSimID);
507
508/**********************************************************
509** Function Name: fibo_stop_Data_Call_by_simid
510** Description:
511** È¥¼¤»îÖ¸¶¨profile PDPÁ¬½Ó£¬ZGACTºÍCGACT¾ùÏ·¢µÄÍâÖò¦ºÅ;
512** IN:
513** profile_id: ָʾȥ¼¤»îµÄcid;
514** rndis_flag: 0x00: ÄÚÖò¦ºÅ; 0x01:ÍâÖò¦ºÅ;
515***********************************************************/
516
517extern int32_t fibo_stop_Data_Call_by_simid(uint8_t profile_id, uint8_t rndis_flag, uint8_t nSimID);
518
519/**********************************************************
520** Function Name: fibo_get_Data_Addr_by_simid
521** Description:
522** »ñȡָ¶¨profileµÄµØÖ·ÐÅÏ¢;
523** IN:
524** profile_id: ָʾ»ñÈ¡ÄÄһ·cidÐÅÏ¢;
525** OUT:
526** addr_list: ÓÃÓÚ´æ´¢»ñÈ¡µÄµØÖ·ÐÅÏ¢
527***********************************************************/
528
529extern int32_t fibo_get_Data_Addr_by_simid(uint8_t profile_id, Data_call_addr_info_list_t *addr_list, uint8_t nSimID);
530
531/**********************************************************
532** Function Name: fibo_get_SIM_Status_by_simid
533** Description:
534** »ñȡָ¶¨SIM ״̬ÐÅÏ¢;
535** IN:
536** nSimID: value in range of [0,1];
537** OUT:
538** sim_status: ÓÃÓÚ´æ´¢»ñÈ¡µÄSIM״̬ÐÅÏ¢
539***********************************************************/
540
541extern int32_t fibo_get_SIM_Status_by_simid(E_SIM_STATUS *sim_status, uint8_t nSimID);
542
543
544/**********************************************************
545** Function Name: fibo_send_AT_by_simid
546** Description:
547** »ñȡָ¶¨SIM Ïà¹ØATÖ¸ÁîºÍ·µ»Ø½á¹û;
548** IN:
549** nSimID: value in range of [0,1];
550** req_at: ÓÃÓÚ´æ´¢·¢Ë͵ÄATÖ¸Áî;
551** info_fmt: ATÏìÓ¦µÄ¸ñʽ»¯·½Ê½;
552** pval: ¸ñʽ»¯ºóµÄATÏìÓ¦;
553** OUT:
554** return 0±íʾ·µ»ØOK³É¹¦£¬ÆäËûÖµ±íʾʧ°Ü´íÎóÂë;
555ʾÀý:
556int ret = 0;
557ret = get_modem_info("AT+CFUN=1\r", NULL, NULL);
558//·µ»Ø0¼´±íʾִÐгɹ¦
559
560char *pstr = malloc(50);
561memset(pstr,0,50);
562ret = get_modem_info("AT+CIMI\r", "%s", (void**)&pstr);
563//+CIMI: 111111111111111·µ»Øºópstr==111111111111111
564
565int n1 = 0;
566int n2 = 0;
567int n3 = 0;
568void *p2[] = {&n1,&n2,&n3};
569ret = get_modem_info("AT+CCIOTOPT?\r", "%d,%d,%d", (void**)p2);
570//+CCIOTOPT: 1,2,3½âÎöºón1==1 n2==2 n3==3
571***********************************************************/
572
573extern int32_t fibo_send_AT_by_simid(char *req_at, char *info_fmt, void **pval, uint8_t nSimID);
574
575
576#endif //#ifndef __GHT_VSIM_API_H__