|
SASC
DVBSoftCAM
|
#include <stdlib.h>#include <stdio.h>#include "include/vdr/dvbdevice.h"#include "include/vdr/channels.h"#include "cam.h"#include "device.h"#include "sasccam.h"#include "scsetup.h"#include "device-tmpl.c"Go to the source code of this file.
Classes | |
| class | cScSascDevicePlugin |
Defines | |
| #define | SASC |
| #define | SCDEVICE cScSascDevice |
| #define | DVBDEVICE cDvbDevice |
| #define | OWN_SETCA |
Functions | |
| void | _SetCaDescr (int adapter, ca_descr_t *ca_descr) |
| void | _SetCaPid (int adapter, ca_pid_t *ca_pid) |
| #define DVBDEVICE cDvbDevice |
Definition at line 35 of file sasccam.cpp.
| #define OWN_SETCA |
Definition at line 36 of file sasccam.cpp.
| #define SASC |
Definition at line 20 of file sasccam.cpp.
| #define SCDEVICE cScSascDevice |
Definition at line 34 of file sasccam.cpp.
| void _SetCaDescr | ( | int | adapter, |
| ca_descr_t * | ca_descr | ||
| ) |
Definition at line 155 of file plugin_cam.c.
References sc_data::cafd, dprintf0, dprintf1, find_sc_from_adpt(), MSG_CAMUPDATE, MSG_LOW_PRIORITY, msg_send, NULL, update_keys(), and sc_data::virt.
Referenced by start_loopbackca().
{
struct sc_data *sc_data = find_sc_from_adpt(adapter);
unsigned long cadata;
if(!sc_data)
return;
dprintf1("Sending key(%d) %c %d %x%x...%x\n", sc_data->cafd,
(ca_descr->parity ? 'O' : 'E'), ca_descr->index,
ca_descr->cw[0], ca_descr->cw[1], ca_descr->cw[7]);
cadata = (ca_descr->index << 1) | (ca_descr->parity==0 ? 0 : 1);
msg_send(MSG_LOW_PRIORITY, MSG_CAMUPDATE, sc_data->virt, (void *)cadata);
if(sc_data->cafd >= 0) {
//Using a real CA
ca_descr_t tmp_dscr;
memcpy(&tmp_dscr, ca_descr, sizeof(tmp_dscr));
tmp_dscr.index--;
if(ioctl(sc_data->cafd,CA_SET_DESCR,&tmp_dscr)<0) {
dprintf0("CA_SET_DESCR failed (%s)\n", strerror(errno));
} else {
update_keys(sc_data->virt, 'N', ca_descr->index, NULL, 0);
}
} else {
update_keys(sc_data->virt, (ca_descr->parity==0) ? 'E' : 'O',
ca_descr->index, ca_descr->cw, 0);
}
}
| void _SetCaPid | ( | int | adapter, |
| ca_pid_t * | ca_pid | ||
| ) |
Definition at line 182 of file plugin_cam.c.
References sc_data::cafd, dprintf0, dprintf1, find_sc_from_adpt(), NULL, update_keys(), and sc_data::virt.
Referenced by start_loopbackca().
{
struct sc_data *sc_data = find_sc_from_adpt(adapter);
if(!sc_data)
return;
dprintf1("Sending (%d) key P %d PID: %d\n", sc_data->virt, ca_pid->index,
ca_pid->pid);
if(sc_data->cafd >= 0) {
//Using a real CA
ca_pid_t tmp_pid;
memcpy(&tmp_pid, ca_pid, sizeof(tmp_pid));
tmp_pid.index--;
if(ioctl(sc_data->cafd,CA_SET_PID,&tmp_pid) < 0 && tmp_pid.index > 0) {
dprintf0("CA_SET_PID failed (%s)\n", strerror(errno));
}
}
update_keys(sc_data->virt, 'P', ca_pid->index, NULL, ca_pid->pid);
}