Changeset 379 for branches/merlin
- Timestamp:
- 09/04/09 09:53:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/merlin/src/CAM/conax.c
r357 r379 9 9 10 10 /* 11 static unsigned int Conax_ToDate(char data0, char data1)11 static unsigned int cam_conax_to_date(char data0, char data1) 12 12 { // decimal: yyyymmdd 13 13 int y, m, d; … … 22 22 */ 23 23 24 static char *c hid_date(uchar *ptr, char *buf, int l)24 static char *cam_conax_chid_date(uchar *ptr, char *buf, int l) 25 25 { 26 26 if (buf) { … … 30 30 } 31 31 32 static int read_record(uchar *cmd, ushort cmd_size, uchar *result, ushort result_max_size, ushort *result_size)32 static int cam_conax_read_record(uchar *cmd, ushort cmd_size, uchar *result, ushort result_max_size, ushort *result_size) 33 33 { 34 34 uchar insCA[] = { 0xDD, 0xCA, 0x00, 0x00, 0x00 }; … … 44 44 } 45 45 46 static int CheckSctLen(const uchar * data, int off)46 static int cam_conax_check_sct_length(const uchar * data, int off) 47 47 { 48 48 int l = SCT_LEN(data); … … 56 56 } 57 57 58 static int c onax_send_pin()58 static int cam_conax_send_pin() 59 59 { 60 60 unsigned char insPIN[] = { 0xDD, 0xC8, 0x00, 0x00, 0x07, 0x1D, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00 }; //letzte vier ist der Pin-Code … … 99 99 uchar result[260]; 100 100 ushort result_size; 101 if ((n = read_record(ins26, sizeof(ins26), result, sizeof(result), &result_size)) < 0)101 if ((n = cam_conax_read_record(ins26, sizeof(ins26), result, sizeof(result), &result_size)) < 0) 102 102 return (0); // read caid, card-version 103 103 for (i = 0; i < n; i += result[i + 1] + 2) … … 110 110 } 111 111 112 if ((n = read_record(ins82, sizeof(ins82), result, sizeof(result), &result_size)) < 0)112 if ((n = cam_conax_read_record(ins82, sizeof(ins82), result, sizeof(result), &result_size)) < 0) 113 113 return (0); // read serial 114 114 … … 167 167 break; 168 168 case 0x30: 169 c hid_date(result + i + 2, pdate + (k++ << 4), 15);169 cam_conax_chid_date(result + i + 2, pdate + (k++ << 4), 15); 170 170 break; 171 171 } … … 188 188 unsigned char buf[256]; 189 189 190 if ((n = CheckSctLen(er->ecm, 3)) < 0)190 if ((n = cam_conax_check_sct_length(er->ecm, 3)) < 0) 191 191 return 0; 192 192 … … 223 223 break; 224 224 } else if (strcmp(reader[ridx].pincode, "none")) { 225 c onax_send_pin();225 cam_conax_send_pin(); 226 226 memcpy(insA2_cmd + 5, buf, insA2[4]); 227 227 cam_common_cmd2card(insA2_cmd, 5 + insA2[4], result, sizeof(result), &result_size); // write Header + ECM
Note:
See TracChangeset
for help on using the changeset viewer.