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);
94 virtual int Read(uint8_t *Buffer,
int MaxLength) {
return 0; }
99 virtual void Write(
const uint8_t *Buffer,
int Length) {}
101 virtual bool Reset(
int Slot) {
return false; }
119 virtual bool SetIdle(
bool Idle,
bool TestOnly) {
return false; }
120 virtual bool IsIdle(
void)
const {
return false; }
186 virtual bool Reset(
void);
211 virtual bool Ready(
void);
213 virtual bool HasMMI(
void);
227 virtual bool ProvidesCa(
const int *CaSystemIds);
234 virtual void AddPid(
int ProgramNumber,
int Pid,
int StreamType);
237 virtual void SetPid(
int Pid,
bool Active);
321 void Reset(
int CamSlotNumber);
virtual bool SetIdle(bool Idle, bool TestOnly)
virtual void Action(void)
Handles the attached CAM slots in a separate thread.
virtual 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.
virtual void StartActivation(void)
Puts the CAM in this slot into a mode where an inserted smart card can be activated.
cCamSlot * ItCamSlot(int &Iter)
Iterates over all added CAM slots of this adapter.
virtual void AddPid(int ProgramNumber, int Pid, int StreamType)
Adds the given PID information to the list of PIDs.
virtual void Write(const uint8_t *Buffer, int Length)
Writes Length bytes of the given Buffer.
virtual void StartDecrypting(void)
Triggers sending all currently active CA_PMT entries to the CAM, so that it will start decrypting...
virtual bool IsIdle(void) const
#define MAX_CONNECTIONS_PER_CAM_SLOT
cChannelCamRelations ChannelCamRelations
#define MAX_CAM_SLOTS_PER_ADAPTER
virtual bool CanActivate(void)
Returns true if there is a CAM in this slot that can be put into activation mode. ...
int SlotIndex(void)
Returns the index of this CAM slot within its CI adapter.
virtual eModuleStatus ModuleStatus(void)
Returns the status of the CAM in this slot.
virtual void AddChannel(const cChannel *Channel)
Adds all PIDs if the given Channel to the current list of PIDs.
void SendCaPmt(uint8_t CmdId)
virtual bool Reset(int Slot)
Resets the CAM in the given Slot.
cCiTransportConnection * tc[MAX_CONNECTIONS_PER_CAM_SLOT+1]
cCaActivationReceiver * caActivationReceiver
cCiSession * GetSessionByResourceId(uint32_t ResourceId)
void Process(cTPDU *TPDU=NULL)
virtual 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)
virtual 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...
virtual cCiMenu * GetMenu(void)
Gets a pending menu, or NULL if there is no menu.
cList< cCiCaProgramData > caProgramList
bool WantsTsData(void) const
Returns true if this CAM slot wants to receive the TS data through its Decrypt() function.
cCamSlot(cCiAdapter *CiAdapter, bool WantsTsData=false)
Creates a new CAM slot for the given CiAdapter.
bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber)
virtual int Read(uint8_t *Buffer, int MaxLength)
Reads one chunk of data into the given Buffer, up to MaxLength bytes.
eModuleStatus lastModuleStatus
void AddCamSlot(cCamSlot *CamSlot)
Adds the given CamSlot to this CI adapter.
const int * GetCaSystemIds(void)
virtual bool Reset(void)
Resets the CAM in this slot.
virtual bool IsDecrypting(void)
Returns true if the CAM in this slot is currently used for decrypting.
void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber)
virtual 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]
virtual cCiEnquiry * GetEnquiry(void)
Gets a pending enquiry, or NULL if there is no enquiry.
cChannelCamRelation * AddEntry(tChannelID ChannelID)
bool WaitForAllCamSlotsReady(int Timeout=0)
Waits until all CAM slots have become ready, or the given Timeout (seconds) has expired.
void Reply(const char *s)
virtual eModuleStatus ModuleStatus(int Slot)
Returns the status of the CAM in the given Slot.
virtual bool HasMMI(void)
Returns 'true' if the CAM in this slot has an active MMI.
void SetChecked(tChannelID ChannelID, int CamSlotNumber)
virtual const char * GetCamName(void)
Returns the name of the CAM in this slot, or NULL if there is no ready CAM in this slot...
virtual bool Ready(void)
Returns 'true' if the CAM in this slot is ready to decrypt.
cCaPidReceiver * caPidReceiver
virtual void CancelActivation(void)
Cancels a previously started activation (if any).
virtual uchar * Decrypt(uchar *Data, int &Count)
If this is a CAM slot that can be freely assigned to any device, but will not be directly inserted in...
int Priority(void)
Returns the priority of the device this slot is currently assigned to, or IDLEPRIORITY if it is not a...
bool CamChecked(tChannelID ChannelID, int CamSlotNumber)
virtual 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)
virtual bool EnterMenu(void)
Requests the CAM in this slot to start its menu.
virtual bool Assign(cDevice *Device, bool Query=false)
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.
virtual bool IsActivating(void)
Returns true if this CAM slot is currently activating a smart card.
cChannelCamRelations(void)
void DeleteAllConnections(void)
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.
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.