SASC-NG
DVBSoftCAM

cCardClientAroureos Class Reference

Inheritance diagram for cCardClientAroureos:

List of all members.

Public Member Functions

 cCardClientAroureos (const char *Name)
virtual bool Init (const char *config)
virtual bool Login (void)
virtual bool ProcessECM (const cEcmInfo *ecm, const unsigned char *source, unsigned char *cw)
virtual bool ProcessEMM (int caSys, const unsigned char *source)

Detailed Description

Definition at line 28 of file aroureos.c.


Constructor & Destructor Documentation

cCardClientAroureos::cCardClientAroureos ( const char *  Name)

Definition at line 41 of file aroureos.c.

References cNetSocket::SetRWTimeout(), and cCardClient::so.


Member Function Documentation

bool cCardClientAroureos::Init ( const char *  config) [virtual]

Implements cCardClient.

Definition at line 64 of file aroureos.c.

References cCardClient::Logout(), and cCardClient::ParseStdConfig().

{
  cMutexLock lock(this);
  Logout();
  int num=0;
  return ParseStdConfig(config,&num) &&
         ParseCardConfig(config,&num);
}
bool cCardClientAroureos::Login ( void  ) [virtual]

Implements cCardClient.

Definition at line 73 of file aroureos.c.

References cNetSocket::Connect(), cCardClient::emmAllowed, cCardClient::hostname, L_CC_EMM, L_CC_LOGIN, cCardClient::Logout(), cCardClient::name, cCardClient::port, PRINTF, and cCardClient::so.

{
  Logout();
  if(!so.Connect(hostname,port)) return false;
  PRINTF(L_CC_LOGIN,"%s: connected to %s:%d",name,hostname,port);
  if(!emmAllowed) PRINTF(L_CC_EMM,"%s: EMM disabled from config",name);
  return true;  
}
bool cCardClientAroureos::ProcessECM ( const cEcmInfo *  ecm,
const unsigned char *  source,
unsigned char *  cw 
) [virtual]

Implements cCardClient.

Definition at line 102 of file aroureos.c.

References CheckNull(), cNetSocket::Flush(), cCardClient::RecvMsg(), SCT_LEN, cCardClient::SendMsg(), and cCardClient::so.

{
  cMutexLock lock(this);
  so.Flush();
  const int len=SCT_LEN(source);
  if(len<=93) {
    unsigned char buff[128];
    memcpy(buff,"ECM",3);
    memcpy(&buff[3],source,len);

    if(!SendMsg(buff,96)) return false;
    if(RecvMsg(buff,16)>0 && !CheckNull(buff,16)) {
      memcpy(cw,buff,16);
      return true;
      }
    }
  return false;
}
bool cCardClientAroureos::ProcessEMM ( int  caSys,
const unsigned char *  source 
) [virtual]

Reimplemented from cCardClient.

Definition at line 82 of file aroureos.c.

References AUTOMEM, cMsgCache::Cache(), cCardClient::emmAllowed, cMsgCache::Get(), cIdSet::MatchEMM(), cCardClient::msEMM, SCT_LEN, and cCardClient::SendMsg().

{
  if(emmAllowed) {
    cMutexLock lock(this);
    if(MatchEMM(source)) {
      const int length=SCT_LEN(source);
      int id=msEMM.Get(source,length,0);
      if(id>0 || emmAllowed>1) {
        unsigned char *buff=AUTOMEM(length+8);
        memcpy(buff,"EMM",3);
        memcpy(&buff[3],source,length);
        SendMsg(buff,length+3);
        msEMM.Cache(id,true,0);
        }
      return true;
      }
    }
  return false;
}

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