19 #define MAX_CAM_SLOTS_PER_ADAPTER 8 // maximum possible value is 255
20 #define MAX_CONNECTIONS_PER_CAM_SLOT 8 // maximum possible value is 254
21 #define CAM_READ_TIMEOUT 50 // ms
69 void Reply(
const char *s);
91 virtual int Read(uint8_t *Buffer,
int MaxLength) = 0;
96 virtual void Write(
const uint8_t *Buffer,
int Length) = 0;
98 virtual bool Reset(
int Slot) = 0;
116 virtual bool Ready(
void);
203 void AddPid(
int ProgramNumber,
int Pid,
int StreamType);
206 void SetPid(
int Pid,
bool Active);
250 void Reset(
int CamSlotNumber);
virtual void Action(void)
Handles the attached CAM slots in a separate thread.
bool ProvidesCa(const int *CaSystemIds)
Returns true if the CAM in this slot provides one of the given CaSystemIds.
virtual ~cCiAdapter()
The derived class must call Cancel(3) in its destructor.
void AddPid(int ProgramNumber, int Pid, int StreamType)
Adds the given PID information to the list of PIDs.
void StartDecrypting(void)
Triggers sending all currently active CA_PMT entries to the CAM, so that it will start decrypting...
#define MAX_CONNECTIONS_PER_CAM_SLOT
virtual bool Reset(int Slot)=0
Resets the CAM in the given Slot.
cChannelCamRelations ChannelCamRelations
#define MAX_CAM_SLOTS_PER_ADAPTER
virtual eModuleStatus ModuleStatus(int Slot)=0
Returns the status of the CAM in the given Slot.
virtual void Write(const uint8_t *Buffer, int Length)=0
Writes Length bytes of the given Buffer.
virtual bool Ready(void)
Returns 'true' if all present CAMs in this adapter are ready.
int SlotIndex(void)
Returns the index of this CAM slot within its CI adapter.
eModuleStatus ModuleStatus(void)
Returns the status of the CAM in this slot.
void AddChannel(const cChannel *Channel)
Adds all PIDs if the given Channel to the current list of PIDs.
void SendCaPmt(uint8_t CmdId)
cCiTransportConnection * tc[MAX_CONNECTIONS_PER_CAM_SLOT+1]
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.
cCiSession * GetSessionByResourceId(uint32_t ResourceId)
void Process(cTPDU *TPDU=NULL)
bool HasUserIO(void)
Returns true if there is a pending user interaction, which shall be retrieved via GetMenu() or GetEnq...
void SetDecrypt(tChannelID ChannelID, int CamSlotNumber)
bool CanDecrypt(const cChannel *Channel)
Returns true if there is a CAM in this slot that is able to decrypt the given Channel (or at least cl...
cCiMenu * GetMenu(void)
Gets a pending menu, or NULL if there is no menu.
cList< cCiCaProgramData > caProgramList
bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber)
eModuleStatus lastModuleStatus
void AddCamSlot(cCamSlot *CamSlot)
Adds the given CamSlot to this CI adapter.
const int * GetCaSystemIds(void)
bool Reset(void)
Resets the CAM in this slot.
bool IsDecrypting(void)
Returns true if the CAM in this slot is currently used for decrypting.
void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber)
void SetPid(int Pid, bool Active)
Sets the given Pid (which has previously been added through a call to AddPid()) to Active...
cCamSlot * camSlots[MAX_CAM_SLOTS_PER_ADAPTER]
cCiEnquiry * GetEnquiry(void)
Gets a pending enquiry, or NULL if there is no enquiry.
cChannelCamRelation * AddEntry(tChannelID ChannelID)
void Reply(const char *s)
bool HasMMI(void)
Returns 'true' if the CAM in this slot has an active MMI.
virtual int Read(uint8_t *Buffer, int MaxLength)=0
Reads one chunk of data into the given Buffer, up to MaxLength bytes.
void SetChecked(tChannelID ChannelID, int CamSlotNumber)
const char * GetCamName(void)
Returns the name of the CAM in this slot, or NULL if there is no ready CAM in this slot...
bool Ready(void)
Returns 'true' if the CAM in this slot is ready to decrypt.
int Priority(void)
Returns the priority if the device this slot is currently assigned to, or IDLEPRIORITY if it is not a...
bool CamChecked(tChannelID ChannelID, int CamSlotNumber)
void StopDecrypting(void)
Clears the list of CA_PMT entries and tells the CAM to stop decrypting.
void ClrChecked(tChannelID ChannelID, int CamSlotNumber)
void Reset(int CamSlotNumber)
bool EnterMenu(void)
Requests the CAM in this slot to start its menu.
virtual bool Assign(cDevice *Device, bool Query=false)=0
Assigns this adapter to the given Device, if this is possible.
cChannelCamRelation * GetEntry(tChannelID ChannelID)
bool Assign(cDevice *Device, bool Query=false)
Assigns this CAM slot to the given Device, if this is possible.
cChannelCamRelations(void)
void DeleteAllConnections(void)
cCamSlot(cCiAdapter *CiAdapter)
Creates a new CAM slot for the given CiAdapter.
int SlotNumber(void)
Returns the number of this CAM slot within the whole system.
The cDevice class is the base from which actual devices can be derived.