SASC-NG
DVBSoftCAM

cSystemCardClient Class Reference

Inheritance diagram for cSystemCardClient:

List of all members.

Public Member Functions

 cSystemCardClient (void)
virtual bool ProcessECM (const cEcmInfo *ecm, unsigned char *data)
virtual void ProcessEMM (int pid, int caid, const unsigned char *buffer)

Detailed Description

Definition at line 192 of file cc.c.


Constructor & Destructor Documentation

cSystemCardClient::cSystemCardClient ( void  )

Definition at line 201 of file cc.c.

References cSystem::hasLogger, and cSystem::local.

:cSystem(SYSTEM_NAME,SYSTEM_PRI)
{
  cc=0;
  local=false; hasLogger=true;
}

Member Function Documentation

bool cSystemCardClient::ProcessECM ( const cEcmInfo *  ecm,
unsigned char *  data 
) [virtual]

Implements cSystem.

Definition at line 208 of file cc.c.

References cMsgCache::Cache(), cEcmInfo::caId, cSystem::cw, cTimeMs::Elapsed(), cSystemLinkCardClient::FindBySysId(), cMsgCache::Get(), cCardClient::hostname, cSystem::KeyOK(), L_CC_CORE, cCardClient::msECM, cCardClient::Name(), cCardClient::port, PRINTF, cCardClient::ProcessECM(), SCT_LEN, start(), and stripspace().

{
  cCardClient *startCc=cc, *oldcc;
  do {
    if(cc) {
      cTimeMs start;
      int id=cc->msECM.Get(data,SCT_LEN(data),cw);
      if(id==0 || (id>0 && cc->ProcessECM(ecm,data,cw))) {
        int dur=start.Elapsed();
        if(dur>2000) {
          char bb[32];
          time_t now=time(0);
          ctime_r(&now,bb); stripspace(bb);
          PRINTF(L_CC_CORE,"%s: lagged cw %d ms (%s)",bb,dur,cc->Name());
          }
        char buff[32];
        snprintf(buff,sizeof(buff),"CC %s",cc->Name());
        KeyOK(buff);
        if(id>0) cc->msECM.Cache(id,true,cw);
        return true;
        }
      if(id>0) {
        PRINTF(L_CC_CORE,"client %s (%s:%d) ECM failed (%d ms)",cc->Name(),cc->hostname,cc->port,(int)start.Elapsed());
        cc->msECM.Cache(id,false,cw);
        }
      }
    if(!cc) PRINTF(L_CC_CORE,"cc-loop");
    oldcc=cc;
    cc=staticCcl.FindBySysId(ecm->caId,cc);
    if(cc && cc!=startCc) PRINTF(L_CC_CORE,"now trying client %s (%s:%d)",cc->Name(),cc->hostname,cc->port);
    } while(cc!=startCc && cc!=oldcc);
  return false;
}
void cSystemCardClient::ProcessEMM ( int  pid,
int  caid,
const unsigned char *  buffer 
) [virtual]

Reimplemented from cSystem.

Definition at line 242 of file cc.c.

References cSystemLinkCardClient::FindBySysId(), and cCardClient::ProcessEMM().

{
  cCardClient *cc=0;
  while((cc=staticCcl.FindBySysId(caid,cc)))
    cc->ProcessEMM(caid,buffer);
}

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines