sim_driver.h

来自「对SIM卡进行操作的驱动程序。实现了GSM规范中规定的基本功能。该驱动也是基于三」· C头文件 代码 · 共 45 行

H
45
字号

#ifndef __SIM_DRIVER_H__
#define __SIM_DRIVER_H__

//////////////////////////////////////////////////////////////////
//
// SIM Driver
//
//////////////////////////////////////////////////////////////////

extern unsigned char sim_card_ready;

void SIM_OpenDriver(void);
void SIM_CloseDriver(void);

//////////////////////////////////////////////////////////////////
//
// SIM Transaction
//
//////////////////////////////////////////////////////////////////

typedef struct {
	unsigned char CASE;
	unsigned char CLA;
	unsigned char INS;
	unsigned char P1;
	unsigned char P2;
	unsigned char P3;
	unsigned char SW1;
	unsigned char SW2;
	unsigned char *cmd_data;
	unsigned char *rsp_data;
} sim_transaction_t;

#define SIM_CASE_1			1	// command data: N -- response data: N
#define SIM_CASE_2			2	// command data: N -- response data: Y
#define SIM_CASE_3			3	// command data: Y -- response data: N
#define SIM_CASE_4			4	// command data: Y -- response data: Y

void SIM_Transaction(sim_transaction_t *transaction);

unsigned char SIM_Test1(void);
unsigned char SIM_Test2(void);

#endif //__SIM_DRIVER_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?