| ll | 56cb7ca | 2022-01-21 07:41:40 +0000 | [diff] [blame] | 1 | /*============================================================================= |
| 2 | # FileName: lynq_sim.cpp |
| 3 | # Desc: about SIMAPI |
| 4 | # Author: mobiletek |
| 5 | # Version: V1.0 |
| 6 | # LastChange: 2020-07-29 |
| 7 | # History: |
| 8 | # If you need to use any API under lynq_sim, you must first call the init_sim() function to initialize these functions. |
| 9 | =============================================================================*/ |
| 10 | #ifndef __LYNQ_SIM__ |
| 11 | #define __LYNQ_SIM__ |
| 12 | #include <sys/types.h> |
| 13 | #include <sys/socket.h> |
| 14 | #include <netinet/in.h> |
| 15 | #include <arpa/inet.h> |
| 16 | #include <stdio.h> |
| 17 | #include <sys/types.h> |
| 18 | #include <sys/socket.h> |
| 19 | #include <arpa/inet.h> |
| 20 | #include <string.h> |
| 21 | #include <unistd.h> |
| 22 | #include <binder/Parcel.h> |
| 23 | #include <log/log.h> |
| 24 | #include <cutils/jstring.h> |
| 25 | #include <pthread.h> |
| 26 | #define MAX_BUF 20 |
| 27 | #define MAX_NUM 80 |
| 28 | #ifdef __cplusplus |
| 29 | |
| 30 | #define RIL_REQUEST_GET_SIM_STATUS 1 |
| 31 | #define RIL_REQUEST_GET_IMSI 11 |
| 32 | #define RIL_REQUEST_QUERY_ICCID 2026 |
| 33 | #define RIL_REQUEST_SET_FACILITY_LOCK 43 |
| 34 | #define RIL_REQUEST_QUERY_FACILITY_LOCK 42 |
| 35 | #define RIL_REQUEST_ENTER_SIM_PIN 2 |
| 36 | #define RIL_REQUEST_ENTER_SIM_PUK 3 |
| 37 | #define RIL_REQUEST_CHANGE_SIM_PIN 6 |
| 38 | #define RIL_REQUEST_OEM_HOOK_RAW 59 |
| 39 | |
| 40 | |
| 41 | extern "C" { |
| 42 | #endif |
| 43 | |
| 44 | |
| 45 | #define MAX_LEN 1024*8 |
| 46 | |
| 47 | typedef struct{ |
| 48 | int uToken; |
| 49 | int request; |
| 50 | int paramLen; |
| 51 | char param[MAX_LEN]; |
| 52 | }lynq_client_t; |
| 53 | |
| 54 | typedef struct |
| 55 | { |
| 56 | char *MCCMCN; |
| 57 | char *buf; |
| 58 | char *MCN; |
| 59 | }FindOperator; |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | int lynq_get_sim_status(int *card_status); |
| 67 | int lynq_get_imsi(char buf[]); |
| 68 | |
| 69 | /*add by lei*/ |
| 70 | int lynq_sim_init(int utoken); |
| 71 | int lynq_sim_deinit(void); |
| 72 | int lynq_enable_pin(char *pin); |
| 73 | int lynq_disable_pin(char *pin); |
| 74 | int lynq_query_operator(char buf[]); |
| 75 | int lynq_get_iccid(char buf[]); |
| 76 | int lynq_query_pin_lock(char *pin,int buf[]); |
| 77 | int lynq_verify_pin(char *pin); |
| 78 | int lynq_change_pin(char *old_pin, char *new_pin); |
| 79 | int lynq_unlock_pin(char *puk, char *pin); |
| 80 | int lynq_query_phone_number(char buf[]); |
| 81 | /*add by lei*/ |
| 82 | |
| 83 | |
| 84 | #ifdef __cplusplus |
| 85 | } |
| 86 | #endif |
| 87 | |
| 88 | #endif |
| 89 | |