T-Box Basic dev
Loading...
Searching...
No Matches
sim.h File Reference

T-Box SIM 卡接口 More...

#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  tbox_sim_pin_request_t
 PIN 操作请求。 More...

Macros

#define TBOX_RIL_PIN_MAX   16U
 包含结尾 NUL 的 PIN 或 PUK 容量
#define TBOX_RIL_IMSI_MAX   16U
 包含结尾 NUL 的 IMSI 容量
#define TBOX_RIL_ICCID_MAX   21U
 包含结尾 NUL 的 ICCID 容量
#define TBOX_RIL_SIM_NUMBER_MAX   32U
 包含结尾 NUL 的 SIM 卡号容量

Enumerations

enum  tbox_sim_state_t {
  TBOX_SIM_STATE_UNKNOWN = 0 , TBOX_SIM_STATE_ABSENT = 1 , TBOX_SIM_STATE_PIN_REQUIRED = 2 , TBOX_SIM_STATE_PUK_REQUIRED = 3 ,
  TBOX_SIM_STATE_READY = 4 , TBOX_SIM_STATE_BLOCKED = 5
}
 SIM 卡状态。 More...
enum  tbox_sim_pin_type_t { TBOX_SIM_PIN = 0 , TBOX_SIM_PUK = 1 , TBOX_SIM_PIN2 = 2 , TBOX_SIM_PUK2 = 3 }
 PIN 操作类别。 More...

Functions

int tbox_sim_get_status (tbox_sim_state_t *status)
 查询 SIM 卡状态。
int tbox_sim_get_imsi (char *value, size_t *length)
 查询 IMSI。
int tbox_sim_get_iccid (char *value, size_t *length)
 查询 ICCID。
int tbox_sim_get_number (char *value, size_t *length)
 查询 SIM 卡号(MSISDN)。
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_unblock_pin (tbox_sim_pin_type_t type, const char *puk, const char *new_pin)
 使用 PUK 解锁。
int tbox_sim_enable_pin (tbox_sim_pin_type_t type, const char *pin)
 启用 PIN 保护。
int tbox_sim_disable_pin (tbox_sim_pin_type_t type, const char *pin)
 禁用 PIN 保护。

Detailed Description

T-Box SIM 卡接口

Version
1.0.0
Date
2026-07-17