11 #include <linux/dvb/ca.h> 12 #include <sys/ioctl.h> 26 if (ioctl(fd, CA_GET_CAP, &Caps) == 0) {
27 if ((Caps.slot_type & CA_CI_LINK) != 0) {
28 int NumSlots = Caps.slot_num;
30 for (
int i = 0; i < NumSlots; i++)
71 if (TestOnly || (
idle == Idle))
85 if (Buffer && MaxLength > 0) {
88 pfd[0].events = POLLIN;
103 if (Buffer && Length > 0) {
113 if (ioctl(
fd, CA_RESET, 1 << Slot) != -1)
124 ca_slot_info_t sinfo;
126 if (ioctl(
fd, CA_GET_SLOT_INFO, &sinfo) != -1) {
127 if ((sinfo.flags & CA_CI_MODULE_READY) != 0)
129 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
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.
cDvbCiAdapter(cDevice *Device, int Fd, int Adapter=-1, int Frontend=-1)
virtual bool SetIdle(bool Idle, bool TestOnly)
void bool Start(void)
Sets the description of this thread, which will be used when logging starting or stopping of the thre...
bool HasSubDevice(void) const
static cDvbCiAdapter * CreateCiAdapter(cDevice *Device, int Fd, int Adapter=-1, int Frontend=-1)
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.
bool IsSubDevice(void) const
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.
static int DvbOpen(const char *Name, int Adapter, int Frontend, int Mode, bool ReportError=false)