嵌入式射频卡程序.docVIP

  • 17
  • 0
  • 约2.42万字
  • 约 52页
  • 2018-11-08 发布于广东
  • 举报
嵌入式射频卡程序.doc

嵌入式射频卡程序 #include nkeyshell.hn char shell_s[]=\nkeyshellgt; /*int argc, char *argv[*/ #defineCMD_TPYE (0) #define PHONE_NUMBER (1) #define MAX_CMD_DEPTH (2) extern volatile int STOP ; extern char PHONE[]; void * keyshell() { int i; char cmd[256]={0,}; /*** *与读卡相关的数据定义 * 木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木木 uchar CardNo[4],CardKey[6]; uchar CardData[16]; uchar Default一CardBlock=0x01; uchar Choose_CardBlock=0x01; for(i=0;ilt;6;i++) Card Key [i]=Oxff; for(i=0;ilt;4;i++) CardNo[i]=0; y 3^^ 3^^ 木木木木 木木 5^^ 木木木 5^^ 3^^ 3^^ 3^^ 木木 木木木 5^^ 3^^ 3^^ 木 y kbd_init(); //键盘初始化 printf(\nkeyboard init over!!!!!!!}; //ICcard_init(); //读卡模块初始化 printf(\nlt;ICcardReader control shellgt;); printf(\n [1] test the communicate with the ICcardModule*); printf(\n [2] set defaule ICcardReader:searchmode); printf(\n [3] set default block for read,and the key needed); printf(\n [4] Test it as the Iccard used in the bus ticket system!); printf(\n [5] contorl with the buzzer); printf(\n [6] read defalt data}; printf(\n [7] read data in the block which you choose); printf(\n [8] write defalt data); printf(\n [9] write data in the block which you choose); printf(\n [/] turn off the card); printf(\n [-] request the card states); printf(u\n [0] exit); printf(H\n [**] help menu); while(l){ printf(shell_s); fflush(stdout); getjine(cmd); printf(\r\nwe get it!!!!!!!!!!!!); //显示必要的输出 if(strncmp(,,l,cmd,l)==O){ printf(*\nyou select to test the communicate with the ICcardModule); fflush(stdout); fflush(stdin); tty_fflush();//05-22 Commu」est(); printf(\nwaiting for your next command!); fflush(stdout); } else if(strncmp(2,cmd,l)==0){ fflush(stdout); fflush(stdin); tty_fflush();//05-22 CLR_Set(); printf(\nwaiting for your next command!1); } else if(strncmp(3,,,cmd/l)==0){ //设置读卡器读取默认数据块的块号和相应的块的密码 fflush(stdout); fflush(stdin); tty_fflush();//O5-22 Set_DefBlock(Default_CardBlock?CardKey); printf(\nwe do success!); printf(\nwaiting for your next command!); }else if (strncmp(4,cmd,l)==0){ while(l){ //演示中只使用了

文档评论(0)

1亿VIP精品文档

相关文档