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