Changeset 1948 for trunk/reader-dre.c
- Timestamp:
- 04/04/10 11:02:27 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-dre.c
r1946 r1948 2 2 #include "reader-common.h" 3 3 4 extern uchar cta_res[]; 5 extern ushort cta_lr; 4 6 static uchar provider; 5 7 static short int mode; … … 17 19 } 18 20 19 static int dre_command (struct s_reader * reader, uchar * cmd, int cmdlen, unsigned char * cta_res, unsigned short * cta_length) //attention: inputcommand will be changed!!!! answer will be in cta_res, length cta_lr ; returning 1 = no error, return ERROR = err 20 { 21 def_resp2; 21 static int dre_command (struct s_reader * reader, uchar * cmd, int cmdlen) //attention: inputcommand will be changed!!!! answer will be in cta_res, length cta_lr ; returning 1 = no error, return ERROR = err 22 { 22 23 static uchar startcmd[] = { 0x80, 0xFF, 0x10, 0x01, 0x05 }; //any command starts with this, 23 24 //last byte is nr of bytes of the command that will be sent … … 39 40 command[cmdlen++] = checksum; 40 41 41 reader_cmd2icc (reader, command, cmdlen , cta_res, &cta_lr);42 reader_cmd2icc (reader, command, cmdlen); 42 43 43 44 if ((cta_lr != 2) || (cta_res[0] != OK_RESPONSE)) { … … 47 48 48 49 reqans[4] = cta_res[1]; //adapt length byte 49 reader_cmd2icc (reader, reqans, 5 , cta_res, &cta_lr);50 reader_cmd2icc (reader, reqans, 5); 50 51 51 52 if (cta_res[0] != CMD_BYTE) { … … 89 90 #define dre_cmd(cmd) \ 90 91 { \ 91 dre_command(reader, cmd, sizeof(cmd) ,cta_res,&cta_lr); \92 dre_command(reader, cmd, sizeof(cmd)); \ 92 93 } 93 94 94 95 static int dre_set_provider_info (struct s_reader * reader) 95 96 { 96 def_resp;97 97 int i; 98 98 static uchar cmd59[] = { 0x59, 0x14 }; // subscriptions … … 139 139 { 140 140 get_atr; 141 def_resp;142 141 static uchar ua[] = { 0x43, 0x15 }; // get serial number (UA) 143 142 static uchar providers[] = { 0x49, 0x15 }; // get providers … … 257 256 int dre_do_ecm (struct s_reader * reader, ECM_REQUEST * er) 258 257 { 259 def_resp;260 258 if (mode == 41) { 261 259 static uchar ecmcmd41[] = { 0x41, … … 323 321 int dre_do_emm (struct s_reader * reader, EMM_PACKET * ep) 324 322 { 325 def_resp; 323 326 324 int emm_length = ((ep->emm[1] & 0x0f) << 8) + ep->emm[2]; 327 325
Note:
See TracChangeset
for help on using the changeset viewer.