sendcard.h
上传用户:shyuanyi
上传日期:2008-05-24
资源大小:69k
文件大小:3k
- #ifndef _SEND_CARD_
- #define _SEND_CARD_
- /***********************************************/
- #define SYSTEMCARD_SECTOR 0
- #define SEEDCARD_SECTOR 1
- #define MAKER_CODE_SECT 0
- #define SYSTEM_SECT_1 1
- #define SYSTEM_SECT_2 2
- #define YSN_SYSPWD_SECT 3
- #define SEED_CARD_SECT 4 //UNIT_INFO_SECT
- #define OPUSER_CARD_SECT 5 //管理员或操作员
- //==============================================
- //UNIT(SEED) INFO
- #define CARD_LEVEL_DDR 0
- #define UNIT_CODE_ADDR 1 //1-3
- #define UNIT_PWD_ADDR 4 //4-6
- #define PUBLIC_SECTOR_ADDR 7
- #define FUC_TYPE_ADDR 8 //子功能类型
- #define FUC_SECTOR_ADDR 9 //子功能占用扇区
- #define SEED_DATE_ADDR 10 //10-12
- #define SEEDUSECOUNTS_ADDR 13 //13-14
- //===============================================
- //Card_Class_Para.public_sect
- #define PUBLIC_SECTOR (seedcard_info.public_sector)
- #define TYPE_FUC_SECT (4*PUBLIC_SECTOR)
- #define UNIT_INFO_SECT (4*PUBLIC_SECTOR+1)
- #define USER_INFO_SECT (4*PUBLIC_SECTOR+2)
- //===============================================
- //USER INFO
- #define CARD_STATE_ADDR 0
- #define USER_CODE_ADDR 1 //1-3
- #define USER_PDW_ADDR 4 //4-6
- #define CARD_CLASS_ADDR 7
- //#define TEST_ADDR 8
- #define ENBEL_USEDATE_ADDR 9 //09-11
- #define ALL_USE_COUNT_ADDR 12 //12-15
- //-----------------------------------------------
- #define CONSUME_TYPE_SECTOR (seedcard_info.fuc_sector) //5
- #define CONSUME_MONEY_SECT (4*CONSUME_TYPE_SECTOR) //4*5
- #define SAVE_MONEY_SECT (4*CONSUME_TYPE_SECTOR+1) //4*5+1
- //#define SAVE_JSTIME_SECT (4*CONSUME_TYPE_SECTOR+1) //4*5+1
- #define CONSUME_LIMIT_SECT (4*CONSUME_TYPE_SECTOR+2) //4*5+2
- //===============================================
- /*
- //SAVE_JSTIME_SECT
- #define JS_STARTTIME_ADDR 0 //0-5
- //CONSUME_LIMIT_SECT
- #define DC_STATETIME_ADDR 0 //0-2 只能按天数定餐
- #define DC_ENDTIME_ADDR 3 //3-5
- */
- #define DAYMAX_MONEY_ADDR 6 //6-7 日限额消费(最大0xffff)
- #define CONTIMES_MOMDAY_ADDR 8 //8 限次消费(日)--没用(月):
- //只有一个月后的当天来吃饭才有点小问题!
- #define CONTIMES_COUNTS_ADDR 9 //9-15(字节最大限次消费250,最多七个时段)
- /**************************************************************/
- extern BYTE code Nkey_a[6];
- extern BYTE code Nkey_b[6];
- extern void Set_BCCsum(BYTE *buf,BYTE nCount);
- extern BYTE Fill_data(BYTE bankdata[],long *val,BYTE into_flag);
- extern BYTE mifs_request(BYTE _Mode,BYTE idata *_TagType);
- extern BYTE mifs_anticoll(BYTE _Bcnt,BYTE idata *_SNR);
- extern BYTE mifs_select(BYTE idata *_SNR,BYTE idata *_Size);
- extern BYTE mifs_authentication(BYTE _Mode,BYTE _SecNr);
- extern BYTE mifs_authKey(BYTE _Mode,BYTE _SecNr,BYTE *_Key);
- extern BYTE mifs_read(BYTE _Adr,BYTE idata *_Data);
- extern BYTE mifs_write(BYTE _Adr,BYTE idata *_Data);
- extern BYTE mifs_check_write(BYTE idata *_SNR,BYTE _Authmode,BYTE _Adr,BYTE idata *_Data);
- extern BYTE mifs_load_key(BYTE _Mode,BYTE _SecNr,BYTE *_Nkey);
- extern BYTE mifs_halt(void);
- extern BYTE mifs_close(void);
- extern BYTE mifs_reset(BYTE _Msec);
- extern BYTE mifs_restore(BYTE _Adr);
- extern BYTE mifs_transfer(BYTE _Adr);
- /**********************************************************/
- #endif