blob: 8f2849a69865bdf304403880eb608f66b01f9d3e [file] [log] [blame]
b.liu4e243dc2023-11-27 11:20:00 +08001/*=============================================================================
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
13extern "C" {
14#endif
15#include "mbtk_type.h"
16
17int lynq_get_sim_status(int *card_status);
18int lynq_get_imsi(char buf[]);
19int lynq_sim_init(int utoken);
20int lynq_sim_deinit(void);
21int lynq_enable_pin(char pin[]);
22int lynq_disable_pin(char pin[]);
23int lynq_get_iccid(char buf[]);
24int lynq_query_pin_lock(char *pin,int buf[]);
25int lynq_verify_pin(char *pin);
26int lynq_change_pin(char *old_pin, char *new_pin);
27int lynq_unlock_pin(char *puk, char *pin);
28int lynq_query_phone_number(char buf[]);
29int lynq_switch_card(int slot);
30int lynq_screen(int num);
31int lynq_get_imei(char buf[]);
32int 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 */
53int 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 */
62int 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 */
69int lynq_get_version(char buf[]);
70
71/**
72 * @brief sim power on/off
73 *
74 */
75#ifdef MOBILETEK_TARGET_PLATFORM_T106
76int lynq_reset_sim(void);
77#else
78int lynq_sim_power(int mode);
79#endif
80/**
81 * @brief reset modem
82 *
83 */
84int lynq_reset_modem(void);
85
86/**
87 * @brief factory test to both radio on/off
88 *
89 */
90int lynq_factory_radio_state(int num);
91
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif
98