b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 1 | /*============================================================================= |
| 2 | # FileName: lynq_sim.h |
| 3 | # Desc: about SIMAPI |
| 4 | # Author: lei |
| 5 | # Version: V2.0 |
| 6 | # LastChange: 2023-03-13 |
| 7 | # History: |
| 8 | # If you need to use any API under lynq_sim, you must first call the lynq_sim_init() function to initialize these functions. |
| 9 | =============================================================================*/ |
| 10 | #ifndef __LYNQ_SIM__ |
| 11 | #define __LYNQ_SIM__ |
| 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | #include "mbtk_type.h" |
| 16 | |
| 17 | int lynq_get_sim_status(int *card_status); |
| 18 | int lynq_get_imsi(char buf[]); |
| 19 | int lynq_sim_init(int utoken); |
| 20 | int lynq_sim_deinit(void); |
| 21 | int lynq_enable_pin(char pin[]); |
| 22 | int lynq_disable_pin(char pin[]); |
| 23 | int lynq_get_iccid(char buf[]); |
| 24 | int lynq_query_pin_lock(char *pin,int buf[]); |
| 25 | int lynq_verify_pin(char *pin); |
| 26 | int lynq_change_pin(char *old_pin, char *new_pin); |
| 27 | int lynq_unlock_pin(char *puk, char *pin); |
| 28 | int lynq_query_phone_number(char buf[]); |
| 29 | int lynq_switch_card(int slot); |
| 30 | int lynq_screen(int num); |
| 31 | int lynq_get_imei(char buf[]); |
| 32 | int lynq_get_imei_and_sv(char imei[],char sv[]); |
| 33 | |
| 34 | /** |
| 35 | * @brief Request SIM I/O operation. |
| 36 | * This is similar to the TS 27.007 "restricted SIM" operation |
| 37 | * where it assumes all of the EF selection will be done by the callee. |
| 38 | * @param list type: [IN] list[0]:one of the commands listed for TS 27.007 +CRSM.(command) |
| 39 | * type: [IN] list[1]:EF id(fileid) |
| 40 | * type: [IN] list[2]:offset(p1) |
| 41 | * type: [IN] list[3]:offset(p2) |
| 42 | * type: [IN] list[4]:response len,sometimes needn't care(p3) |
| 43 | * @param path type: [IN] "pathid" from TS 27.007 +CRSM command. |
| 44 | type: [IN] Path is in hex asciii format eg "7f205f70" |
| 45 | type: [IN] Path must always be provided. |
| 46 | * @param data type: [IN] May be NULL |
| 47 | * @param pin2 type: [IN] May be NULL |
| 48 | * @param aidPtr type: [IN] AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. |
| 49 | * @param sw type: [OUT] |
| 50 | * @param simResponse type: [OUT] response |
| 51 | * @return int |
| 52 | */ |
| 53 | int lynq_req_sim_io(int list[5], char *path, char *data, char *pin2, char *aidPtr, int sw[2], char *simResponse); |
| 54 | |
| 55 | /** |
| 56 | * @brief |
| 57 | * @param options type: [IN] [options] define whether you want to halt, power-off, or reboot the machine.May be NULL |
| 58 | * @param time type: [IN] [time] specifies when you want the shutdown to perform.May be NULL |
| 59 | * @param message type: [IN] [message] adds a message that announces the shutdown.May be NULL |
| 60 | * @return int |
| 61 | */ |
| 62 | int lynq_shutdown(char options[], char time[], char message[]); |
| 63 | |
| 64 | /** |
| 65 | * @brief get currnet version of mobiletek |
| 66 | * @param buf type: [out] My Param doc |
| 67 | * @return int |
| 68 | */ |
| 69 | int lynq_get_version(char buf[]); |
| 70 | |
| 71 | /** |
| 72 | * @brief sim power on/off |
| 73 | * |
| 74 | */ |
| 75 | #ifdef MOBILETEK_TARGET_PLATFORM_T106 |
| 76 | int lynq_reset_sim(void); |
| 77 | #else |
| 78 | int lynq_sim_power(int mode); |
| 79 | #endif |
| 80 | /** |
| 81 | * @brief reset modem |
| 82 | * |
| 83 | */ |
| 84 | int lynq_reset_modem(void); |
| 85 | |
| 86 | /** |
| 87 | * @brief factory test to both radio on/off |
| 88 | * |
| 89 | */ |
| 90 | int lynq_factory_radio_state(int num); |
| 91 | |
| 92 | |
| 93 | #ifdef __cplusplus |
| 94 | } |
| 95 | #endif |
| 96 | |
| 97 | #endif |
| 98 | |