SASC-NG
DVBSoftCAM

cPlainKeyConstCw Class Reference

Inheritance diagram for cPlainKeyConstCw:

List of all members.

Public Member Functions

 cPlainKeyConstCw (bool Super)
virtual bool Parse (const char *line)
bool Matches (const cEcmInfo *ecm)

Protected Member Functions

virtual int IdSize (void)
virtual cString PrintKeyNr (void)
virtual bool CmpExtId (cPlainKey *k)

Detailed Description

Definition at line 42 of file constcw.c.


Constructor & Destructor Documentation

cPlainKeyConstCw::cPlainKeyConstCw ( bool  Super)

Definition at line 59 of file constcw.c.

:cHexKey(Super)
{
  freq=-1;
}

Member Function Documentation

bool cPlainKeyConstCw::CmpExtId ( cPlainKey *  k) [protected, virtual]

Reimplemented from cPlainKey.

Definition at line 65 of file constcw.c.

References k.

{
  cPlainKeyConstCw *ck=dynamic_cast<cPlainKeyConstCw *>(k); // downcast
  return ck && prgId==ck->prgId && source==ck->source && freq==ck->freq && pol==ck->pol;
}
virtual int cPlainKeyConstCw::IdSize ( void  ) [inline, protected, virtual]

Reimplemented from cPlainKey.

Definition at line 48 of file constcw.c.

{ return 4; }
bool cPlainKeyConstCw::Matches ( const cEcmInfo *  ecm)

Definition at line 71 of file constcw.c.

References cEcmInfo::prgId, cEcmInfo::source, and cEcmInfo::transponder.

Referenced by cSystemConstCw::ProcessECM().

{
  return ecm->prgId==prgId && ecm->source==source && ecm->transponder==transponder;
}
bool cPlainKeyConstCw::Parse ( const char *  line) [virtual]

Reimplemented from cHexKey.

Definition at line 76 of file constcw.c.

References Bin2Int, caid, cSource::FromString(), GetChar(), GetHex(), cSource::IsSat(), cPlainKey::keynr, PLAINLEN_CW, cHexKey::SetBinKey(), cChannel::Transponder(), and cPlainKey::type.

{
  unsigned char caid[2], skey[PLAINLEN_CW];
  if(GetChar(line,&type,1) && GetHex(line,caid,2)) {
    int num;
    char srcBuf[16];
    if(sscanf(line," %d:%c:%15[^:]:%d%n",&freq,&pol,srcBuf,&prgId,&num)==4) {
      source=cSource::FromString(srcBuf);
      transponder=freq;
      while(transponder>20000) transponder/=1000;
      if(cSource::IsSat(source)) transponder=cChannel::Transponder(transponder,pol);
      line+=num;
      if(GetHex(line,skey,PLAINLEN_CW)) {
        type=toupper(type);
        id=Bin2Int(caid,2);
        keynr=0;
        SetBinKey(skey,PLAINLEN_CW);
        return true;
        }
      }
    }
  return false;
}
cString cPlainKeyConstCw::PrintKeyNr ( void  ) [protected, virtual]

Reimplemented from cPlainKey.

Definition at line 100 of file constcw.c.

References cString::sprintf(), and cSource::ToString().

{
  return freq<0 ? "" : cString::sprintf("%d:%c:%s:%d",freq,pol,*cSource::ToString(source),prgId);
}

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