11 #include <linux/dvb/ca.h> 12 #include <sys/ioctl.h> 23 if (ioctl(fd, CA_GET_CAP, &Caps) == 0) {
24 if ((Caps.slot_type & CA_CI_LINK) != 0) {
25 int NumSlots = Caps.slot_num;
27 for (
int i = 0; i < NumSlots; i++)
48 if (Buffer && MaxLength > 0) {
51 pfd[0].events = POLLIN;
64 if (Buffer && Length > 0) {
72 if (ioctl(
fd, CA_RESET, 1 << Slot) != -1)
83 if (ioctl(
fd, CA_GET_SLOT_INFO, &sinfo) != -1) {
84 if ((sinfo.flags & CA_CI_MODULE_READY) != 0)
86 else if ((sinfo.flags & CA_CI_MODULE_PRESENT) != 0)
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
void SetDescription(const char *Description,...) __attribute__((format(printf
cDvbCiAdapter(cDevice *Device, int Fd)
virtual bool Reset(int Slot)
Resets the CAM in the given Slot.
virtual void Write(const uint8_t *Buffer, int Length)
Writes Length bytes of the given Buffer.
static cDvbCiAdapter * CreateCiAdapter(cDevice *Device, int Fd)
void bool Start(void)
Sets the description of this thread, which will be used when logging starting or stopping of the thre...
virtual bool Assign(cDevice *Device, bool Query=false)
Assigns this adapter to the given Device, if this is possible.
virtual int Read(uint8_t *Buffer, int MaxLength)
Reads one chunk of data into the given Buffer, up to MaxLength bytes.
virtual eModuleStatus ModuleStatus(int Slot)
Returns the status of the CAM in the given Slot.
void Cancel(int WaitSeconds=0)
Cancels the thread by first setting 'running' to false, so that the Action() loop can finish in an or...
The cDevice class is the base from which actual devices can be derived.