mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
test c**
Origin commit data
------------------
Branch: master
Commit: ca27972f16
Author: max_10 <max_10@gmx.de>
Date: 2015-11-15 (Sun, 15 Nov 2015)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/* DVB CI Application Manager */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "dvbci_appmgr.h"
|
||||
|
||||
@@ -73,6 +75,7 @@ int eDVBCIApplicationManagerSession::doAction()
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x20};
|
||||
sendAPDU(tag);
|
||||
state = stateFinal;
|
||||
checkBlist();
|
||||
return 1;
|
||||
}
|
||||
case stateFinal:
|
||||
@@ -102,3 +105,56 @@ int eDVBCIApplicationManagerSession::startMMI()
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool eDVBCIApplicationManagerSession::readBlist()
|
||||
{
|
||||
int rc, i;
|
||||
char cSid[4] = {0,0,0,0};
|
||||
u16 Sid;
|
||||
FILE *fd;
|
||||
char blacklist_file[32];
|
||||
|
||||
sprintf(blacklist_file,"/etc/blacklist_slot_%d",slot->slot);
|
||||
|
||||
if (access(blacklist_file, F_OK) != 0)
|
||||
return false;
|
||||
fd = fopen(blacklist_file,"r");
|
||||
if (!fd)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
rc = fgetc(fd);
|
||||
if (rc == ',' || rc == EOF) break;
|
||||
cSid[i] = (char)rc;
|
||||
}
|
||||
if (rc == EOF) goto fin;
|
||||
if (i == 4)
|
||||
{
|
||||
Sid = (u16)strtol(cSid, NULL, 16);
|
||||
slot->bsids.push_back(Sid);
|
||||
}
|
||||
} while (rc != EOF);
|
||||
fin:
|
||||
fclose(fd);
|
||||
}
|
||||
if (slot->bsids.size())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::checkBlist()
|
||||
{
|
||||
if (readBlist())
|
||||
{
|
||||
printf("Blacked sids: %d > ", slot->bsids.size());
|
||||
for (unsigned int i = 0; i < slot->bsids.size(); i++)
|
||||
printf("%04x ", slot->bsids[i]);
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user