T-Box Basic dev
Loading...
Searching...
No Matches
sim.h
Go to the documentation of this file.
1
10
11#ifndef __TBOX_SIM_H__
12#define __TBOX_SIM_H__
13
14#include <stddef.h>
15
16#ifdef __cplusplus
17extern "C"
18{
19#endif
20
28
30#define TBOX_RIL_PIN_MAX 16U
32#define TBOX_RIL_IMSI_MAX 16U
34#define TBOX_RIL_ICCID_MAX 21U
36#define TBOX_RIL_SIM_NUMBER_MAX 32U
37
50
61
71
81
91int tbox_sim_get_imsi(char* value, size_t* length);
92
102int tbox_sim_get_iccid(char* value, size_t* length);
103
113int tbox_sim_get_number(char* value, size_t* length);
114
122int tbox_sim_verify_pin(tbox_sim_pin_type_t type, const char* pin);
123
132int tbox_sim_change_pin(tbox_sim_pin_type_t type, const char* old_pin, const char* new_pin);
133
142int tbox_sim_unblock_pin(tbox_sim_pin_type_t type, const char* puk, const char* new_pin);
143
151int tbox_sim_enable_pin(tbox_sim_pin_type_t type, const char* pin);
152
160int tbox_sim_disable_pin(tbox_sim_pin_type_t type, const char* pin);
161
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* __TBOX_SIM_H__ */
int tbox_sim_enable_pin(tbox_sim_pin_type_t type, const char *pin)
启用 PIN 保护。
#define TBOX_RIL_PIN_MAX
包含结尾 NUL 的 PIN 或 PUK 容量
Definition sim.h:30
int tbox_sim_verify_pin(tbox_sim_pin_type_t type, const char *pin)
校验 PIN。
int tbox_sim_change_pin(tbox_sim_pin_type_t type, const char *old_pin, const char *new_pin)
修改 PIN。
int tbox_sim_get_iccid(char *value, size_t *length)
查询 ICCID。
tbox_sim_state_t
SIM 卡状态。
Definition sim.h:42
int tbox_sim_unblock_pin(tbox_sim_pin_type_t type, const char *puk, const char *new_pin)
使用 PUK 解锁。
int tbox_sim_get_status(tbox_sim_state_t *status)
查询 SIM 卡状态。
int tbox_sim_get_imsi(char *value, size_t *length)
查询 IMSI。
tbox_sim_pin_type_t
PIN 操作类别。
Definition sim.h:55
int tbox_sim_disable_pin(tbox_sim_pin_type_t type, const char *pin)
禁用 PIN 保护。
int tbox_sim_get_number(char *value, size_t *length)
查询 SIM 卡号(MSISDN)。
@ TBOX_SIM_STATE_READY
可用
Definition sim.h:47
@ TBOX_SIM_STATE_PIN_REQUIRED
需要 PIN
Definition sim.h:45
@ TBOX_SIM_STATE_ABSENT
未插卡
Definition sim.h:44
@ TBOX_SIM_STATE_PUK_REQUIRED
需要 PUK
Definition sim.h:46
@ TBOX_SIM_STATE_UNKNOWN
未知
Definition sim.h:43
@ TBOX_SIM_STATE_BLOCKED
已锁死
Definition sim.h:48
@ TBOX_SIM_PUK2
PUK2.
Definition sim.h:59
@ TBOX_SIM_PIN2
PIN2.
Definition sim.h:58
@ TBOX_SIM_PIN
PIN1.
Definition sim.h:56
@ TBOX_SIM_PUK
PUK1.
Definition sim.h:57
PIN 操作请求。
Definition sim.h:66
tbox_sim_pin_type_t type
操作类别
Definition sim.h:67
char code[TBOX_RIL_PIN_MAX]
当前 PIN 或 PUK,NUL 结尾
Definition sim.h:68
char pin[TBOX_RIL_PIN_MAX]
新 PIN,NUL 结尾;不需要时为空
Definition sim.h:69