Changeset 2853 for trunk/reader-dre.c


Ignore:
Timestamp:
Jul 26, 2010, 3:20:11 PM (9 years ago)
Author:
merek
Message:

Adding DRE reader Patch from ticket #601

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-dre.c

    r2074 r2853  
    153153  case 0x11:
    154154    card = "Tricolor Centr";
    155     reader->caid[0] = 0x4ae0;
     155    reader->caid[0] = 0x4ae1;
    156156    break;          //59 type card = MSP (74 type = ATMEL)
    157157  case 0x12:
    158158    card = "Cable TV";
    159     reader->caid[0] = 0x4ae0;   //TODO not sure about this one
     159    reader->caid[0] = 0x4ae1;   //TODO not sure about this one
    160160    break;
    161161  case 0x14:
     
    361361
    362362  if (reader->caid[0] == 0x4ae1) {
    363     static uchar emmcmd52[0x3a];
    364     emmcmd52[0] = 0x52;
    365     int i;
    366     for (i = 0; i < 2; i++) {
    367       memcpy (emmcmd52 + 1, ep->emm + 5 + 32 + i * 56, 56);
    368       // check for shared address
    369       if(ep->emm[3]!=reader->sa[0][0])
    370         return OK; // ignore, wrong address
    371       emmcmd52[0x39] = reader->provider;
    372       if ((dre_cmd (emmcmd52)))
    373                 if ((cta_res[cta_lr - 2] != 0x90) || (cta_res[cta_lr - 1] != 0x00))
    374                 return ERROR;       //exit if response is not 90 00
    375         }
     363    if(ep->type == UNIQUE && ep->emm[39] == 0x3d)
     364    { /* For new package activation. */
     365        static uchar emmcmd58[26];
     366        emmcmd58[0] = 0x58;
     367        memcpy(&emmcmd58[1], &ep->emm[40], 24);
     368        emmcmd58[25] = 0x15;
     369        if ((dre_cmd (emmcmd58)))
     370            if ((cta_res[cta_lr - 2] != 0x90) || (cta_res[cta_lr - 1] != 0x00))
     371                return ERROR;
     372    }
     373    else
     374    {
     375        static uchar emmcmd52[0x3a];
     376        emmcmd52[0] = 0x52;
     377        int i;
     378        for (i = 0; i < 2; i++) {
     379            memcpy (emmcmd52 + 1, ep->emm + 5 + 32 + i * 56, 56);
     380            // check for shared address
     381            if(ep->emm[3]!=reader->sa[0][0])
     382                return OK; // ignore, wrong address
     383            emmcmd52[0x39] = reader->provider;
     384            if ((dre_cmd (emmcmd52)))
     385                if ((cta_res[cta_lr - 2] != 0x90) || (cta_res[cta_lr - 1] != 0x00))
     386                    return ERROR; //exit if response is not 90 00
     387        }
     388    }
    376389  }
    377390  else {
Note: See TracChangeset for help on using the changeset viewer.