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