Changeset 593


Ignore:
Timestamp:
Dec 1, 2009, 1:07:15 PM (10 years ago)
Author:
cogsi
Message:

cccam reader now selects card at lowest hop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cccam-test/module-cccam.c

    r592 r593  
    507507static int cc_send_ecm(ECM_REQUEST *er, uchar *buf)
    508508{
    509   int n, h = 0;
     509  int n, h = -1;
    510510  struct cc_data *cc = reader[ridx].cc;
    511511  struct cc_card *card;
     
    522522      LLIST_ITR pitr;
    523523      char *prov = llist_itr_init(card->provs, &pitr);
    524       while (prov && !h) {
     524      while (prov) {
    525525        if (B24(prov) == er->prid) {  // provid matches
    526           if (!h || (card->hop < h)) {  // card is closer
     526          if ((h < 0) || (card->hop < h)) {  // card is closer
    527527            cc->cur_card = card;
    528             h = 1;  // card has been matched
     528            h = card->hop;  // card has been matched
    529529          }
    530530        }
Note: See TracChangeset for help on using the changeset viewer.