SASC
DVBSoftCAM

cLogger Class Reference

Inheritance diagram for cLogger:

List of all members.

Public Member Functions

 cLogger (cCam *Cam, cDevice *Device, const char *DevId, bool soft)
virtual ~cLogger ()
void EcmStatus (const cEcmInfo *ecm, bool on)
void Up (void)
void Down (void)
void PreScan (int src, int tr)
 cLogger (cCam *Cam, cDevice *Device, const char *DevId, bool soft)
virtual ~cLogger ()
void EcmStatus (const cEcmInfo *ecm, bool on)
void Up (void)
void Down (void)
void PreScan (int src, int tr)

Protected Member Functions

virtual void Process (cPidFilter *filter, unsigned char *data, int len)
virtual void Process (cPidFilter *filter, unsigned char *data, int len)

Detailed Description

Definition at line 347 of file cam.c.


Constructor & Destructor Documentation

cLogger::cLogger ( cCam *  Cam,
cDevice *  Device,
const char *  DevId,
bool  soft 
)

Definition at line 380 of file cam.c.

References cAction::Priority().

:cAction("logger",Device,DevId)
{
  cam=Cam; devId=DevId; softCSA=soft;
  catfilt=0; up=false; prescan=pmNone;
  Priority(10);
}
cLogger::~cLogger ( ) [virtual]

Definition at line 388 of file cam.c.

References Down().

{
  Down();
}
cLogger::cLogger ( cCam *  Cam,
cDevice *  Device,
const char *  DevId,
bool  soft 
)
virtual cLogger::~cLogger ( ) [virtual]

Member Function Documentation

void cLogger::Down ( void  )

Definition at line 405 of file cam.c.

References cAction::DelAllFilter(), L_CORE_AUEXTRA, cThread::Lock(), PRINTF, and cThread::Unlock().

Referenced by cCam::Stop(), and ~cLogger().

{
  Lock();
  if(up) {
    PRINTF(L_CORE_AUEXTRA,"%s: DOWN",devId);
    ClearChains();
    DelAllFilter();
    catfilt=0; up=false; prescan=pmNone;
    }
  Unlock();
}
void cLogger::Down ( void  )
void cLogger::EcmStatus ( const cEcmInfo *  ecm,
bool  on 
)

Definition at line 425 of file cam.c.

References cSimpleListBase::Add(), cEcmInfo::caId, cEcmInfo::Compare(), cSimpleListBase::Del(), cSimpleList< T >::First(), L_CORE_AUEXTRA, cThread::Lock(), cSimpleList< T >::Next(), cEcmInfo::prgId, PRINTF, cEcmInfo::provId, cEcmInfo::source, cEcmInfo::transponder, cThread::Unlock(), and Up().

Referenced by cCam::LogEcmStatus().

{
  Lock();
  PRINTF(L_CORE_AUEXTRA,"%s: ecm prgid=%d caid=%04x prov=%.4x %s",devId,ecm->prgId,ecm->caId,ecm->provId,on ? "active":"inactive");
  source=ecm->source; transponder=ecm->transponder;
  cEcmInfo *e;
  if(on) {
    e=new cEcmInfo(ecm);
    active.Add(e);
    if(!up) Up();
    }
  else {
    for(e=active.First(); e; e=active.Next(e))
      if(e->Compare(ecm)) {
        active.Del(e);
        break;
        }
    }
  if(prescan>=pmWait) prescan=pmStop;
  SetChains();
  prescan=pmNone;
  Unlock();
}
void cLogger::EcmStatus ( const cEcmInfo *  ecm,
bool  on 
)
void cLogger::PreScan ( int  src,
int  tr 
)
void cLogger::PreScan ( int  src,
int  tr 
)

Definition at line 417 of file cam.c.

References cThread::Lock(), tr, cThread::Unlock(), and Up().

Referenced by cCam::PostTune().

{
  Lock();
  source=src; transponder=tr;
  prescan=pmStart; Up();
  Unlock();
}
void cLogger::Process ( cPidFilter *  filter,
unsigned char *  data,
int  len 
) [protected, virtual]

Implements cAction.

Definition at line 545 of file cam.c.

References cLogStats::Count(), data, cLogChain::delayed, cOverrides::GetCat(), HEXDUMP, L_CORE_AU, L_CORE_AUEXTRA, L_HEX_CAT, L_HEX_EMM, overrides, cPidFilter::Pid(), PRINTF, cLogChain::Process(), SCT_LEN, cTimeMs::Set(), cTimeMs::TimedOut(), and cPidFilter::userData.

{
  if(data && len>0) {
    if(filter==catfilt) {
      int vers=(data[5]&0x3E)>>1;
      if(data[0]==0x01 && vers!=catVers) {
        PRINTF(L_CORE_AUEXTRA,"%s: got CAT version %02x",devId,vers);
        catVers=vers;
        HEXDUMP(L_HEX_CAT,data,len,"CAT vers %02x",catVers);
        ClearChains();
        ProcessCat(&data[8],len-4-8);
        unsigned char buff[2048];
        if((len=overrides.GetCat(source,transponder,buff,sizeof(buff)))>0) {
          HEXDUMP(L_HEX_CAT,buff,len,"override CAT");
          ProcessCat(buff,len);
          }
        SetChains();
        if(prescan==pmStart) { prescan=pmWait; pretime.Set(2000); }
        }
      if(prescan==pmWait && pretime.TimedOut()) { prescan=pmActive; SetChains(); }
      }
    else {
      HEXDUMP(L_HEX_EMM,data,len,"EMM pid 0x%04x",filter->Pid());
      if(logstats) logstats->Count();
      if(SCT_LEN(data)==len) {
        cLogChain *chain=(cLogChain *)(filter->userData);
        if(chain) {
          chain->Process(filter->Pid(),data);
          if(chain->delayed) StopChain(chain,false);
          }
        }
      else PRINTF(L_CORE_AU,"%s: incomplete section %d != %d",devId,len,SCT_LEN(data));
      }
    }
  else {
    cLogChain *chain=(cLogChain *)(filter->userData);
    if(chain && chain->delayed) StopChain(chain,false);
    }
}
virtual void cLogger::Process ( cPidFilter *  filter,
unsigned char *  data,
int  len 
) [protected, virtual]

Implements cAction.

void cLogger::Up ( void  )

Definition at line 393 of file cam.c.

References L_CORE_AUEXTRA, cThread::Lock(), PRINTF, and cThread::Unlock().

Referenced by EcmStatus(), and PreScan().

{
  Lock();
  if(!up) {
    PRINTF(L_CORE_AUEXTRA,"%s: UP",devId);
    catVers=-1;
    catfilt=AddFilter(1,0x01,0xFF,0);
    up=true;
    }
  Unlock();
}
void cLogger::Up ( void  )

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